glhcp/server/app/admin/view/content/help/edit.html

109 lines
4.4 KiB
HTML
Raw Normal View History

2023-08-10 06:59:52 +00:00
{layout name="layout2" /}
<style>
.layui-form-item .layui-input-inline { width: 340px; }
</style>
<div class="layui-card layui-form" style="box-shadow:none;">
<div class="layui-card-body">
<div class="layui-form-item">
<label for="title" class="layui-form-label"><span style="color:red;">*</span>帮助标题:</label>
<div class="layui-input-inline">
<input type="text" name="title" id="title" value="{$detail.title}" lay-verType="tips" lay-verify="required" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="cid" class="layui-form-label"><span style="color:red;">*</span>帮助分类:</label>
<div class="layui-input-inline">
<select name="cid" id="cid" lay-verType="tips" lay-verify="required">
<option value="">全部</option>
{volist name="category" id="vo"}
<option value="{$vo.id}" {if $detail.cid==$vo.id}selected{/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label for="intro" class="layui-form-label">帮助简介:</label>
<div class="layui-input-inline">
<input type="text" name="intro" id="intro" value="{$detail.intro ?? ''}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="sort" class="layui-form-label">帮助排序:</label>
<div class="layui-input-inline">
<input type="text" name="sort" id="sort" value="{$detail.sort}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">封面图:</label>
<div class="layui-input-block">
<div class="like-upload-image">
{if $detail.image}
<div class="upload-image-div">
<img src="{$detail.image}" alt="img">
<input type="hidden" name="image" value="{$detail.image}">
<div class="del-upload-btn">x</div>
</div>
<div class="upload-image-elem" style="display:none;"><a class="add-upload-image"> + 添加图片</a></div>
{else}
<div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
{/if}
</div>
<div class="layui-form-mid layui-word-aux">建议尺寸500*500像</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">帮助状态:</label>
<div class="layui-input-inline">
<input type="radio" name="is_show" value="1" title="显示" {if $detail.is_show==1}checked{/if}>
<input type="radio" name="is_show" value="0" title="隐藏" {if $detail.is_show==0}checked{/if}>
</div>
</div>
<div class="layui-form-item">
<label for="content" class="layui-form-label">帮助内容:</label>
<div class="layui-input-inline">
<textarea name="content" id="content" lay-verify="content">{$detail.content|raw}</textarea>
</div>
</div>
<div class="layui-form-item layui-hide">
<input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
</div>
</div>
</div>
<script>
layui.config({
base: "/static/lib/"
}).extend({
likeedit: "likeedit/likeedit"
}).use(["likeedit", "form"], function(){
var form = layui.form;
var likeedit = layui.likeedit;
var content = likeedit.build("content", {
uploadImage: {
url: '{:url("file/lists")}?type=10'
}
});
form.verify({
content: function() {
likeedit.sync(content)
}
});
like.delUpload();
$(document).on("click", ".add-upload-image", function () {
like.imageUpload({
limit: 1,
field: "image",
that: $(this)
});
});
})
</script>