index.html 7.9 KB
<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="javascript:;">系统设置</a></li>
    </ul>
    <div class="row margin-top-20">

        <div class="col-md-6">
            <form class="js-ajax-form" action="{:url('zj_system/edit')}" method="post">
                <div class="tab-content">
                    <div class="tab-pane active" id="A">
                        <div class="form-group">
                            <label for="mobile"><span class="form-required">*</span>退款客服电话</label>
                            <div>
                                <input type="text" class="form-control" required value="{$one.mobile}" id="mobile" name="mobile">
                            </div>
                        </div>
                        <div class="form-group">
                            <label><span class="form-required">*</span>关于我们-背景图</label>
                            <div style="text-align: center;">
                                <input type="hidden" name="about_img" id="thumbnai2"
                                       value="{$one.about_img|default=''}">
                                <a href="javascript:uploadOneImage('图片上传','#thumbnai2');">
                                    <if condition="empty($one.about_img)">
                                        <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                                             id="thumbnai2-preview"
                                             width="135" style="cursor: pointer"/>
                                        <else/>
                                        <img src="{:cmf_get_image_preview_url($one.about_img)}"
                                             id="thumbnai2-preview"
                                             width="135" style="cursor: pointer"/>
                                    </if>
                                </a>
                                <input type="button" class="btn btn-sm btn-cancel-thumbnai2" value="取消图片">
                            </div>
                        </div>
                        <div class="form-group">
                            <label><span class="form-required">*</span>关于我们-公司简介</label>
                            <div>
                                <script type="text/plain" id="content" name="about">{:cmf_replace_content_file_url(htmlspecialchars_decode($one.about))}</script>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="integral"><span class="form-required">*</span>返佣比例</label>
                            <div>
                                <input type="number" class="form-control" required id="integral" value="{$one.integral}" name="integral">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="integral"><span class="form-required">*</span>发货人信息</label>
                            <div>
                                <div class="col-md-5">发货人:<input type="text" required style="width: 80%;display: inline-block;" class="form-control" id="name" value="{$one.name}" name="name"></div>
                                <div class="col-md-5">手机号:<input type="number" required style="width: 80%;display: inline-block;" class="form-control" id="fmobile" value="{$one.fmobile}" name="fmobile"></div>
                            </div>
                        </div>
                        <br/>
                        <br/>
                        <br/>
                        <div class="form-group">
                            <label><span class="form-required">*</span>发货地址</label><br/>
                            <div class="col-md-3">省:<select required class="form-control " name="province" style="width: 80%;display: inline-block;" id="province" onchange="province1(this)"></select></div>
                            <div class="col-md-3">市:<select required class="form-control " name="city" style="width: 80%;display: inline-block;" id="city" onchange="city1(this)"></select></div>
                            <div class="col-md-3">区:<select required class="form-control " name="county" style="width: 80%;display: inline-block;" id="county"></select></div>
                        </div>
                        <br/>
                        <br/>
                        <br/>
                        <div class="form-group">
                            <label for="integral"><span class="form-required">*</span>详细地址</label>
                            <div>
                                <input type="text" required class="form-control" id="place" value="{$one.place}" name="place">
                            </div>
                        </div>
                    </div>
                <div class="form-group">
                    <input type="hidden" name="id" value="{$one.id}">
                    <button type="submit" class="btn btn-primary js-ajax-submit">保存</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript" src="__STATIC__/js/city-picker.js"></script>
<script>

    $('.btn-cancel-thumbnai2').click(function () {
        $('#thumbnai2-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
        $('#thumbnai2').val('');
    });

    var pla=$.rawCitiesData
    var ci=document.getElementById('city')
    var co=document.getElementById('county')


    $(function () {
        var pr=document.getElementById('province')
        var arr1=[];
        var arr2=[];
        for (i=0;i<pla.length;i++){
            if (pla[i].name=="{$one.province}"){
                arr1=pla[i].sub
                for (l=0;l<arr1.length;l++){
                    if (arr1[l].name=="{$one.city}"){
                        arr2=arr1[l].sub
                    }
                }
            }
        }
        ff(pr,pla,"{$one.province}")
        ff(ci,arr1,"{$one.city}")
        ff(co,arr2,"{$one.county}")
    })

    //选择省
    function province1(_this) {
        var arr1=[];
        for (i=0;i<pla.length;i++){
            if (pla[i].name==_this.value){
                arr1=pla[i].sub
            }
        }
        rem(ci)
        rem(co)
        ff(ci,arr1)
    }

    //选择市
    function city1(_this) {
        var pr=document.getElementById('province')
        var arr1=[];
        for (i=0;i<pla.length;i++){
            if (pla[i].name==pr.value){
                for (l=0;l<pla[i].sub.length;l++){
                    if (pla[i].sub[l].name==_this.value){
                        arr1=pla[i].sub[l].sub
                    }
                }
            }
        }
        rem(co)
        ff(co,arr1)
    }

    //添加option
    function ff(_this,arr,_name) {
        for(i=0;i<arr.length;i++){
            var opt=document.createElement('option');
            if (arr[i].name==_name){
                opt.selected=true;
            }
            opt.text=arr[i].name;
            opt.value=arr[i].name;
            _this.add(opt);
        }
    }
    //删除option
    function rem(_this) {
        for(i=_this.options.length-1;i>=0;i--){
            _this.remove(i)
        }
    }
</script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
    $(function () {

        editorcontent = new baidu.editor.ui.Editor();
        editorcontent.render('content');
        try {
            editorcontent.sync();
        } catch (err) {
        }

    });
</script>
</body>
</html>