| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-header">常见问题信息</div>
- <div class="layui-card-body" pad15>
- <div class="layui-form layui-form-pane" lay-filter="LAY-artapp-question-questionform-edit">
- <input type="hidden" name="id" value="{$question['id']}">
- <div class="layui-form-item">
- <label class="layui-form-label">分类</label>
- <div class="layui-input-block">
- <select name="cateid">
- {volist name="catelist" id="vo"}
- <option value="{$vo['id']}" {$question['cateid']==$vo['id'] ? 'selected' : '' }>{$vo['title']}</option>
- {/volist}
- </select>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label"><span style="color:#f90c05;">*</span>标题</label>
- <div class="layui-input-block">
- <input type="text" name="title" value="{$question['title']}" lay-verify="required" placeholder="请输入标题"
- autocomplete="off" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">详情</label>
- <div class="layui-input-block">
- <textarea class="layui-textarea" name="details" id="details" placeholder="请输入详情" style="display: none"
- lay-verify="editcontent">
- {$question['details']}
- </textarea>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label"><span style="color:#f90c05;">*</span>发布时间</label>
- <div class="layui-input-block">
- <input type="text" name="createtime" id="createtime" value="{$question['createtime']}" lay-verify="required"
- placeholder="请选择发布时间" autocomplete="off" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">置顶</label>
- <div class="layui-input-block">
- <select name="priority">
- <option value="0" {$question['priority']===0 ? 'selected' : '' }>不置顶</option>
- <option value="1" {$question['priority']===1 ? 'selected' : '' }>置顶一</option>
- <option value="2" {$question['priority']===2 ? 'selected' : '' }>置顶二</option>
- <option value="3" {$question['priority']===3 ? 'selected' : '' }>置顶三</option>
- <option value="4" {$question['priority']===4 ? 'selected' : '' }>置顶四</option>
- <option value="5" {$question['priority']===5 ? 'selected' : '' }>置顶五</option>
- <option value="6" {$question['priority']===6 ? 'selected' : '' }>置顶六</option>
- <option value="7" {$question['priority']===7 ? 'selected' : '' }>置顶七</option>
- <option value="8" {$question['priority']===8 ? 'selected' : '' }>置顶八</option>
- <option value="9" {$question['priority']===9 ? 'selected' : '' }>置顶九</option>
- </select>
- <div class="layui-form-mid layui-word-aux">倒序,值越大越靠前</div>
- </div>
- </div>
- <div class="layui-form-item" pane>
- <label class="layui-form-label">状态</label>
- <div class="layui-input-block">
- <input type="checkbox" lay-filter="switch" name="status" {eq name="question.status|default=1" value="1"
- }checked{/eq} lay-skin="switch" lay-text="已发布|待修改" value="1">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label"><span style="color:#f90c05;">*</span>浏览量</label>
- <div class="layui-input-block">
- <input type="text" name="volume" value="{$question['volume']}" lay-verify="required|number" placeholder="请输入浏览量"
- autocomplete="off" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-block">
- <input type="button" lay-submit lay-filter="LAY-artapp-question-questionform-edit-submit" value="确认提交" class="layui-btn">
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- layui.config({
- base: '/static/echoui/' //静态资源所在路径
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['index', 'form', 'set', 'layedit', 'laydate', 'upload'], function() {
- var $ = layui.$,
- setter = layui.setter,
- admin = layui.admin,
- layedit = layui.layedit,
- laydate = layui.laydate,
- form = layui.form,
- upload = layui.upload;
- form.render();
- var details = layedit.build('details', {
- uploadImage: { url: setter.baseAdminUrl + 'attachment/tplfieldimage', type: 'post' }
- });
- form.verify({
- editcontent: function(value) {
- layedit.sync(details);
- }
- });
- laydate.render({
- elem: '#createtime',
- type: 'datetime'
- });
- form.on('submit(LAY-artapp-question-questionform-edit-submit)', function(obj) {
- var index = parent.layer.getFrameIndex(window.name);
- admin.req({
- url: setter.baseAdminUrl + 'question/editquestion',
- type: 'post',
- data: obj.field,
- done: function(res) {
- layer.msg("提交成功", {
- icon: 1
- });
- parent.layui.table.reload('LAY-artapp-question-questionlist-table'); //重载表格
- parent.layer.close(index);
- }
- });
- });
- });
- </script>
|