Init Repo

This commit is contained in:
root
2019-09-06 23:53:10 +08:00
commit f0ef89dfbb
7905 changed files with 914138 additions and 0 deletions

View File

@ -0,0 +1,99 @@
{extend name="base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__ADMIN__/js/mmgrid/mmGrid.css?v={$v}" />
<style>
body{overflow:hidden;}
.layui-tab-content{padding:0px;}
</style>
{/block}
{block name="js"}
<script src="__ADMIN__/js/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script>
<script src="__ADMIN__/messages/message.js?v={$v}" type="text/javascript"></script>
<script src="__STATIC__/plugins/kindeditor/kindeditor.js?v={$v}" type="text/javascript" ></script>
{/block}
{block name="main"}
<div class="layui-tab layui-tab-brief" lay-filter="msgTab">
<ul class="layui-tab-title">
<li class="layui-this">消息列表</li>
<li >发送消息</li>
</ul>
<div class="layui-tab-content" >
<div class="layui-tab-item layui-show">
<table class='wst-form wst-box-top'>
<tr>
<th width='150'>发送类型<font color='red'>*</font></th>
<td style="text-align:left;" colspan='3' class='layui-form'>
<label><input type="radio" lay-filter="sendType" name="sendType" id="sendType" value="users" class='ipt' checked title='会员'></label>
<label><input type="radio" lay-filter="sendType" name="sendType" id="sendType" value="shop" class='ipt' title='店铺'></label>
<label><input type="radio" lay-filter="sendType" name="sendType" id="theUser" value="theUser" class='ipt' title='指定账号'></label>
</td>
</tr>
<tr id="user_query" style="display:none;">
<th></th>
<td>
<input type='text' id='loginName' name="loginName" value='' style="width:200px;" maxLength='20' placeholder="请输入要发送消息的账号"/>
</td>
<td><button type="button" class='btn btn-primary btn-mright' onclick="userQuery()"><i class="fa fa-search"></i>查询</button></td>
</tr>
<tr id="send_to" style="display:none;">
<th>指定接收账号<font color='red'>*</font></th>
<td width="200">
<select ondblclick="WST.multSelect({left:'ltarget',right:'rtarget',vtarget:'rtarget',val:'htarget'})" size="12" id="ltarget" multiple="" style="width:200px;height:160px;">
</select>
</td>
<td width="10">
<input type='hidden' id='htarget' value='' class='ipt'/>
<button onclick="javascript:WST.multSelect({left:'ltarget',right:'rtarget',vtarget:'rtarget',val:'htarget'})" class="btn btn-primary" type="button">&gt;&gt;</button>
<br>
<br>
<button onclick="javascript:WST.multSelect({left:'rtarget',right:'ltarget',vtarget:'rtarget',val:'htarget'})" class="btn btn-primary" type="button">&lt;&lt;</button>
</td>
<td>
<select ondblclick="WST.multSelect({left:'rtarget',right:'ltarget',vtarget:'rtarget',val:'htarget'})" size="12" id="rtarget" multiple="" style="width:200px;height:160px;">
</select>
</td>
</tr>
<tr>
<th>消息内容<font color='red'> </font></th>
<td colspan="10">
<textarea class='ipt' name="msgContent" id="msgContent" style="width:700px;height:150px;"></textarea>
</td>
</tr>
{if WSTGrant('SCXX_01')}
<tr>
<td colspan='4' align='center'>
<button type="button" onclick="sendMsg()" class='btn btn-primary btn-mright'><i class="fa fa-share"></i>发送</button>
<button type="button" onclick='javascript:history.go(-1)' class='btn'><i class="fa fa-angle-double-left"></i>返回</button>
</td>
</tr>
{/if}
</table>
</div>
<div class="layui-tab-item">
<div autocomplete='off' class="wst-toolbar">
<select style="float:left;" name="msgType" id="msgType" class="query">
<option value="-1">消息类型</option>
<option value="0">手工</option>
<option value="1">系统</option>
</select>
<input type="text" name="msgContent" placeholder='系统内容' id="msgContent" class="query" />
<button type="button" class='btn btn-primary btn-mright' onclick="javascript:msgQuery()"><i class="fa fa-search"></i>查询</button>
</div>
<div style="clear:both"></div>
<table id="mmg" class="mmg">
<tr>
<th rowspan="" colspan=""></th>
</tr>
</table>
<div id="pg" style="text-align: right;"></div>
</div>
</div>
{/block}

View File

@ -0,0 +1,162 @@
var grid;
var h;
$(function(){
form = layui.form;
form.on('radio(sendType)', function(data){
if(data.value=='theUser'){
$('#user_query').show();
$('#send_to').show();
}else{
$('#user_query').hide();
$('#send_to').hide();
}
});
var element = layui.element;
var isInit = false;
element.on('tab(msgTab)', function(data){
if(data.index==1){
if(!isInit){
isInit = true;
initGrid();
}else{
msgQuery();
}
}
});
});
function initGrid(){
var h = WST.pageHeight();
var cols = [
{title:'消息类型', name:'msgType', width: 30,renderer: function(val,item,rowIndex){
return (val==0)?'手工发送':'系统发送';
}},
{title:'发送者', name:'stName' ,width:50},
{title:'接收者', name:'loginName' ,width:50,renderer: function(val,item,rowIndex){
return (val!=null)?val:item['shopName'];
}},
{title:'消息内容', name:'msgContent' ,width:280},
{title:'阅读状态', name:'msgStatus' ,width:30,renderer: function(val,item,rowIndex){
return (val==0)?"<span class='statu-no'><i class='fa fa-ban'></i> 未读</span>":"<span class='statu-yes'><i class='fa fa-check-circle'></i> 已读</span>";
}},
{title:'有效状态', name:'dataFlag' ,width:30, align:'center',renderer: function(val,item,rowIndex){
return (val==-1)?"<span class='statu-wait'><i class='fa fa-ban'></i> 已删除</span>":"<span class='statu-yes'><i class='fa fa-check-circle'></i> 有效</span>";
}},
{title:'发送时间', name:'createTime' ,width:80},
{title:'操作', name:'' ,width:80, align:'center', renderer: function(val,item,rowIndex){
var h = "";
if(WST.GRANT.SCXX_00)h += "<button class='btn btn-blue' onclick='javascript:showFullMsg("+item['id']+")'><i class='fa fa-search'></i>查看</button> ";
if(WST.GRANT.SCXX_03)h += "<button class='btn btn-red' onclick='javascript:toDel(" + item['id'] + ")'><i class='fa fa-trash-o'></i>删除</button> ";
return h;
}}
];
mmg = $('.mmg').mmGrid({height: h-120,indexCol: true,indexColWidth:50, cols: cols,method:'POST',
url: WST.U('admin/Messages/pageQuery'), fullWidthRows: true, autoLoad: false,
plugins: [
$('#pg').mmPaginator({})
]
});
msgQuery();
}
function showFullMsg(id){
parent.showBox({title:'内容详情',type:2,content:WST.U('admin/messages/showFullMsg','id='+id),area: ['800px', '500px'],btn:['关闭']});
}
function toDel(id){
var box = WST.confirm({content:"您确定要删除该记录吗?",yes:function(){
var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
$.post(WST.U('admin/messages/del'),{id:id},function(data,textStatus){
layer.close(loading);
var json = WST.toAdminJson(data);
if(json.status=='1'){
WST.msg("操作成功",{icon:1});
layer.close(box);
msgQuery();
}else{
WST.msg(json.msg,{icon:2});
}
});
}});
}
//切换卡
$(function (){
//编辑器
KindEditor.ready(function(K) {
editor1 = K.create('textarea[name="msgContent"]', {
uploadJson : WST.conf.ROOT+'/admin/messages/editorUpload',
height:'350px',
allowFileManager : false,
allowImageUpload : true,
items:[
'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|','image','table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
'anchor', 'link', 'unlink', '|', 'about'
],
afterBlur: function(){ this.sync(); }
});
});
});
function sendToTheUser(t){
if($('#theUser').prop('checked')){
$('#user_query').show();
$('#send_to').show();
}else{
$('#user_query').hide();
$('#send_to').hide();
}
}
//账号模糊查找
function userQuery(){
var key = $('#loginName').val();
var html = '';
$.post(WST.U('admin/messages/userQuery'),{'loginName':key},function(text,dataStatus){
$(text).each(function(k,v){
html += '<option value="'+v.userId+'">'+v.loginName+'</option>';
});
$('#ltarget').html(html);
});
}
//发送消息
function sendMsg(){
var params = WST.getParams('.ipt');
var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
$.post(WST.U('admin/messages/add'),params,function(data,textStatus){
layer.close(loading);
var json = WST.toAdminJson(data);
if(json.status=='1'){
WST.msg("操作成功",{icon:1});
$('#ltarget').html('');
$('#rtarget').html('');
$('#loginName').val('');
editor1.html('');
}else{
WST.msg(json.msg,{icon:2});
}
});
}
function msgQuery(){
var query = WST.getParams('.query');
query.page = 1;
mmg.load(query);
}

View File

@ -0,0 +1,15 @@
{extend name="base" /}
{block name="js"}
<script src="__ADMIN__/messages/message.js?v={$v}" type="text/javascript"></script>
<script src="__STATIC__/plugins//kindeditor/kindeditor.js?v={$v}" type="text/javascript" ></script>
{/block}
{block name="main"}
<style>
body{overflow:auto;padding:5px;}
</style>
<div class="l-loading" style="display: block" id="wst-loading"></div>
<div id="msg">
<p>{$data['msgContent']}</p>
</div>
{/block}