data_edit.html 4.9 KB
<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('data_list')}">列表管理</a></li>
        <!--<li><a href="{:url('data_edit')}">添加 / 编辑</a></li>-->
    </ul>
    <form action="{:url('data_edit')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
        <div class="row">
            <div class="col-md-9">
                <table class="table table-bordered">

                    <tr>
                        <th>驾考类型<span class="form-required">*</span></th>
                        <td>
                            <input type="hidden" name="id" value="{$info.id|default=''}">
                            <input class="form-control" type="text" name="name" id="post_title" value="{$info.name|default=''}"
                                   placeholder="请输入标题">
                        </td>
                    </tr>
                    <tr>
                        <th>简介</th>
                        <td>
                            <textarea class="form-control" name="des" style="height: 50px;"
                                      placeholder="请填写简介">{$info.des|default=''}</textarea>
                        </td>
                    </tr>
                    <tr>
                        <th>价格</th>
                        <td>
                            <textarea class="form-control" name="price" style="height: 50px;"
                                      placeholder="请填写价格">{$info.price|default=''}</textarea>
                        </td>
                    </tr>
                    <!--<tr>-->
                    <!--<th>图片</th>-->
                    <!--<td>-->
                    <!--<div class="col-md-6 col-sm-10">-->
                    <!--<a href="javascript:uploadOneImage('图片上传','#photo-1');">点击上传图片</a>-->
                    <!--<br>-->
                    <!--<input id="photo-1" type="hidden" name="pic" >-->
                    <!--<input id="photo-1-name" type="hidden" name="pic" title="图片名称">-->
                    <!--<img id="photo-1-preview" width="200px">-->

                    <!--</div>-->
                    <!--</td>-->
                    <!--</tr>-->
                    <tr>
                        <th>驾考合同</th>
                        <td>
                            <script type="text/plain" id="content" name="hetong">{$info.hetong|default=''|htmlspecialchars_decode}</script>
                        </td>
                    </tr>
                </table>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary js-ajax-submit">提交</button>
                        <a class="btn btn-default" href="{:url('data_list')}">返回</a>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></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) {
        }

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

    });

    function doSelectCategory() {
        var selectedCategoriesId = $('#js-categories-id-input').val();
        openIframeLayer("{:url('AdminCategory/select')}?ids=" + selectedCategoriesId, '请选择分类', {
            area: ['700px', '400px'],
            btn: ['确定', '取消'],
            yes: function (index, layero) {
                //do something

                var iframeWin          = window[layero.find('iframe')[0]['name']];
                var selectedCategories = iframeWin.confirm();
                if (selectedCategories.selectedCategoriesId.length == 0) {
                    layer.msg('请选择分类');
                    return;
                }
                $('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
                $('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' '));
                //console.log(layer.getFrameIndex(index));
                layer.close(index); //如果设定了yes回调,需进行手工关闭
            }
        });
    }
</script>
<script>
    $('#input-list_tpl').val("{$list_tpl|default=''}");
    $('#input-one_tpl').val("{$one_tpl|default=''}");
</script>
</body>
</html>