glhcp/server/app/admin/view/content/article/add.html

108 lines
4.0 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" 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}">{$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" 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" 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" switch-tab="0" lay-verType="tips">
<div class="upload-image-elem"><a class="add-upload-image"> + 添加图片</a></div>
</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_notice" value="1" title="是">
<input type="radio" name="is_notice" value="0" title="否" checked>
</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="显示">
<input type="radio" name="is_show" value="0" title="隐藏" checked>
</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"></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>