init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
154
Application/Retail/View/Notice/add.html
可执行文件
154
Application/Retail/View/Notice/add.html
可执行文件
@@ -0,0 +1,154 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>新增通知</title>
|
||||
<style>
|
||||
html,body{
|
||||
background-color: rgb(246, 248, 249);
|
||||
font-size: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.box{
|
||||
border: 1px solid #bbb;
|
||||
border-radius: 5px;
|
||||
background-color: white;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.list{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
margin: 10px 0;
|
||||
}
|
||||
.title{
|
||||
background-color: #f5f5f5;
|
||||
color: black;
|
||||
font-size: 18px;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
line-height: 60px;
|
||||
border-radius: 5px 5px 0 0;
|
||||
text-indent: 15px;
|
||||
}
|
||||
.left_name{
|
||||
width: 100px;
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
line-height: 56px;
|
||||
color: #666;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.list>input{
|
||||
margin: 10px 0;
|
||||
width: 300px;
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
outline: none;
|
||||
}
|
||||
.list>select{
|
||||
width: 322px;
|
||||
margin: 10px 0;
|
||||
padding: 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
outline: none;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
.list>textarea{
|
||||
resize: none;
|
||||
width: 300px;
|
||||
height: 100px;
|
||||
padding: 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
outline: none;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
.save{
|
||||
font-size: 16px;
|
||||
width: 50px;
|
||||
background-color: #009688;
|
||||
color: white;
|
||||
text-align: center;
|
||||
padding: 8px 10px;
|
||||
border-radius: 5px;
|
||||
margin: 50px 200px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.save:hover{
|
||||
background-color: #099688;
|
||||
}
|
||||
.notice_content{
|
||||
width: 500px;
|
||||
height: 100px;
|
||||
margin-top:20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="padding: 50px">
|
||||
<form id="form">
|
||||
<div class="box">
|
||||
<div class="title">新增公告</div>
|
||||
<div class="list">
|
||||
<div class="left_name">通知标题:</div>
|
||||
<input type="text" id="title" name="title" placeholder="通知标题(不超过20字)">
|
||||
</div>
|
||||
<div class="list">
|
||||
<div class="left_name">通知内容:</div>
|
||||
<textarea id="content" name="content" class="notice_content" placeholder="通知内容(不超过200字)"></textarea>
|
||||
</div>
|
||||
<div class="save">创建</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
<script src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
|
||||
<script src="__PUBLIC__/js/tips.js"></script>
|
||||
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.use(['layer'], function () {
|
||||
var layer = layui.layer;
|
||||
$('.save').click(function () {
|
||||
var title = $('#title').val().trim();
|
||||
if(!title){
|
||||
showTips('请输入标题');
|
||||
return;
|
||||
}else if(title.length > 20){
|
||||
showTips('标题字符超出限制');
|
||||
return;
|
||||
}
|
||||
var content = $('#content').val().trim();
|
||||
if(!content){
|
||||
showTips('请输入内容');
|
||||
return;
|
||||
}else if(content.length >200){
|
||||
showTips('内容字符超出限制');
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: "{:U('/Retail/Notice/doadd')}",
|
||||
type: "POST",
|
||||
data: $('#form').serialize(),
|
||||
success: function (res) {
|
||||
// console.log(res);
|
||||
if(res.status==1){
|
||||
showTips(res.msg,function () {
|
||||
parent.layer.closeAll();
|
||||
})
|
||||
}else {
|
||||
showTips(res.msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
</html>
|
||||
154
Application/Retail/View/Notice/edit.html
可执行文件
154
Application/Retail/View/Notice/edit.html
可执行文件
@@ -0,0 +1,154 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>新增通知</title>
|
||||
<style>
|
||||
html,body{
|
||||
background-color: rgb(246, 248, 249);
|
||||
font-size: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.box{
|
||||
border: 1px solid #bbb;
|
||||
border-radius: 5px;
|
||||
background-color: white;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.list{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
margin: 10px 0;
|
||||
}
|
||||
.title{
|
||||
background-color: #f5f5f5;
|
||||
color: black;
|
||||
font-size: 18px;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
line-height: 60px;
|
||||
border-radius: 5px 5px 0 0;
|
||||
text-indent: 15px;
|
||||
}
|
||||
.left_name{
|
||||
width: 100px;
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
line-height: 56px;
|
||||
color: #666;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.list>input{
|
||||
margin: 10px 0;
|
||||
width: 300px;
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
outline: none;
|
||||
}
|
||||
.list>select{
|
||||
width: 322px;
|
||||
margin: 10px 0;
|
||||
padding: 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
outline: none;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
.list>textarea{
|
||||
resize: none;
|
||||
width: 300px;
|
||||
height: 100px;
|
||||
padding: 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
outline: none;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
.save{
|
||||
font-size: 16px;
|
||||
width: 50px;
|
||||
background-color: #009688;
|
||||
color: white;
|
||||
text-align: center;
|
||||
padding: 8px 10px;
|
||||
border-radius: 5px;
|
||||
margin: 50px 200px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.save:hover{
|
||||
background-color: #099688;
|
||||
}
|
||||
.notice_content{
|
||||
width: 500px;
|
||||
height: 100px;
|
||||
margin-top:20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="padding: 50px">
|
||||
<form id="form">
|
||||
<div class="box">
|
||||
<div class="title">修改公告</div>
|
||||
<input type="hidden" name="id" value="{$edit_data['id']}">
|
||||
<div class="list">
|
||||
<div class="left_name">通知标题:</div>
|
||||
<input type="text" id="title" name="title" value="{$edit_data['title']}" placeholder="通知标题(不超过20字)">
|
||||
</div>
|
||||
<div class="list">
|
||||
<div class="left_name">通知内容:</div>
|
||||
<textarea id="content" name="content" class="notice_content" placeholder="通知内容(不超过200字)">{$edit_data['content']}</textarea>
|
||||
</div>
|
||||
<div class="save">保存</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
<script src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
|
||||
<script src="__PUBLIC__/js/tips.js"></script>
|
||||
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.use(['layer'], function () {
|
||||
var layer = layui.layer;
|
||||
$('.save').click(function () {
|
||||
var title = $('#title').val().trim();
|
||||
if(!title){
|
||||
showTips('请输入标题');
|
||||
return;
|
||||
}else if(title.length > 20){
|
||||
showTips('标题字符超出限制');
|
||||
return;
|
||||
}
|
||||
var content = $('#content').val().trim();
|
||||
if(!content){
|
||||
showTips('请输入内容');
|
||||
return;
|
||||
}else if(content.length >200){
|
||||
showTips('内容字符超出限制');
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: "{:U('/Retail/Notice/doedit')}",
|
||||
type: "POST",
|
||||
data: $('#form').serialize(),
|
||||
success: function (res) {
|
||||
// console.log(res);
|
||||
if(res.status==1){
|
||||
showTips(res.msg,function () {
|
||||
parent.layer.closeAll();
|
||||
})
|
||||
}else {
|
||||
showTips(res.msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
@@ -0,0 +1,179 @@
|
||||
<!--[1.1.96]-->
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/goodsList.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/myscroll.css"/>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table {
|
||||
border: 1px solid #f1f1f1;
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.layui-table-cell {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#exchange {
|
||||
margin: 0 0 0 20px;
|
||||
}
|
||||
</style>
|
||||
<div class="goodsBox">
|
||||
<div class="goods_title">
|
||||
<div class="goods_title_inner">
|
||||
公告通知
|
||||
</div>
|
||||
</div>
|
||||
<div class="goods_edit">
|
||||
<form action="#" class="form-inline PromotionForm">
|
||||
<if condition="$authArr['add'] eq true">
|
||||
<button type="button" class="layui-btn" id="add">新增公告</button>
|
||||
</if>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/html" id="switchTpl">
|
||||
|
||||
<input type="checkbox" name="status" date-value="{{d.status}}" value="{{d.id}}" <if condition="$authArr['noticeon'] neq true"> disabled </if>
|
||||
lay-skin="switch" lay-text="启用|禁用" lay-filter="boxTest" {{ d.stype== 1 ? 'checked' : '' }}>
|
||||
|
||||
</script>
|
||||
<div class="goods_edit">
|
||||
<table class="layui-hide" id="test" lay-filter="demo"></table>
|
||||
<script type="text/html" id="barDemo">
|
||||
<if condition="$authArr['edit'] eq true">
|
||||
<button class="layui-btn layui-btn-xs" lay-event="edit">编辑</button>
|
||||
</if>
|
||||
<if condition="$authArr['del'] eq true">
|
||||
<button class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</button>
|
||||
</if>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['form', 'layedit', 'laydate', 'table'], function () {
|
||||
// 日期
|
||||
var laydate = layui.laydate, form = layui.form;
|
||||
var table = layui.table;
|
||||
//展示已知数据
|
||||
table.render({
|
||||
elem: '#test',
|
||||
url: "{:U('/Retail/Notice/getNotice')}",
|
||||
method:'post',
|
||||
cols: [
|
||||
[{
|
||||
field: 'id',
|
||||
title: '序号',
|
||||
width: 60
|
||||
}, {
|
||||
field: 'title',
|
||||
title: '标题',
|
||||
align: 'center',
|
||||
}, {
|
||||
field: 'content',
|
||||
title: '公告内容',
|
||||
align: 'center',
|
||||
}, {
|
||||
field: 'addtime',
|
||||
title: '添加时间',
|
||||
align: 'center',
|
||||
width: 180
|
||||
}, {
|
||||
field: 'stype',
|
||||
title: '状态',
|
||||
templet: '#switchTpl',
|
||||
align: 'center',
|
||||
width: 100
|
||||
}, {
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
toolbar: '#barDemo',
|
||||
width: 150
|
||||
}]
|
||||
],
|
||||
page: {
|
||||
layout: ['count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
|
||||
}, //是否开启分页
|
||||
});
|
||||
|
||||
table.on('tool(demo)', function (obj) {
|
||||
var data = obj.data;
|
||||
var layEvent = obj.event;
|
||||
if (layEvent === 'del') { //删除
|
||||
layer.confirm('确定删除这个通知吗?', function (index) {
|
||||
layer.close(index);
|
||||
$.post("{:U('/Retail/Notice/del')}", {
|
||||
id: data.id
|
||||
}, function (res) {
|
||||
// console.log(res);
|
||||
if (res.status == 1) {
|
||||
obj.del();
|
||||
} else {
|
||||
top.layer.msg(res.msg, {time: 1000});
|
||||
}
|
||||
})
|
||||
});
|
||||
}else if(layEvent === 'edit'){ //编辑
|
||||
layer.open({
|
||||
type: 2,
|
||||
content: "{:U('/Retail/Notice/edit')}?id="+data.id,
|
||||
title: "编辑通知",
|
||||
area: ["700px", '400px'],
|
||||
btnAlign: 'c',
|
||||
end: function () {
|
||||
MenuApp.refreshWindow();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
form.on('switch(boxTest)', function(data){
|
||||
var id = this.value;
|
||||
if(this.checked == true){
|
||||
$.ajax({
|
||||
url:"{:U('/Retail/Notice/noticeon')}",
|
||||
type:"POST",
|
||||
data:{id:id},
|
||||
success:function(res){
|
||||
// console.log(res);
|
||||
if(res.status == 1){
|
||||
top.layer.msg(res.msg, {time: 1000});
|
||||
}else {
|
||||
top.layer.msg(res.msg, {time: 1000});
|
||||
window.location.reload()
|
||||
}
|
||||
}
|
||||
})
|
||||
}else if(this.checked == false){
|
||||
$.ajax({
|
||||
url:"{:U('/Retail/Notice/noticeoff')}",
|
||||
type:"POST",
|
||||
data:{id:id},
|
||||
success:function(res){
|
||||
// console.log(res);
|
||||
if(res.status == 1){
|
||||
top.layer.msg(res.msg, {time: 1000});
|
||||
}else {
|
||||
top.layer.msg(res.msg, {time: 1000});
|
||||
window.location.reload()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
$('#add').click(function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
content: "{:U('/Retail/Notice/add')}",
|
||||
title: "新增通知",
|
||||
area: ["700px", '400px'],
|
||||
btnAlign: 'c',
|
||||
end: function () {
|
||||
MenuApp.refreshWindow();
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
})
|
||||
</script>
|
||||
在新工单中引用
屏蔽一个用户