You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
236 lines
11 KiB
236 lines
11 KiB
<?php /*a:2:{s:62:"E:\waibao\ahbcqz\server\app\admin\view\content\help\lists.html";i:1679478874;s:51:"E:\waibao\ahbcqz\server\app\admin\view\layout1.html";i:1679478874;}*/ ?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title><?php echo url(); ?></title>
|
|
<meta name="renderer" content="webkit">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
<link rel="stylesheet" href="/static/lib/layui/css/layui.css?v=<?php echo htmlentities($front_version); ?>">
|
|
<link rel="stylesheet" href="/static/admin/css/app.css?v=<?php echo htmlentities($front_version); ?>">
|
|
<link rel="stylesheet" href="/static/admin/css/like.css?v=<?php echo htmlentities($front_version); ?>">
|
|
<script src="/static/lib/layui/layui.js?v=<?php echo htmlentities($front_version); ?>"></script>
|
|
<script src="/static/admin/js/app.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<?php echo $js_code; ?>
|
|
<script src="/static/admin/js/jquery.min.js"></script>
|
|
<script src="/static/admin/js/function.js"></script>
|
|
|
|
|
|
|
|
<div class="wrapper">
|
|
<div class="layui-card">
|
|
<!-- 操作提示 -->
|
|
<div class="layui-card-body">
|
|
<div class="layui-collapse" style="border:1px dashed #c4c4c4">
|
|
<div class="layui-colla-item">
|
|
<h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
|
|
<div class="layui-colla-content layui-show">
|
|
<p>*平台发布的操作说明,帮助文档,常见问题。用户可在商城的帮助功能查看。</p>
|
|
<p>*帮助文档排序值越小越前,排序值相同时新增文章在前。</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 搜索区域 -->
|
|
<div class="layui-card-body layui-form">
|
|
<div class="layui-form-item">
|
|
<div class="layui-inline">
|
|
<label for="title" class="layui-form-label">帮助标题:</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" id="title" name="title" autocomplete="off" class="layui-input">
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<label for="cid" class="layui-form-label">帮助分类:</label>
|
|
<div class="layui-input-inline">
|
|
<select name="cid" id="cid">
|
|
<option value="">全部</option>
|
|
<?php if(is_array($category) || $category instanceof \think\Collection || $category instanceof \think\Paginator): $i = 0; $__LIST__ = $category;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
|
|
<option value="<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['name']); ?></option>
|
|
<?php endforeach; endif; else: echo "" ;endif; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
|
|
<a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 主体区域 -->
|
|
<div class="layui-card-body">
|
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm layEvent" lay-event="add">新增帮助</button>
|
|
|
|
<table id="like-table-lists" lay-filter="like-table-lists"></table>
|
|
<script type="text/html" id="table-image">
|
|
{{# if(d.image){ }}
|
|
<img src="{{d.image}}" alt="图" style="width:28px;height:28px;">
|
|
{{# } }}
|
|
</script>
|
|
<script type="text/html" id="table-operation">
|
|
<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">编辑</a>
|
|
{{# if(d.is_show == '显示'){ }}<a class="layui-btn layui-btn-normal layui-btn-sm layui-btn-warm" lay-event="hide">隐藏</a>{{# } }}
|
|
{{# if(d.is_show == '隐藏'){ }}<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="hide">显示</a>{{# } }}
|
|
<a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
|
|
</script>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
layui.use(["table", "form"], function(){
|
|
var table = layui.table;
|
|
var form = layui.form;
|
|
|
|
|
|
like.tableLists("#like-table-lists", "<?php echo url(); ?>", [
|
|
{field:"id", width:60, title:"ID"}
|
|
,{field:"title", width:200, align:"center", title:"帮助标题"}
|
|
,{field:"image", width:100, align:"center", title:"封面图", templet:"#table-image"}
|
|
,{field:"category", width:150, align:"center", title:"帮助分类"}
|
|
,{field:"is_show", width:100, align:"center", title:"帮助状态"}
|
|
,{field:"visit", width:100, align:"center", title:"浏览量"}
|
|
,{field:"likes", width:100, align:"center", title:"点赞量"}
|
|
,{field:"sort", width:100, align:"center", title:"排序"}
|
|
,{field:"create_time", width:180, align:"center", title:"创建时间"}
|
|
,{title:"操作", width:200, align:"center", fixed:"right", toolbar:"#table-operation"}
|
|
]);
|
|
|
|
|
|
var active = {
|
|
add: function() {
|
|
layer.open({
|
|
type: 2
|
|
,title: "新增帮助"
|
|
,content: "<?php echo url('content.Help/add'); ?>"
|
|
,area: ["90%", "90%"]
|
|
,btn: ["确定", "取消"]
|
|
,yes: function(index, layero){
|
|
var iframeWindow = window["layui-layer-iframe" + index];
|
|
var submit = layero.find("iframe").contents().find("#addSubmit");
|
|
iframeWindow.layui.form.on("submit(addSubmit)", function(data){
|
|
like.ajax({
|
|
url: "<?php echo url('content.Help/add'); ?>",
|
|
data: data.field,
|
|
type: "POST",
|
|
success:function(res) {
|
|
if(res.code === 1) {
|
|
layui.layer.msg(res.msg);
|
|
layer.close(index);
|
|
table.reload("like-table-lists", {
|
|
where: {},
|
|
page: { cur: 1 }
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
submit.trigger("click");
|
|
}
|
|
});
|
|
},
|
|
edit: function(obj) {
|
|
layer.open({
|
|
type: 2
|
|
,title: "编辑帮助"
|
|
,content: "<?php echo url('content.Help/edit'); ?>?id=" + obj.data.id
|
|
,area: ["90%", "90%"]
|
|
,btn: ["确定", "取消"]
|
|
,yes: function(index, layero){
|
|
var iframeWindow = window["layui-layer-iframe" + index];
|
|
var submit = layero.find("iframe").contents().find("#addSubmit");
|
|
iframeWindow.layui.form.on("submit(addSubmit)", function(data){
|
|
data.field['id'] = obj.data.id;
|
|
like.ajax({
|
|
url: "<?php echo url('content.Help/edit'); ?>",
|
|
data: data.field,
|
|
type: "POST",
|
|
success:function(res) {
|
|
if(res.code === 1) {
|
|
layui.layer.msg(res.msg);
|
|
layer.close(index);
|
|
table.reload("like-table-lists", {
|
|
where: {},
|
|
page: { cur: 1 }
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
submit.trigger("click");
|
|
}
|
|
});
|
|
},
|
|
del: function(obj) {
|
|
layer.confirm("确定删除帮助:"+obj.data.title, function(index) {
|
|
like.ajax({
|
|
url: "<?php echo url('content.Help/del'); ?>",
|
|
data: {id: obj.data.id},
|
|
type: "POST",
|
|
success: function (res) {
|
|
if (res.code === 1) {
|
|
layui.layer.msg(res.msg);
|
|
layer.close(index);
|
|
obj.del();
|
|
}
|
|
}
|
|
});
|
|
layer.close(index);
|
|
})
|
|
},
|
|
hide: function(obj) {
|
|
var text = obj.data.is_show === '显示' ? '确定隐藏:' : '确定显示:';
|
|
layer.confirm(text+obj.data.title, function(index) {
|
|
like.ajax({
|
|
url: "<?php echo url('content.Help/hide'); ?>",
|
|
data: {id: obj.data.id},
|
|
type: "POST",
|
|
success: function (res) {
|
|
if (res.code === 1) {
|
|
layui.layer.msg(res.msg);
|
|
layer.close(index);
|
|
table.reload("like-table-lists", {
|
|
where: {},
|
|
page: { cur: 1 }
|
|
});
|
|
}
|
|
}
|
|
});
|
|
layer.close(index);
|
|
})
|
|
}
|
|
};
|
|
like.eventClick(active);
|
|
|
|
form.on("submit(search)", function(data){
|
|
table.reload("like-table-lists", {
|
|
where: data.field,
|
|
page: {
|
|
curr: 1
|
|
}
|
|
});
|
|
});
|
|
|
|
form.on("submit(clear-search)", function(){
|
|
$("#title").val("");
|
|
form.render("select");
|
|
table.reload("like-table-lists", {
|
|
where: {},
|
|
page: {
|
|
curr: 1
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
})
|
|
</script>
|
|
</body>
|
|
</html>
|