index.html 7.7 KB
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
        <title>二维码生成 - {$site.name}</title>
        <link href="__CDN__/assets/libs/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="http://apps.bdimg.com/libs/html5shiv/3.7/html5shiv.min.js"></script>
          <script src="http://apps.bdimg.com/libs/respond.js/1.4.2/respond.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="container">
            <h2>二维码生成</h2>
            <hr>
            <div class="well">
                <form action="" method="post">
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="control-label">文本内容</label>
                                <input type="text" name="text" class="form-control" placeholder="" value="http://www.example.com">
                            </div>
                            <div class="form-group">
                                <label class="control-label">标签</label>
                                <input type="text" name="label" placeholder="" class="form-control" value="示例文字">
                            </div>
                            <div class="form-group">
                                <label class="control-label">Logo</label>
                                <div class="form-inline">
                                    <div class="radio">
                                        <label>
                                            <input type="radio" name="logo" id="logoyes" value="1">
                                            显示(Logo地址在代码中修改)
                                        </label>
                                    </div>
                                    <div class="radio">
                                        <label>
                                            <input type="radio" name="logo" id="logono" value="0"  checked>
                                            不显示
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <input type="submit" class="btn btn-info" />
                                <input type="reset" class="btn btn-default" />
                            </div>
                        </div>

                        <div class="col-md-2">
                            <div id="toastTypeGroup">
                                <label>标签水平位置</label>
                                <div class="form-group radio">
                                    <label><input type="radio" name="labelalignment" value="left"></label>
                                </div>
                                <div class="form-group radio">
                                    <label><input type="radio" name="labelalignment" checked value="center"></label>
                                </div>
                                <div class="form-group radio">
                                    <label><input type="radio" name="labelalignment" value="right"></label>
                                </div>
                            </div>
                        </div>

                        <div class="col-md-2">
                            <div class="form-group">
                                <div class="form-group">
                                    <label class="control-label">前景色</label>
                                    <input type="text" name="foreground" placeholder="" class="form-control" value="#000000">
                                </div>
                                <div class="form-group">
                                    <label class="control-label">背景色</label>
                                    <input type="text" name="background" placeholder="" class="form-control" value="#ffffff">
                                </div>
                                <div class="form-group">
                                    <label class="control-label">大小</label>
                                    <input type="number" name="size" placeholder="" class="form-control" value="300">
                                </div>
                                <div class="form-group">
                                    <label class="control-label">内边距</label>
                                    <input type="number" name="padding" placeholder="" class="form-control" value="10">
                                </div>
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="form-group">
                                <label class="control-label">Logo大小</label>
                                <input type="number" name="logosize" placeholder="" class="form-control" value="50">
                            </div>
                            <div class="form-group">
                                <label class="control-label">标签大小</label>
                                <input type="number" name="labelfontsize" placeholder="" class="form-control" value="14">
                            </div>
                            <div class="form-group">
                                <div id="positionGroup">
                                    <label>容错级别</label>
                                    <div class="form-group radio">
                                        <label>
                                            <input type="radio" name="errorcorrection" value="low">
                                        </label>
                                    </div>
                                    <div class="form-group radio">
                                        <label>
                                            <input type="radio" name="errorcorrection" value="medium" checked="">中等
                                        </label>
                                    </div>
                                    <div class="form-group radio">
                                        <label>
                                            <input type="radio" name="errorcorrection" value="quartile">
                                        </label>
                                    </div>
                                    <div class="form-group radio">
                                        <label>
                                            <input type="radio" name="errorcorrection" value="high">超高
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <input type="text" class="form-control" id='qrcodeurl' />
            <img src="" alt="" id='qrcodeimg' />
        </div>
        <script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
        <script type="text/javascript">
            $(function () {
                $("form").submit(function () {
                    $("#qrcodeimg").prop("src", "{:addon_url('qrcode/index/build',[],false)}?" + $(this).serialize());
                    $("#qrcodeurl").val("{:addon_url('qrcode/index/build',[],false,true)}?" + $(this).serialize());
                    return false;
                });
                $("form").trigger('submit');
            });
        </script>
    </body>
</html>