You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
38
hyhproject/admin/view/wxpassivereplys/news.html
Executable file
38
hyhproject/admin/view/wxpassivereplys/news.html
Executable file
@ -0,0 +1,38 @@
|
||||
{extend name="base" /}
|
||||
{block name="js"}
|
||||
<script src="__ADMIN__/wxpassivereplys/news.js?v={$v}" type="text/javascript"></script>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
{if WSTGrant('WX_TWXX_01')}
|
||||
<div class="wst-toolbar">
|
||||
<button class="btn btn-success f-right" onclick="javascript:location.href='<?=url("wxpassivereplys/newsEdit")?>'"><i class='fa fa-plus'></i>新增</button>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
{/if}
|
||||
<script id="tblist" type="text/html">
|
||||
{{# var dl = d['Rows'];for(var i = 0; i < dl.length; i++){ }}
|
||||
<div class='style-box'>
|
||||
<div class='style-img'>
|
||||
<a href="javascript:void(0)">
|
||||
<img src='{{dl[i]["picUrl"]}}'/>
|
||||
</a>
|
||||
</div>
|
||||
<div class='style-txt'>关键字:{{dl[i]['keyword']}}</div>
|
||||
<div class='style-txt'>标题:{{dl[i]['title']}}</div>
|
||||
<div class='style-author'>描述:{{dl[i]['description']}}</div>
|
||||
<div class='style-op'>
|
||||
{{# if(WST.GRANT.WX_TWXX_02){ }}<a class='btn btn-blue' onclick="toEdit({{dl[i]['id']}})"><i class='fa fa-pencil'></i>编辑</a> {{# } }}
|
||||
{{# if(WST.GRANT.WX_TWXX_03){ }}<a class='btn btn-red' onclick="toDel({{dl[i]['id']}})"><i class='fa fa-trash-o'></i>删除</a> {{# } }}
|
||||
</div>
|
||||
</div>
|
||||
{{#}}}
|
||||
</script>
|
||||
<div id="maingrid"></div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function (){
|
||||
listQuery('home');
|
||||
});
|
||||
</script>
|
||||
{/block}
|
128
hyhproject/admin/view/wxpassivereplys/news.js
Executable file
128
hyhproject/admin/view/wxpassivereplys/news.js
Executable file
@ -0,0 +1,128 @@
|
||||
|
||||
function listQuery(){
|
||||
var loading = WST.msg('正在获取数据,请稍后...', {icon: 16,time:60000});
|
||||
$.post(WST.U('admin/wxpassivereplys/newsPageQuery'),{},function(data,textStatus){
|
||||
layer.close(loading);
|
||||
var json = WST.toAdminJson(data);
|
||||
if(json.status=='1'){
|
||||
var gettpl = document.getElementById('tblist').innerHTML;
|
||||
layui.laytpl(gettpl).render(json.data, function(html){
|
||||
$('#maingrid').html(html);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function toEdit(id){
|
||||
location.href=WST.U('admin/wxpassivereplys/newsEdit',{'id':id});
|
||||
}
|
||||
function toDel(id){
|
||||
var box = WST.confirm({content:"您确定要删除该记录吗?",yes:function(){
|
||||
var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
|
||||
$.post(WST.U('admin/wxpassivereplys/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);
|
||||
listQuery();
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
});
|
||||
}});
|
||||
}
|
||||
|
||||
function newsEditInit(){
|
||||
/* 表单验证 */
|
||||
$('#replyForm').validator({
|
||||
fields: {
|
||||
keyword: {
|
||||
rule:"required",
|
||||
msg:{required:"请输入关键字"},
|
||||
tip:"请输入关键字",
|
||||
ok:"",
|
||||
},
|
||||
title: {
|
||||
rule:"required",
|
||||
msg:{required:"请输入标题"},
|
||||
tip:"请输入标题",
|
||||
ok:"",
|
||||
},
|
||||
description: {
|
||||
rule:"required",
|
||||
msg:{required:"请输入描述"},
|
||||
tip:"请输入描述",
|
||||
ok:"",
|
||||
},
|
||||
picUrl: {
|
||||
rule:"required",
|
||||
msg:{required:"封面图片不能为空"},
|
||||
tip:"封面图片不能为空",
|
||||
ok:"",
|
||||
},
|
||||
content: {
|
||||
rule:"required",
|
||||
msg:{required:"请输入回复内容"},
|
||||
tip:"请输入回复内容",
|
||||
ok:"",
|
||||
},
|
||||
url: {
|
||||
rule:"required",
|
||||
msg:{required:"请输入图文链接"},
|
||||
tip:"请输入图文链接",
|
||||
ok:"",
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
valid: function(form){
|
||||
var params = WST.getParams('.ipt');
|
||||
var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
|
||||
$.post(WST.U('admin/wxpassivereplys/'+((params.id==0)?"add":"edit")),params,function(data,textStatus){
|
||||
layer.close(loading);
|
||||
var json = WST.toAdminJson(data);
|
||||
if(json.status=='1'){
|
||||
WST.msg("操作成功",{icon:1});
|
||||
location.href=WST.U('Admin/wxpassivereplys/news');
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
//文件上传
|
||||
WST.upload({
|
||||
pick:'#adFilePicker',
|
||||
formData: {dir:'wechat'},
|
||||
accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'},
|
||||
callback:function(f){
|
||||
var json = WST.toAdminJson(f);
|
||||
if(json.status==1){
|
||||
$('#uploadMsg').empty().hide();
|
||||
// $('#picUrl').val('http://'+document.domain+WST.conf.ROOT+'/'+json.savePath+json.thumb);
|
||||
$('#picUrl').val(WST.conf.IMGURL+'/'+json.savePath+json.name);
|
||||
$('#preview').html('<img src="'+WST.conf.IMGURL+'/'+json.savePath+json.thumb+'" height="75" />');
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
},
|
||||
progress:function(rate){
|
||||
$('#uploadMsg').show().html('已上传'+rate+"%");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
85
hyhproject/admin/view/wxpassivereplys/news_edit.html
Executable file
85
hyhproject/admin/view/wxpassivereplys/news_edit.html
Executable file
@ -0,0 +1,85 @@
|
||||
{extend name="base" /}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/webuploader/webuploader.css?v={$v}" />
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script src="__ADMIN__/wxpassivereplys/news.js?v={$v}" type="text/javascript"></script>
|
||||
<script type='text/javascript' src='__STATIC__/plugins/webuploader/webuploader.js?v={$v}'></script>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<style>
|
||||
#replyForm input[type="text"]{
|
||||
width: 200px;
|
||||
}
|
||||
</style>
|
||||
<div class="l-loading" style="display: block" id="wst-loading"></div>
|
||||
<form id="replyForm" autocomplete="off">
|
||||
<table class='wst-form wst-box-top'>
|
||||
<tr>
|
||||
<th width='150'>关键字<font color='red'>*</font>:</th>
|
||||
<td>
|
||||
<input type="text" class="ipt" id="keyword" name="keyword" value="{$data['keyword']}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width='150'>标题<font color='red'>*</font>:</th>
|
||||
<td>
|
||||
<input type="text" class="ipt" id="title" name="title" value="{$data['title']}" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<th width='150'>描述<font color='red'>*</font>:</th>
|
||||
<td>
|
||||
<input type="text" class="ipt" id="description" name="description" value="{$data['description']}" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<th width='150'>封面图片<font color='red'>*</font>:</th>
|
||||
<td>
|
||||
<div id='adFilePicker'>上传图标</div><span id='uploadMsg'></span>
|
||||
<input type='hidden' id='picUrl' class='ipt' {if ($data['picUrl']!='')}value="{$data['picUrl']}"{/if}/>
|
||||
</td>
|
||||
</tr>
|
||||
<th width='150'>封面图片预览<font color='red'> </font>:</th>
|
||||
<td>
|
||||
<div style="max-width:360px;max-height:200px;min-height:70px;" id="preview">
|
||||
{if ($data['picUrl']!='')}
|
||||
<img src="{$data['picUrl']}" style="max-width:360px;max-height:200px;" />
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th>回复内容<font color='red'>*</font>:</th>
|
||||
<td>
|
||||
<textarea id="content" name="content" class="ipt" style="width:300px;height:150px;">{$data['content']}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<th width='150'>图文链接<font color='red'>*</font>:</th>
|
||||
<td>
|
||||
<input type="text" class="ipt" id="url" name="url" value="{$data['url']}" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan='2' align='center' class='wst-bottombar'>
|
||||
<input type="hidden" name="id" id="id" class="ipt" value="{$data['id']}" />
|
||||
<input type="hidden" name="msgType" id="msgType" class="ipt" value="news" />
|
||||
<button type="submit" class='btn btn-primary btn-mright'><i class="fa fa-check"></i>提交</button>
|
||||
<button type="button" class='btn' onclick="javascript:history.go(-1)"><i class="fa fa-angle-double-left"></i>返回</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
<script>
|
||||
$(function(){newsEditInit()});
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
|
23
hyhproject/admin/view/wxpassivereplys/text.html
Executable file
23
hyhproject/admin/view/wxpassivereplys/text.html
Executable file
@ -0,0 +1,23 @@
|
||||
{extend name="base" /}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" type="text/css" href="__ADMIN__/js/mmgrid/mmGrid.css?v={$v}" />
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script src="__ADMIN__/js/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script>
|
||||
<script src="__ADMIN__/wxpassivereplys/text.js?v={$v}" type="text/javascript"></script>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
{if WSTGrant('WX_WBXX_01')}
|
||||
<div class="wst-toolbar">
|
||||
<button class="btn btn-success f-right" onclick="javascript:location.href='<?=url("wxpassivereplys/textEdit")?>'"><i class='fa fa-plus'></i>新增</button>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class='wst-grid'>
|
||||
<div id="mmg" class="mmg"></div>
|
||||
<div id="pg" style="text-align: right;"></div>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){initGrid()});
|
||||
</script>
|
||||
{/block}
|
90
hyhproject/admin/view/wxpassivereplys/text.js
Executable file
90
hyhproject/admin/view/wxpassivereplys/text.js
Executable file
@ -0,0 +1,90 @@
|
||||
var mmg;
|
||||
function initGrid(){
|
||||
var h = WST.pageHeight();
|
||||
var cols = [
|
||||
{title:'关键字', name:'keyword', width: 100},
|
||||
{title:'回复内容', name:'content', width: 100},
|
||||
{title:'操作', name:'' ,width:70, align:'center', renderer: function(val,item,rowIndex){
|
||||
var h = "";
|
||||
if(WST.GRANT.WX_WBXX_02)h += "<a class='btn btn-blue' href='"+WST.U('admin/wxpassivereplys/textEdit','id='+item['id'])+"'><i class='fa fa-pencil'></i>修改</a> ";
|
||||
if(WST.GRANT.WX_WBXX_03)h += "<a class='btn btn-red' href='javascript:toDel(" + item['id'] + ")'><i class='fa fa-trash-o'></i>删除</a> ";
|
||||
return h;
|
||||
}}
|
||||
];
|
||||
|
||||
mmg = $('.mmg').mmGrid({height: h-80,indexCol: true, cols: cols,method:'POST',
|
||||
url: WST.U('admin/wxpassivereplys/textPageQuery'), fullWidthRows: true, autoLoad: true,
|
||||
plugins: [
|
||||
$('#pg').mmPaginator({})
|
||||
]
|
||||
});
|
||||
}
|
||||
function toDel(id){
|
||||
var box = WST.confirm({content:"您确定要删除该记录吗?",yes:function(){
|
||||
var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
|
||||
$.post(WST.U('admin/wxpassivereplys/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);
|
||||
addonsQuery();
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
});
|
||||
}});
|
||||
}
|
||||
|
||||
function textEditInit(){
|
||||
/* 表单验证 */
|
||||
$('#replyForm').validator({
|
||||
fields: {
|
||||
keyword: {
|
||||
rule:"required",
|
||||
msg:{required:"请输入关键字"},
|
||||
tip:"请输入关键字",
|
||||
ok:"",
|
||||
},
|
||||
content: {
|
||||
rule:"required",
|
||||
msg:{required:"请输入回复内容"},
|
||||
tip:"请输入回复内容",
|
||||
ok:"",
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
valid: function(form){
|
||||
var params = WST.getParams('.ipt');
|
||||
var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
|
||||
$.post(WST.U('admin/wxpassivereplys/'+((params.id==0)?"add":"edit")),params,function(data,textStatus){
|
||||
layer.close(loading);
|
||||
var json = WST.toAdminJson(data);
|
||||
if(json.status=='1'){
|
||||
WST.msg("操作成功",{icon:1});
|
||||
location.href=WST.U('Admin/wxpassivereplys/text');
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
//查询
|
||||
function addonsQuery(){
|
||||
var query = WST.getParams('.query');
|
||||
query.page = 1;
|
||||
mmg.load(query);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
35
hyhproject/admin/view/wxpassivereplys/text_edit.html
Executable file
35
hyhproject/admin/view/wxpassivereplys/text_edit.html
Executable file
@ -0,0 +1,35 @@
|
||||
{extend name="base" /}
|
||||
{block name="js"}
|
||||
<script src="__ADMIN__/wxpassivereplys/text.js?v={$v}" type="text/javascript"></script>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="l-loading" style="display: block" id="wst-loading"></div>
|
||||
<form id="replyForm" autocomplete="off">
|
||||
<table class='wst-form wst-box-top'>
|
||||
<tr>
|
||||
<th width='150'>关键字<font color='red'>*</font>:</th>
|
||||
<td>
|
||||
<input type="text" class="ipt" id="keyword" name="keyword" value="{$data['keyword']}" />
|
||||
</td>
|
||||
</tr>
|
||||
<th>回复内容<font color='red'>*</font>:</th>
|
||||
<td>
|
||||
<textarea id="content" name="content" class="ipt" style="width:300px;height:150px;">{$data['content']}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' align='center' class='wst-bottombar'>
|
||||
<input type="hidden" name="id" id="id" class="ipt" value="{$data['id']}" />
|
||||
<input type="hidden" name="msgType" id="msgType" class="ipt" value="text" />
|
||||
<button type="submit" class='btn btn-primary btn-mright'><i class="fa fa-check"></i>提交</button>
|
||||
<button type="button" class='btn' onclick="javascript:history.go(-1)"><i class="fa fa-angle-double-left"></i>返回</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<script>
|
||||
$(function(){textEditInit()});
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
|
Reference in New Issue
Block a user