初始上传
158
addon/wechat/shop/view/fans/fans_tag_list.html
Executable file
@@ -0,0 +1,158 @@
|
||||
<style>
|
||||
.layui-table {margin: 0}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<button class="layui-btn" onclick="addOrEditTag('添加标签')">添加标签</button>
|
||||
<button class="layui-btn" onclick="syncTag()">同步标签</button>
|
||||
</div>
|
||||
<div>
|
||||
<table id="tag_list" lay-filter="tag_list" class="layui-table"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="operation">
|
||||
<a class="default" lay-event="edit">编辑</a> |
|
||||
<a class="default" lay-event="delete">删除</a> <br/>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="addOrEditTag">
|
||||
<div class="layui-form" lay-filter="otherInfo">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">标签名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="tag_name" class="layui-input" value="{{d.tag_name}}" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" lay-submit lay-filter="addOrEditTagSubmit">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
<input type="hidden" name="id" value="{{d.id}}">
|
||||
<input type="hidden" name="tag_id" value="{{d.tag_id}}">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var form,laytpl,index,layer;
|
||||
var table = new Table({
|
||||
elem : '#tag_list',
|
||||
filter : "tag_list",
|
||||
url : "{:addon_url('wechat://shop/fans/fansTagList')}",
|
||||
cols : [
|
||||
[
|
||||
{
|
||||
type : 'checkbox',
|
||||
unresize : 'true'
|
||||
},
|
||||
{
|
||||
field: 'tag_name',
|
||||
title: '标签名称',
|
||||
unresize : 'true'
|
||||
},
|
||||
{
|
||||
title : '操作',
|
||||
toolbar : '#operation',
|
||||
width : '30%',
|
||||
align : 'right',
|
||||
unresize : 'true'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
table.tool(function(obj){
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case 'edit':
|
||||
addOrEditTag('编辑标签', data);
|
||||
break;
|
||||
case 'delete':
|
||||
deleteTag(data);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
layui.use([ 'form', 'laytpl'], function() {
|
||||
laytpl = layui.laytpl;
|
||||
form = layui.form;
|
||||
form.render();
|
||||
|
||||
var repeat_flag = false;//防重复标识
|
||||
form.on('submit(addOrEditTagSubmit)', function (data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
var url = data.field.id > 0 ? '{:addon_url("wechat://shop/fans/editFansTag")}' : '{:addon_url("wechat://shop/fans/addFansTag")}';
|
||||
$.ajax({
|
||||
type: "post",
|
||||
async: false,
|
||||
url: url,
|
||||
dataType: 'json',
|
||||
data: data.field,
|
||||
success: function (res) {
|
||||
back();
|
||||
layer.msg(res.message);
|
||||
if (res.code == 0) {
|
||||
table.reload();
|
||||
}
|
||||
repeat_flag = false;
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
function addOrEditTag(title, data) {
|
||||
var tpl_data = data == undefined ? {tag_name: '', tag_id: 0, id: 0} : data;
|
||||
laytpl($("#addOrEditTag").html()).render(tpl_data, function (html) {
|
||||
index = layer.open({
|
||||
type: 1,
|
||||
title: title,
|
||||
skin: 'layer-tips-class',
|
||||
area: ['450px'],
|
||||
content: html
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
var repeat_flag_delete = false;//防重复标识
|
||||
function deleteTag(data){
|
||||
if (repeat_flag_delete) return;
|
||||
repeat_flag_delete = true;
|
||||
layer.confirm('确定要删除该标签吗?',function (index) {
|
||||
layer.close(index);
|
||||
$.ajax({
|
||||
type : "post",
|
||||
async : false,
|
||||
url : '{:addon_url("wechat://shop/fans/deleteFansTag")}',
|
||||
dataType: 'json',
|
||||
data : data,
|
||||
success:function(res){
|
||||
layer.msg(res.message);
|
||||
if(res.code == 0){
|
||||
table.reload();
|
||||
}
|
||||
repeat_flag_delete = false;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function syncTag(){
|
||||
$.ajax({
|
||||
url : '{:addon_url("wechat://shop/fans/syncFansTag")}',
|
||||
dataType: 'json',
|
||||
async : false,
|
||||
type : "post",
|
||||
beforeSend : function(){
|
||||
index = layer.load(2);
|
||||
},
|
||||
success:function(res){
|
||||
back();
|
||||
layer.msg(res.message);
|
||||
if(res.code == 0){
|
||||
table.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
212
addon/wechat/shop/view/fans/lists.html
Executable file
@@ -0,0 +1,212 @@
|
||||
<link rel="stylesheet" type="text/css" href="SHOP_CSS/member.css" />
|
||||
<link rel="stylesheet" type="text/css" href="WECHAT_CSS/wx_fans.css" />
|
||||
<style>
|
||||
.layui-layout-admin .tips-wrap{margin-bottom: 15px;}
|
||||
</style>
|
||||
|
||||
<div class="single-filter-box">
|
||||
<button class="layui-btn btn-hide" lay-submit="" lay-filter="save" onclick="refresh()">同步粉丝信息</button>
|
||||
<div class="layui-form">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="nickname" placeholder="请输入粉丝名称" autocomplete="off" class="layui-input">
|
||||
<button type="button" class="layui-btn layui-btn-primary" lay-filter="search" lay-submit>
|
||||
<i class="layui-icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示</h2>
|
||||
<div class="layui-colla-content layui-show">说明:把同步公众号上的实际粉丝数量与信息同步到商城中展示</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<table id="Fans_list" lay-filter="Fans_list"></table>
|
||||
|
||||
<!-- 批量操作 -->
|
||||
<script type="text/html" id="batchOperation">
|
||||
</script>
|
||||
|
||||
<!-- 地址 -->
|
||||
<script type="text/html" id="diqu">
|
||||
<p>{{d.country}}{{d.province}}{{d.city}}{{ d.district != '' && d.district != '无' ? d.district : '' }}</p>
|
||||
</script>
|
||||
|
||||
<!-- 操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<div class="table-btn">
|
||||
<a class="layui-btn" href="" lay-event="">查看消息</a>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- 用户信息 -->
|
||||
<script type="text/html" id="fansMessage">
|
||||
<div class='table-title'>
|
||||
<div class='title-pic'>
|
||||
{{# if(d.headimgurl){ }}
|
||||
<img layer-src src={{ns.img(d.headimgurl)}} class="head-portrait">
|
||||
{{# } }}
|
||||
</div>
|
||||
<div class='title-content'>
|
||||
<p class="layui-elip">用户名:{{d.nickname}}</p>
|
||||
{{# if(d.sex == 1){ }}
|
||||
<p class="layui-elip">性别:男</p>
|
||||
{{# }else{ }}
|
||||
<p class="layui-elip">性别:女</p>
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- 用户来源 -->
|
||||
<script type="text/html" id="subscribe_scene">
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_SEARCH'){ }}
|
||||
<p>公众号搜索</p>
|
||||
{{# } }}
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_ACCOUNT_MIGRATION'){ }}
|
||||
<p>公众号迁移</p>
|
||||
{{# } }}
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_PROFILE_CARD'){ }}
|
||||
<p>名片分享</p>
|
||||
{{# } }}
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_QR_CODE'){ }}
|
||||
<p>扫描二维码</p>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_PROFILE_LINK'){ }}
|
||||
<p>图文页内名称点击</p>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_PROFILE_ITEM'){ }}
|
||||
<p>图文页右上角菜单</p>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_PAID'){ }}
|
||||
<p>支付后关注</p>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.subscribe_scene == 'ADD_SCENE_OTHERS '){ }}
|
||||
<p>其他</p>
|
||||
{{# } }}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="progress-layer">
|
||||
<h3>正在同步中,已完成...</h3>
|
||||
<div class="layui-progress layui-progress-big" lay-showPercent="true" lay-filter="progress">
|
||||
<div class="layui-progress-bar layui-bg-blue" lay-percent="0%"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['form', 'element'], function() {
|
||||
var table,
|
||||
form = layui.form;
|
||||
form.render();
|
||||
|
||||
table = new Table({
|
||||
elem: '#Fans_list',
|
||||
url: ns.url("wechat://shop/fans/lists"),
|
||||
page: true,
|
||||
cols: [
|
||||
[{
|
||||
title: '粉丝信息',
|
||||
width: '30%',
|
||||
unresize: 'false',
|
||||
templet: '#fansMessage'
|
||||
}, {
|
||||
field: 'subscribe_time',
|
||||
title: '关注时间',
|
||||
width: '20%',
|
||||
unresize: 'false',
|
||||
templet: function(data) {
|
||||
return ns.time_to_date(data.subscribe_time);
|
||||
}
|
||||
}, {
|
||||
field: 'country',
|
||||
title: '详细地址',
|
||||
width: '30%',
|
||||
unresize: 'false',
|
||||
templet:'#diqu'
|
||||
}, {
|
||||
field: 'subscribe_scene',
|
||||
title: '粉丝来源',
|
||||
width: '20%',
|
||||
unresize: 'false',
|
||||
templet:'#subscribe_scene'
|
||||
}]
|
||||
]
|
||||
});
|
||||
/**
|
||||
* 搜索功能
|
||||
*/
|
||||
form.on('submit(search)', function(data) {
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: data.field
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// 更新粉丝列表
|
||||
var repeat_flag = false;//防重复标识
|
||||
var page_index = 0;
|
||||
var page_count = 0;
|
||||
var progress_element;
|
||||
layui.use('element', function(){
|
||||
progress_element = layui.element;
|
||||
});
|
||||
|
||||
function refresh() {
|
||||
if(repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type : "post",
|
||||
url : "{:addon_url('wechat://shop/fans/syncWechatFans')}",
|
||||
data : {
|
||||
"page" : page_index,
|
||||
},
|
||||
dataType : "JSON",
|
||||
beforeSend : function() {
|
||||
$(".progress-layer").fadeIn();
|
||||
},
|
||||
success : function(data) {
|
||||
repeat_flag = false;
|
||||
if (data.code != 0 && data.message != undefined && data.message != '') {
|
||||
layer.msg(data.message);
|
||||
$(".progress-layer").fadeOut();
|
||||
} else if (data.code == 0) {
|
||||
if (page_index == 0) page_count = data['data']["page_count"];
|
||||
|
||||
page_index += 1;
|
||||
if (data.data == null) {
|
||||
$(".progress-layer").fadeOut();
|
||||
}
|
||||
|
||||
if (page_index <= page_count) {
|
||||
var speed_of_progress = (page_index / page_count * 100).toFixed(2);
|
||||
progress_element.progress('progress', speed_of_progress + '%');
|
||||
}
|
||||
if (page_index <= page_count) {
|
||||
repeat_flag = false;
|
||||
refresh();
|
||||
} else {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
} else {
|
||||
layer.msg('更新失败');
|
||||
$(".progress-layer").fadeOut();
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
layer.msg('更新失败');
|
||||
$(".progress-layer").fadeOut();
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
80
addon/wechat/shop/view/material/add_text.html
Executable file
@@ -0,0 +1,80 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_graphic_message.css">
|
||||
<style type="text/css">
|
||||
.layui-tab-brief{width: 800px;height: 646px}
|
||||
.input-text-hint{float:right}
|
||||
</style>
|
||||
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示<i class="layui-icon layui-colla-icon"></i></h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>由于微信公众平台的接口规范,仅提供向微信认证服务号商家。如你的公众号同时具有微信支付权限,你还可以在正文内添加超级链接。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='graphic_message'>
|
||||
<!-- 添加文本消息 -->
|
||||
<div class="layui-tab layui-tab-brief" id="add_material_text">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">添加文本消息</li>
|
||||
</ul>
|
||||
<div class="layui-form" style="margin-top: 20px;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" placeholder="请输入内容" id="material_text_content" class="layui-textarea" maxlength="300" lay-verify='material_text_content'></textarea>
|
||||
<span class='input-text-hint'>剩余300字</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" lay-submit lay-filter="addText">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="backWechatMaterialList()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use('form', function () {
|
||||
var form = layui.form,repeat_flag = false;
|
||||
|
||||
$('#material_text_content').on('input', function (e) {
|
||||
var num = e.target.value.length;
|
||||
num = 300 - parseInt(num);
|
||||
$('#add_material_text .input-text-hint').html('剩余' + num);
|
||||
});
|
||||
form.verify({
|
||||
'material_text_content': function (value, item) {
|
||||
if (value == '' || value == undefined) {
|
||||
return '文本内容不可为空';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
form.on('submit(addText)', function (data) {
|
||||
var value = JSON.stringify(data.field);
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/addTextMaterial'),
|
||||
data: {type: 5, value},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (res.code == 0) {
|
||||
//_self.material_id = res.data;
|
||||
location.hash = ns.hash('wechat://shop/material/lists');
|
||||
}
|
||||
repeat_flag = false;
|
||||
layer.msg(res.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function backWechatMaterialList() {
|
||||
location.hash = ns.hash("wechat://shop/material/lists");
|
||||
}
|
||||
|
||||
</script>
|
||||
163
addon/wechat/shop/view/material/edit.html
Executable file
@@ -0,0 +1,163 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_graphic_message.css">
|
||||
<style type="text/css">
|
||||
.img-upload{margin-left: 0}
|
||||
.body-content{padding-top: 15px !important;}
|
||||
</style>
|
||||
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示<i class="layui-icon layui-colla-icon"></i></h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>由于微信公众平台的接口规范,仅提供向微信认证服务号商家。如你的公众号同时具有微信支付权限,你还可以在正文内添加超级链接。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='graphic_message'>
|
||||
<div class='graphic-message'>
|
||||
<img src='WECHAT_IMG/mobile_head.png'/>
|
||||
<ul class='graphic-message-list'>
|
||||
<template v-for="(value, index) in article_item_list">
|
||||
<li @click.stop="chooseGraphicMessage(index)" @mouseenter="moveThis(index)" @mouseleave="leaveThis(index)">
|
||||
<content>
|
||||
<template v-if="value.cover.path == ''">
|
||||
<div class='empty-img'></div>
|
||||
<span class='empty-hint'>{{index == 0 ? '封面图片' : '缩略图'}}</span>
|
||||
</template>
|
||||
<img v-else :src="value.cover.path"/>
|
||||
<div class='mask-layer'></div>
|
||||
<h4 class='title'><span>{{value.title == '' ? '标题' : value.title}}</span></h4>
|
||||
</content>
|
||||
<div class='action'>
|
||||
<template v-if="(index == 0 && index == current_msg_index) || (move_index == 0 && index == 0)">
|
||||
<span class='edit' @click.stop="chooseGraphicMessage(index)">编辑</span>
|
||||
</template>
|
||||
<template v-else-if="move_index == index || index == current_msg_index">
|
||||
<span class='edit' @click.stop="chooseGraphicMessage(index)">编辑</span>
|
||||
<span class='delete' @click.stop="deleteGraphicMessage(index)">删除</span>
|
||||
</template>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
<div class='add-graphic-message'>
|
||||
<h4>
|
||||
<a @click="addGraphicMessage()">新增</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div class='bottom-botton'>
|
||||
<template v-if="material_id == 0">
|
||||
<button class='layui-btn' @click="saveGraphicMessage()">保存</button>
|
||||
</template>
|
||||
<button class='layui-btn' v-else @click="editGraphicMessage()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class='editor-box' :style="'margin-top:' + editBoxTopPosition + 'px'">
|
||||
<div class='arrow'></div>
|
||||
<div class='editor-title'>
|
||||
<label>标题<span class='hint'>(必填)</span></label>
|
||||
<input class="layui-input" id="input_title" placeholder="请在这里输入标题" maxlength="64" v-model="inputTitle" max-length="70"/>
|
||||
</div>
|
||||
<div class='editor-author'>
|
||||
<label>作者<span class='hint'>(选填)</span></label>
|
||||
<input class="layui-input" id="input_autor" placeholder="请输入作者" maxlength="16" v-model="inputAutor" max-length="20"/>
|
||||
</div>
|
||||
<div class='editor-cover'>
|
||||
<label>封面<span class='hint'>(图片建议尺寸:900 x 500像素 必填)</span></label>
|
||||
<!--<div class="choose-cover">-->
|
||||
<!--<div class="choose-cover-pic">-->
|
||||
<!--<img :src="coverImg"/>-->
|
||||
<!--</div>-->
|
||||
<!--<template v-if="coverImg == ''">-->
|
||||
<!--<a class="text-color" id="uploadImg" href="javascript:;">上传图片...</a>-->
|
||||
<!--</template>-->
|
||||
<!--<template v-else>-->
|
||||
<!--<a id="uploadImg" style="margin-top: 15px;" href="javascript:;">更换封面图...</a>-->
|
||||
<!--</template>-->
|
||||
<!--</div>-->
|
||||
|
||||
<div class="layui-input-block img-upload">
|
||||
<div class="upload-img-block">
|
||||
<div class="upload-img-box hover" v-if="coverImg">
|
||||
<div class="upload-default" id="uploadImg" >
|
||||
<div id="preview_uploadImg" class="preview_img">
|
||||
<img layer-src :src="coverImg" class="img_prev" :data-img="coverImg"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<div>
|
||||
<i title="图片预览" class="iconfont iconreview js-preview" style="margin-right: 20px;"></i>
|
||||
<i title="删除图片" class="layui-icon layui-icon-delete js-delete"></i>
|
||||
</div>
|
||||
<div class="replace_img js-replace">点击替换</div>
|
||||
</div>
|
||||
<input type="hidden" name="logo" id="logo" :value="coverImg"/>
|
||||
</div>
|
||||
<div class="upload-img-box" v-else>
|
||||
<div class="upload-default" id="uploadImg" >
|
||||
<div class="upload">
|
||||
<i class="iconfont iconshangchuan"></i>
|
||||
<p>点击上传</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="operation">
|
||||
<div>
|
||||
<i title="图片预览" class="iconfont iconreview js-preview" style="margin-right: 20px;"></i>
|
||||
<i title="删除图片" class="layui-icon layui-icon-delete js-delete"></i>
|
||||
</div>
|
||||
<div class="replace_img js-replace">点击替换</div>
|
||||
</div>
|
||||
<input type="hidden" name="logo" id="logo" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label class="editor-msg-label" :class="checkShowCoverPic ? 'selected' : ''" for="check_show_cover_pic">
|
||||
<input type="checkbox" id="check_show_cover_pic" value="1" v-model="checkShowCoverPic"/>
|
||||
封面图片显示在正文中
|
||||
</label>
|
||||
</div>
|
||||
<div class='editor-content'>
|
||||
<label>正文<span class='hint'>(必填)</span></label>
|
||||
<script id="editor" type="text/plain" style="width:380px; height:300px;"></script>
|
||||
</div>
|
||||
<div class='editor-url'>
|
||||
<label>原文链接<span class='hint'>(选填)</span></label>
|
||||
<input class="layui-input" id="original_url" placeholder="例:http://www.example.com" maxlength="100" v-model="inputOriginalUrl"/>
|
||||
</div>
|
||||
</div>
|
||||
<input type='hidden' id='edit_flag' value='{$flag}'/>
|
||||
<input type='hidden' id='material_id' value='{$material_id}'/>
|
||||
<div class="loading" :class="{ show: loading }"><i class=" layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"></i></div>
|
||||
</div>
|
||||
|
||||
<script src="STATIC_JS/vue.js"></script>
|
||||
<script src='WECHAT_JS/wx_graphic_message.js'></script>
|
||||
<script>
|
||||
var material_id = $("#material_id").val();
|
||||
if(material_id != 0){
|
||||
var timer_new = setInterval(function () {
|
||||
if($(".img_prev").attr('data-img') && $("#material_id").val()){
|
||||
loadImgMagnify();
|
||||
var logo_upload = new Upload({
|
||||
elem: '#uploadImg',
|
||||
callback:function (res) {
|
||||
if (res.code >= 0) {
|
||||
//成功之后将图片的路径存放再隐藏域中,便于提交使用
|
||||
// $("input[name='web_qrcode']").val(res.data.pic_path);
|
||||
vue_obj.coverImg = ns.img(res.data.pic_path);
|
||||
vue_obj.article_item_list[vue_obj.current_msg_index].cover.path = ns.img(res.data.pic_path);
|
||||
//将图片展示在页面上
|
||||
// $("#webQrcodeUpload").html("<img src=" + ns.img(res.data.pic_path) + " >");
|
||||
}
|
||||
}
|
||||
});
|
||||
clearInterval(timer_new);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
</script>
|
||||
<!-- 百度编辑器 -->
|
||||
<script type="text/javascript" charset="utf-8" src="STATIC_EXT/ueditor/ueditor.config.js?time=20240614"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="STATIC_EXT/ueditor/ueditor.all.js?time=20240614"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="STATIC_EXT/ueditor/lang/zh-cn/zh-cn.js"></script>
|
||||
82
addon/wechat/shop/view/material/edit_text.html
Executable file
@@ -0,0 +1,82 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_graphic_message.css">
|
||||
<style>
|
||||
.layui-tab-brief{width: 800px;height:646px}
|
||||
.input-text-hint{float:right}
|
||||
</style>
|
||||
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示<i class="layui-icon layui-colla-icon"></i></h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>由于微信公众平台的接口规范,仅提供向微信认证服务号商家。如你的公众号同时具有微信支付权限,你还可以在正文内添加超级链接。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='graphic_message'>
|
||||
<!-- 添加文本消息 -->
|
||||
<div class="layui-tab layui-tab-brief" id="add_material_text">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">添加文本消息</li>
|
||||
</ul>
|
||||
<div class="layui-form" style="margin-top: 20px;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" placeholder="请输入内容" id="material_text_content" class="layui-textarea" maxlength="300" lay-verify='material_text_content'>{$material_data.value.content}</textarea>
|
||||
<span class='input-text-hint'>剩余300字</span>
|
||||
<input type="hidden" name="media_id" id="media_id" value="{$material_data.id}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" lay-submit lay-filter="addText">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="backWechatMaterialList()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use('form', function () {
|
||||
var form = layui.form;
|
||||
|
||||
$('#material_text_content').on('input', function (e) {
|
||||
var num = e.target.value.length;
|
||||
num = 300 - parseInt(num);
|
||||
$('#add_material_text .input-text-hint').html('剩余' + num);
|
||||
});
|
||||
form.verify({
|
||||
'material_text_content': function (value, item) {
|
||||
if (value == '' || value == undefined) {
|
||||
return '文本内容不可为空';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
form.on('submit(addText)', function (data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/editTextMaterial'),
|
||||
data: {type: 5,content: data.field.content,media_id:data.field.media_id},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (res.code == 0) {
|
||||
location.hash = ns.hash('wechat://shop/material/lists');
|
||||
} else {
|
||||
repeat_flag = false;
|
||||
}
|
||||
layer.msg(res.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function backWechatMaterialList() {
|
||||
location.hash = ns.hash("wechat://shop/material/lists");
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
144
addon/wechat/shop/view/material/lists.html
Executable file
@@ -0,0 +1,144 @@
|
||||
<style>
|
||||
.news-material>ul{display: flex;flex-wrap: wrap}
|
||||
.news-material>ul>li{border: 1px solid rgb(233, 233, 233);position: relative;margin:14px 14px 0 0 ;width: calc((100% - 16px*5)/ 5);height: 315px;}
|
||||
.news-material .add-news{text-align: center;display: flex;position: relative;}
|
||||
.news-material .add-news .add-box{margin: auto}
|
||||
.news-material .add-news .iconfont{font-size: 100px; font-weight: 800;color: #606266;}
|
||||
.news-material .add-news:hover .add-li{display: block;}
|
||||
.news-material .add-li{display: none;width: 130px;height: 60px; box-shadow:0px 0px 5px rgb(231, 231, 231) ; background: #fff; position: absolute;left: 50%;top: 85%;transform: translate(-50%,-50%)}
|
||||
.news-material .add-li li{line-height: 30px;}
|
||||
.news-material .add-li li .iconfont{font-size: 16px;}
|
||||
.news-material .add-li li:hover{background: var(--base-color)}
|
||||
.news-material .add-li li:hover span{color: #fff;cursor: pointer;}
|
||||
.news-material .add-li li:hover i{color: #fff;}
|
||||
.material-content{padding: 20px}
|
||||
.news-material .meterail-img{height:200px;text-align: center;line-height: 200px;}
|
||||
.meterail-img img{max-width: 100%; max-height: 100%;}
|
||||
.meterail-title {height: 200px;padding: 20px 40px;box-sizing: border-box;text-align: center;display: flex; overflow: hidden}
|
||||
.meterail-title .title{margin: auto ;}
|
||||
.meterail-title-text{height: 235px !important;}
|
||||
.material-content .meterail-text {overflow: hidden;height: 35px;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2; overflow:hidden; -webkit-box-orient: vertical;}
|
||||
.material-content .meterail-time{margin-top: 20px ;color: #999}
|
||||
.del-edit{position: absolute;right: 10px;top: 10px;display: none;}
|
||||
.del{margin-right: 5px;}
|
||||
.del,.edit{display: inline-block;background: #fff;height: 30px; width: 30px;text-align: center;border-radius: 50%;line-height: 30px;box-shadow:0px 0px 5px rgb(231, 231, 231) ;}
|
||||
.news-material>ul>li:hover .del-edit{display: inline-block}
|
||||
.del:hover,.edit:hover {color: var(--base-color);cursor: pointer;}
|
||||
#MaterailList{display: flex;justify-content: flex-end;margin-right: 14px;}
|
||||
</style>
|
||||
|
||||
<div class="news-material">
|
||||
<ul id="newsMaterialContent"></ul>
|
||||
<div id="MaterailList"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//删除
|
||||
function delMaterial(id){
|
||||
$.ajax({
|
||||
url: ns.url('wechat://shop/material/delete'),
|
||||
data: {
|
||||
id,
|
||||
},
|
||||
dataType: "JSON",
|
||||
success: function(res) {
|
||||
listenerHash(); // 刷新页面
|
||||
}
|
||||
});
|
||||
}
|
||||
function add_tuwen(){
|
||||
window.open(ns.href("wechat://shop/material/add"));
|
||||
}
|
||||
function add_text(){
|
||||
window.open(ns.href("wechat://shop/material/addtextmaterial"));
|
||||
}
|
||||
var data = '';
|
||||
function getMaterailList(page){
|
||||
$.ajax({
|
||||
url: ns.url('wechat://shop/material/lists'),
|
||||
data: {
|
||||
page,
|
||||
},
|
||||
dataType: "JSON",
|
||||
success: function(res) {
|
||||
this.data = res.data.list;
|
||||
//列表渲染
|
||||
var str = ``;
|
||||
if(page == undefined || page == 1 || !page){
|
||||
str += `
|
||||
<li class="add-news">
|
||||
<div class="add-box">
|
||||
<i class="iconfont iconadd_light icon-hover"></i><br>
|
||||
<span>添加素材</span>
|
||||
<div class="add-li">
|
||||
<ul>
|
||||
<li onclick="add_tuwen()">
|
||||
<i class="iconfont icondoc_plaintext"></i> <span>添加图文</span>
|
||||
</li>
|
||||
<li onclick="add_text()">
|
||||
<i class="iconfont icontext"></i> <span>添加文字</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
`;
|
||||
|
||||
}
|
||||
$.each(this.data, function(index, item) {
|
||||
if(item.type == 1){
|
||||
str += `
|
||||
<li>
|
||||
<div class="del-edit">
|
||||
<a class="del" onclick="delMaterial(`+ item.id +`)" ><i class="iconfont iconshanchu"></i></a>
|
||||
<a href="`+ ns.href('wechat://shop/material/edit',{"id": item.id,'media_id':item.media_id,'type':item.type}) +`" target='_blank' class="edit"><i class="iconfont iconbianji-copy"></i></a>
|
||||
</div>
|
||||
<div class="meterail-img">
|
||||
<img src=" `+ item.value[0].cover.path +` " alt="">
|
||||
</div>
|
||||
<div class="material-content">
|
||||
<p class="meterail-text">`+ item.value[0].title +`</p>
|
||||
<p class="meterail-time">更新于<span>`+ ns.time_to_date(item.update_time) +`</span></p>
|
||||
</div>
|
||||
</li>
|
||||
`
|
||||
}else{
|
||||
str += `
|
||||
<li>
|
||||
<div class="del-edit">
|
||||
<a class="del" onclick="delMaterial(`+ item.id +`)"><i class="iconfont iconshanchu"></i></a>
|
||||
<a href="`+ ns.href('wechat://shop/material/edittextmaterial',{"id": item.id,'media_id':item.media_id,'type':item.type}) +`" target='_blank' class="edit"><i class="iconfont iconbianji-copy"></i></a>
|
||||
</div>
|
||||
<div class="meterail-title meterail-title-text">
|
||||
<p class="title">`+ item.value.content +`</p>
|
||||
</div>
|
||||
<div class="material-content">
|
||||
<p class="meterail-time">更新于<span>`+ ns.time_to_date(item.update_time) +`</span></p>
|
||||
</div>
|
||||
</li>
|
||||
`
|
||||
}
|
||||
|
||||
});
|
||||
$("#newsMaterialContent").html(str);
|
||||
//分页
|
||||
layui.use('laypage', function(){
|
||||
var laypage = layui.laypage;
|
||||
laypage.render({
|
||||
elem: 'MaterailList' ,
|
||||
curr: page, //当前页
|
||||
count: res.data.count,
|
||||
layout: ['count', 'prev', 'page', 'next'],
|
||||
jump: function(obj, first){
|
||||
//首次不执行
|
||||
if(!first){
|
||||
getMaterailList(obj.curr);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
getMaterailList();
|
||||
</script>
|
||||
93
addon/wechat/shop/view/material/material.html
Executable file
@@ -0,0 +1,93 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_menu.css">
|
||||
<script src="WECHAT_JS/common.js"></script>
|
||||
|
||||
<!-- 内容 -->
|
||||
{if $type == 1}
|
||||
<div class="layui-tab layui-tab-brief" id="marterial_graphic_message">
|
||||
<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 id="marterial_graphic_message_list" lay-filter="marterial_graphic_message"></table>
|
||||
<!-- 标题 -->
|
||||
<script type="text/html" id="graphic_message_title">
|
||||
<div class="layui-row grid-demo">
|
||||
{{# for (var index in d.value) { }}
|
||||
<div class="layui-col-md12 layui-clear">
|
||||
<div class="layui-col-md3 article-img" style="float:left;">
|
||||
<span style="color: #fff;padding: 2px 4px;background: #1aad19;">图文</span>
|
||||
</div>
|
||||
<div class="layui-col-md3 title" style="float:left;">
|
||||
<a href="javascript:void(0);" onclick="preview({{d.id}}, {{index}})">{{d.value[index].title}}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
{{# if (d.value.length == 1) { }}
|
||||
<div class='layui-col-md12 read-all layui-clear' onclick="preview({{d.id}})">
|
||||
<div class='layui-col-md4' style="float:left;">阅读全文</div>
|
||||
<div class='layui-col-md4 layui-col-md-offset4'> </div>
|
||||
</div>
|
||||
{{# } }}
|
||||
</div>
|
||||
</script>
|
||||
<!-- 创建时间 -->
|
||||
<script type="text/html" id="create_time">
|
||||
<div>{{ ns.time_to_date(d.create_time) }}</div>
|
||||
</script>
|
||||
<!-- 修改时间 -->
|
||||
<script type="text/html" id="update_time">
|
||||
<div>{{ ns.time_to_date(d.update_time) }}</div>
|
||||
</script>
|
||||
<!-- 列表操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<a class="default layui-btn-sm hover_cursor text-color" style="cursor:pointer;" lay-event="choose">选取</a>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{else/}
|
||||
|
||||
<!-- 文本消息 -->
|
||||
<div class="layui-tab layui-tab-brief" id="material_text">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">文本消息</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<table id="material_text_list" lay-filter="material_text"></table>
|
||||
<!-- 内容 -->
|
||||
<script type="text/html" id="text_content">
|
||||
<div class="layui-row grid-demo">
|
||||
<div class="layui-col-md12 layui-clear">
|
||||
<div class="layui-col-md12 article-img" style="text-align: left;">
|
||||
<span style="color: #fff;padding: 2px 4px;">文本</span>
|
||||
</div>
|
||||
<div class="layui-col-md12 title line-hiding" style="float:left;">
|
||||
<a href="javascript:void(0);" onclick="previewText('{{d.value.content}}')" title="{{d.value.content}}">{{d.value.content}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<!-- 创建时间 -->
|
||||
<script type="text/html" id="create_time">
|
||||
<div>{{ ns.time_to_date(d.create_time) }}</div>
|
||||
</script>
|
||||
<!-- 修改时间 -->
|
||||
<script type="text/html" id="update_time">
|
||||
<div>{{ ns.time_to_date(d.update_time) }}</div>
|
||||
</script>
|
||||
<!-- 列表操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<a class="default layui-btn-sm hover_cursor text-color" style="cursor:pointer;" lay-event="choose">选取</a>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<script type="text/javascript" src="WECHAT_JS/wx_material_mannager.js"></script>
|
||||
<script type="text/javascript">
|
||||
loadMaterialList({$type});
|
||||
</script>
|
||||
91
addon/wechat/shop/view/material/material_list.html
Executable file
@@ -0,0 +1,91 @@
|
||||
<link rel="stylesheet" href="ADDON_WECHAT_CSS/wx_material.css">
|
||||
|
||||
<div class="layui-tab-item layui-show">
|
||||
<div class='mg'>
|
||||
<button class="layui-btn" onclick="window.open(ns.href('wechat://shop/material/addgraphicmessage'))">新建图文</button>
|
||||
</div>
|
||||
<div>
|
||||
<table id="graphic_message_list" lay-filter="graphic_message"></table>
|
||||
</div>
|
||||
<!-- 标题 -->
|
||||
<script type="text/html" id="title">
|
||||
<div class="layui-row grid-demo">
|
||||
{{# for (var index in d.value) { }}
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-col-md3 article-img">
|
||||
<span class="bg-color">图文</span>
|
||||
</div>
|
||||
<div class="layui-col-md8 title">
|
||||
<a class="graphic-message-title" href="javascript:void(0);" onclick="preview({{d.id}}, {{index}})">{{d.value[index].title}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{# } }}
|
||||
{{# if (d.value.length == 1) { }}
|
||||
<div class='layui-col-md12 read-all' onclick="preview({{d.id}})">
|
||||
<div class='layui-col-md4'>阅读全文</div>
|
||||
<div class='layui-col-md4 layui-col-md-offset4'> > </div>
|
||||
</div>
|
||||
{{# } }}
|
||||
</div>
|
||||
</script>
|
||||
<!-- 创建时间 -->
|
||||
<script type="text/html" id="create_time">
|
||||
<div>{{ ns.time_to_date(d.create_time) }}</div>
|
||||
</script>
|
||||
<!-- 修改时间 -->
|
||||
<script type="text/html" id="update_time">
|
||||
<div>{{ ns.time_to_date(d.update_time) }}</div>
|
||||
</script>
|
||||
<!-- 列表操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<a class="default" lay-event="edit">编辑</a>
|
||||
<a class="default" lay-event="delete">删除</a>
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<script src="ADDON_WECHAT_JS/wx_material.js"></script>
|
||||
<script>
|
||||
loadMaterialList(1);
|
||||
layui.use(['table','form'], function() {
|
||||
var table,
|
||||
form = layui.form;
|
||||
|
||||
table = new Table({
|
||||
elem: '#Fans_list',
|
||||
url: ns.url("wechat://shop/material/lists"),
|
||||
page: false,
|
||||
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
field: 'title',
|
||||
title: '标题',
|
||||
unresize: 'false'
|
||||
}, {
|
||||
field: 'create_time',
|
||||
title: '创建时间',
|
||||
unresize: 'false',
|
||||
templet: function(data) {
|
||||
return ns.time_to_date(data.create_time);
|
||||
}
|
||||
}, {
|
||||
field: 'update_time',
|
||||
title: '更新时间',
|
||||
unresize: 'false',
|
||||
templet: function(data) {
|
||||
return ns.time_to_date(data.update_time);
|
||||
}
|
||||
}, {
|
||||
title: '操作',
|
||||
toolbar: '#operation',
|
||||
align: 'right',
|
||||
unresize: 'false'
|
||||
}
|
||||
]
|
||||
],
|
||||
bottomToolbar: "#batchOperation"
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
48
addon/wechat/shop/view/material/preview_material.html
Executable file
@@ -0,0 +1,48 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="referrer" content="never">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover"/>
|
||||
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1">
|
||||
<title>{$info.value[$index]['title']}</title>
|
||||
<meta name="keywords" content="">
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/ext/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="SITEHOME_CSS/home.css">
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_preview_graphic_message.css">
|
||||
<script src="__STATIC__/js/jquery-2.2.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class='preview-box'>
|
||||
<img class='head' src='WECHAT_IMG/mobile_head.png'/>
|
||||
<div class='graphic-message'>
|
||||
<h1 class='title'>{$info.value[$index]['title']}</h1>
|
||||
{if condition="$info.update_time eq 0"}
|
||||
<span class='time'>{$info['create_time']|time_to_date='Y-m-d'}</span>
|
||||
{else/}
|
||||
<span class='time'>{$info['update_time']|time_to_date='Y-m-d'}</span>
|
||||
{/if}
|
||||
<span class='author'>{$info.value[$index]['autor']}</span>
|
||||
<content>
|
||||
{if condition="$info.value[$index]['show_cover_pic'] == 1"}
|
||||
<div class="rich-media-thumb" id="media">
|
||||
<img onerror="this.parentNode.removeChild(this)" src="{$info.value[$index]['cover']['path']}">
|
||||
</div>
|
||||
{/if}
|
||||
{:html_entity_decode($info.value[$index]['content'])}
|
||||
</content>
|
||||
{if condition="!empty($info.value[$index]['url'])"}
|
||||
<a class='original-text' href="{$info.value[$index]['url']}">阅读原文</a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
$(function () {
|
||||
$("img").each(function () {
|
||||
$(this).replaceWith(this);
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
32
addon/wechat/shop/view/material/preview_text.html
Executable file
@@ -0,0 +1,32 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="referrer" content="never">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover"/>
|
||||
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1">
|
||||
<meta name="keywords" content="">
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/ext/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="SITEHOME_CSS/home.css">
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_preview_graphic_message.css">
|
||||
<script src="__STATIC__/js/jquery-2.2.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class='preview-box'>
|
||||
<img class='head' src='WECHAT_IMG/mobile_head.png'/>
|
||||
<div class='graphic-message'>
|
||||
<content>
|
||||
{:html_entity_decode($info.value['content'])}
|
||||
</content>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
$(function () {
|
||||
$("img").each(function () {
|
||||
$(this).replaceWith(this);
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
266
addon/wechat/shop/view/menu/menu.html
Executable file
@@ -0,0 +1,266 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_menu.css">
|
||||
<script src="WECHAT_JS/common.js"></script>
|
||||
|
||||
<div class='wx-menu' id='menu'>
|
||||
<div class='wx-menu-preview'>
|
||||
<div class='mobile-preview'>
|
||||
<div class='mobile-hd'>
|
||||
<span></span>
|
||||
</div>
|
||||
<div class='mobile-bd'>
|
||||
<div class='wx-menu-list'>
|
||||
<template v-for="(item, index) in button">
|
||||
<div class="wx-menu-item-box" :class="['wx-menu-item-box-' + index]">
|
||||
<div class='wx-menu-item' :class="[index==menuIndex[0]&&-1==menuIndex[1] ? 'active' : '']" @click.stop='chooseMenu(index, -1)'>
|
||||
<template v-if="item.name == ''">
|
||||
<span>菜单名称</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>{{item.name}}</span>
|
||||
</template>
|
||||
</div>
|
||||
<template v-if="index==menuIndex[0]">
|
||||
<div class='wx-sub-menu-list' v-if="item" :class="[button.length != undefined && button.length == 2 ? 'two' : '', button.length != undefined && button.length == 3 ? 'three' : '']">
|
||||
<div class='wx-sub-menu-item' :data="[second_index]" :class="[second_index==menuIndex[1] ? 'active' : '', 'wx-sub-menu-item-' + second_index]" v-for="(item2, second_index) in item.sub_button" @click.stop='chooseMenu(index, second_index)'>
|
||||
<template v-if="item2.name == ''">
|
||||
<span>子菜单名称</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>{{item2.name}}</span>
|
||||
</template>
|
||||
</div>
|
||||
<template v-if="subMenuPlusShow">
|
||||
<div class='wx-sub-menu-item' @click.stop="addSubMenu(index)">+</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="button.length < 3">
|
||||
<div class='wx-menu-item-box add-menu' @click="addMenu()">+</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='wx-menu-form'>
|
||||
<div class='button-list-null' v-if='menuIndex[0] == -1'>点击左侧按钮 + 添加菜单</div>
|
||||
<template v-if="menuIndex[0] != -1">
|
||||
<div class='form-editor'>
|
||||
<div class='form-hd'>
|
||||
<div class='form-hd-name'>{{name}}</div>
|
||||
<div class='form-hd-del'><a href="javascript:void(0);" class='layui-btn layui-btn-primary layui-btn-xs' @click='deleteMenu()'>删除菜单</a></div>
|
||||
</div>
|
||||
<div class='form-bd'>
|
||||
<div class='form-bd-list'>
|
||||
<div class='form-bd-item'>
|
||||
<label class='layui-form-label sm'>菜单名称</label>
|
||||
<div class='item-group'>
|
||||
<template v-if="menuIndex[1] == -1">
|
||||
<input type='text' class='input layui-input' :class="error_hint == 'name' ? 'error' : ''" value='' @keyup="checkName($event)" v-model='name' placeholder="请输入菜单名称">
|
||||
<p class="tip" :class="error_hint == 'name' ? 'error' : ''">字数不超过4个汉字或8个字母</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
<input type='text' class='input layui-input' :class="error_hint == 'name' ? 'error' : ''" value='' @keyup="checkName($event, 'sub_button')" v-model='name' placeholder="请输入子菜单名称">
|
||||
<p class='tip' :class="error_hint == 'name' ? 'error' : ''">字数不超过8个汉字或16个字母</p>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-bd-item' v-if="(menuIndex[0] > -1 && (button[menuIndex[0]] == undefined || button[menuIndex[0]].sub_button == undefined || button[menuIndex[0]].sub_button[0] == undefined)) || (menuIndex[1] > -1)">
|
||||
<label class='layui-form-label sm'>菜单内容</label>
|
||||
<div class='item-group menu-type'>
|
||||
<label class='radio-label'>
|
||||
<i class='layui-icon' :class="type == 'media' ? 'layui-icon-radio' : 'layui-icon-circle'"></i>
|
||||
<input type='radio' name='type' id='type1' value='media' v-model='type'>
|
||||
<span>发送素材内容</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<i class='layui-icon' :class="type == 'view' ? 'layui-icon-radio' : 'layui-icon-circle'"></i>
|
||||
<input type='radio' name='type' id='type2' value='view' v-model='type'>
|
||||
<span>跳转到网页</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<i class='layui-icon' :class="type == 'miniprogram' ? 'layui-icon-radio' : 'layui-icon-circle'"></i>
|
||||
<input type='radio' name='type' id='type3' value='miniprogram' v-model='type'>
|
||||
<span>跳转小程序</span>
|
||||
</label>
|
||||
<label class='radio-label hide'>
|
||||
<i class='layui-icon' :class="type == 'custom_event' ? 'layui-icon-radio' : 'layui-icon-circle'"></i>
|
||||
<input type='radio' name='type' id='type4' value='custom_event' v-model='type'>
|
||||
<span>自定义事件</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-bd-content'>
|
||||
<div class='menu-content' v-if='type == "media"'>
|
||||
<div class="layui-tab layui-tab-brief">
|
||||
<ul class="layui-tab-title wechat-media">
|
||||
<li :class="media_type == 'text' ? 'layui-this' : ''" @click="chooseMediaType(5)"><i class='layui-icon layui-icon-form'></i>文本消息</li>
|
||||
<li :class="media_type == 'graphic_message' ? 'layui-this' : ''" @click="chooseMediaType(1)"><i class='layui-icon layui-icon-tabs'></i>图文消息</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item" :class="media_type == 'text' ? 'layui-show' : ''">
|
||||
<template v-if="text == '' || text == undefined">
|
||||
<div class='material-library' @click="material(5)">
|
||||
<i></i>
|
||||
<span>从素材库选择</span>
|
||||
</div>
|
||||
<div class='add-material' @click="addMaterial(5)">
|
||||
<i></i>
|
||||
<span>添加文本素材</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class='text-message'>
|
||||
<div class='text-message-content'>
|
||||
<div class="material-type">
|
||||
<span>文本</span>
|
||||
</div>
|
||||
<div class="title">
|
||||
<a href="javascript:void(0);" @click="previewTexts(text)">{{text}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class='del' @click="deleteMaterial(5)">删除</span>
|
||||
</template>
|
||||
</div>
|
||||
<div class="layui-tab-item" :class="media_type == 'graphic_message' ? 'layui-show' : ''">
|
||||
<template v-if="graphic_message[0] == undefined">
|
||||
<div class='material-library' @click="material(1)">
|
||||
<i></i>
|
||||
<span>从素材库选择</span>
|
||||
</div>
|
||||
<div class='add-material' @click="addMaterial(1)">
|
||||
<i></i>
|
||||
<span>新建图文素材</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class='graphic-message-list'>
|
||||
<template v-for="(value, index) in graphic_message">
|
||||
<div class='graphic-message-content'>
|
||||
<div class="material-type">
|
||||
<span>图文</span>
|
||||
</div>
|
||||
<div class="title">
|
||||
<a href="javascript:void(0);" @click="preview(value.id, index)">{{value.title}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="graphic_message.length == 1">
|
||||
<div class='read-all' @click="preview(value.id)">
|
||||
<div>阅读全文</div>
|
||||
<i> > </i>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
<span class='del' @click="deleteMaterial(1)">删除</span>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='menu-content view' v-if='type == "view"'>
|
||||
<p class='tip' style="margin: 10px 0 20px 0;padding-left: 5px;">订阅者点击该子菜单会跳转到一下链接</p>
|
||||
<div class='form-bd-item'>
|
||||
<label class='layui-form-label sm'>页面地址</label>
|
||||
<div class='layui-input-inline'>
|
||||
<input type='text' class="input layui-input" value='' v-model='url' placeholder='例:http://example.com'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='menu-content menu' v-if='type == "miniprogram"'>
|
||||
<p class='tip' style="margin: 10px 0 20px 0;padding-left: 5px;">订阅者点击该子菜单会跳到以下小程序</p>
|
||||
<div class='layui-form-item'>
|
||||
<label class='layui-form-label'>备用网页</label>
|
||||
<div class='layui-input-block'>
|
||||
<input type='text' id='miniprogram_url' class="layui-input" value='' v-model='url' placeholder='例:http://example.com'>
|
||||
<p class='layui-form-mid layui-word-aux'>旧版微信客户端无法支持小程序,用户点击菜单时将会打开备用网页。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class='layui-form-item'>
|
||||
<label class='layui-form-label'>小程序APPID</label>
|
||||
<div class='layui-input-block'>
|
||||
<input type='text' class="layui-input" value='' v-model='appid'>
|
||||
<p class='layui-form-mid layui-word-aux'>小程序需要绑定当前公众号。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class='layui-form-item'>
|
||||
<label class='layui-form-label'>小程序页面路径</label>
|
||||
<div class='layui-input-inline'>
|
||||
<input type='text' class="layui-input" value='' v-model='pagepath'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='menu-content' v-if='type == "event"'>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='click' v-model='eventType'>
|
||||
<span>点击事件</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='scancode_push' v-model='eventType'>
|
||||
<span>扫码推事件</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='scancode_waitmsg' v-model='eventType'>
|
||||
<span>扫码推事件带提示</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='pic_sysphoto' v-model='eventType'>
|
||||
<span>弹出系统拍照发图</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='pic_photo_or_album' v-model='eventType'>
|
||||
<span>弹出拍照或者相册发图</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='pic_wechat' v-model='eventType'>
|
||||
<span>弹出微信相册发图器</span>
|
||||
</label>
|
||||
<label class='radio-label'>
|
||||
<input type='radio' name='eventType' value='location_select' v-model='eventType'>
|
||||
<span>弹出地理位置选择器</span>
|
||||
</label>
|
||||
<div class='form-bd-item'>
|
||||
<label class='item-label'>菜单KEY值</label>
|
||||
<div class='item-group'>
|
||||
<input type='text' class='input' value='' v-model='key'>
|
||||
<p class='tip'>旧版微信客户端无法支持小程序,用户点击菜单时将会打开备用网页。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class='form-ft'>
|
||||
<button class='layui-btn' @click="saveMenu()">保存并发布</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 添加文本消息 -->
|
||||
<div class="layui-tab layui-tab-brief" id="add_material_text" style="display:none;">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">添加文本消息</li>
|
||||
</ul>
|
||||
<div class="layui-form" style="margin-top: 20px;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" placeholder="请输入内容" id="material_text_content" class="layui-textarea" maxlength="300" lay-verify='material_text_content'></textarea>
|
||||
<span class='input-text-hint'>剩余300字</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" lay-submit lay-filter="addText">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="back()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="STATIC_JS/vue.js"></script>
|
||||
<script type="text/javascript" src="WECHAT_JS/wx_menu.js?v=1"></script>
|
||||
<script type="text/javascript" src="WECHAT_JS/wx_material_mannager.js"></script>
|
||||
211
addon/wechat/shop/view/message/config.html
Executable file
@@ -0,0 +1,211 @@
|
||||
<style>
|
||||
.card-common .layui-card-header{ padding-bottom: 10px; }
|
||||
</style>
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示</h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>注意:请将微信公众号服务类目选择为:商业服务——>软件/建站/技术开发,生活服务——>百货/超市/便利店,工具—>信息查询,所选行业不一致将会导致模板消息不可用。</li>
|
||||
<li>公众号可设置20个服务类目,每月只能修改5次,请谨慎选择。</li>
|
||||
<li>公众号最多支持25个模板消息,获取时请注意公众号剩余模板数量是否充足</li>
|
||||
<li>所需跳转到的小程序必须与发模板消息的公众号是绑定关联关系,暂不支持小游戏</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form">
|
||||
<div class="layui-card card-common card-brief top">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">是否需跳转到小程序</span>
|
||||
<input type="checkbox" name="" value="1" lay-skin="switch" lay-filter="is_jump_weapp" {if $config.is_jump_weapp == 1} checked {/if} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="template_list" lay-filter="template_list"></table>
|
||||
|
||||
<script type="text/html" id="batchOperation">
|
||||
<button class="layui-btn layui-btn-primary" lay-event="open">批量开启</button>
|
||||
<button class="layui-btn layui-btn-primary" lay-event="close">批量关闭</button>
|
||||
<button class="layui-btn layui-btn-primary" lay-event="getAll">批量获取</button>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="operation">
|
||||
<div class="table-btn">
|
||||
{{# if(d.wechat_is_open == 0){ }}
|
||||
<a class="layui-btn" lay-event="open">开启</a>
|
||||
{{# }else{ }}
|
||||
<a class="layui-btn" lay-event="close">关闭</a>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.wechat_template_id != undefined && d.wechat_template_id != ''){ }}
|
||||
<a class="layui-btn" lay-event="getTemplateNo">重新获取</a>
|
||||
{{# } }}
|
||||
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="message_type">
|
||||
{{ d.message_type == 1 ? '买家消息' : '卖家消息' }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="template_no">
|
||||
{{ d.wechat_template_id ? d.wechat_template_id : '' }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="wechat_is_open">
|
||||
{{ d.wechat_is_open == 1 ? '已启动' : '已关闭' }}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var form,table;
|
||||
layui.use(['form'], function() {
|
||||
form = layui.form;
|
||||
form.render();
|
||||
var repeat_flag = false;//防重复标识
|
||||
|
||||
form.on('switch(is_jump_weapp)', function (data) {
|
||||
data.value = data.elem.checked ? data.value : 0;
|
||||
|
||||
$.ajax({
|
||||
dataType: "JSON",
|
||||
type: "POST",
|
||||
data: {"is_jump_weapp": data.value},
|
||||
url: ns.url("wechat://shop/message/messageConfig"),
|
||||
success: function (res) {
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
table = new Table({
|
||||
elem: '#template_list',
|
||||
url: ns.url("wechat://shop/message/config"),
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
width: "3%",
|
||||
type: 'checkbox',
|
||||
unresize: 'false'
|
||||
},
|
||||
{
|
||||
field: 'title',
|
||||
title: '类型',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'message_type',
|
||||
title: '消息类型',
|
||||
templet: '#message_type',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
field: 'wechat_is_open',
|
||||
title: '是否启用',
|
||||
templet: '#wechat_is_open',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
field: 'wechat_template_id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
templet: '#template_no'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
toolbar: '#operation',
|
||||
align: 'right'
|
||||
}
|
||||
]
|
||||
],
|
||||
bottomToolbar: "#batchOperation"
|
||||
});
|
||||
|
||||
// 批量操作
|
||||
table.bottomToolbar(function (obj) {
|
||||
|
||||
if (obj.data.length < 1) {
|
||||
layer.msg('请选择要操作的数据');
|
||||
return;
|
||||
}
|
||||
|
||||
var keywords_array = new Array();
|
||||
for (i in obj.data) keywords_array.push(obj.data[i].keywords);
|
||||
switch (obj.event) {
|
||||
case 'open':
|
||||
// 开启
|
||||
setStatus(keywords_array.toString(), 1);
|
||||
break;
|
||||
case 'close':
|
||||
// 关闭
|
||||
setStatus(keywords_array.toString(), 0);
|
||||
break;
|
||||
case 'getAll':
|
||||
// 批量获取
|
||||
getTemplate(keywords_array.toString());
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 监听工具栏操作
|
||||
*/
|
||||
table.tool(function (obj) {
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case 'getTemplateNo': //获取模板id
|
||||
getTemplate(data.keywords);
|
||||
break;
|
||||
case 'open': //开启
|
||||
setStatus(data.keywords, 1);
|
||||
break;
|
||||
case 'close': //关闭
|
||||
setStatus(data.keywords, 0);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
function setStatus(keywords, status) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '{:addon_url("wechat://shop/message/setWechatStatus")}',
|
||||
data: {
|
||||
"wechat_is_open": status,
|
||||
'keywords': keywords
|
||||
},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
repeat_flag = false;
|
||||
layer.msg(res.message);
|
||||
table.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getTemplate(keywords) {
|
||||
var loadLayer;
|
||||
layer.confirm('已存在的模板再次获取会导致模板重复存在,是否继续?', function (index) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '{:addon_url("wechat://shop/message/getWechatTemplateNo")}',
|
||||
data: {
|
||||
'keywords': keywords
|
||||
},
|
||||
dataType: "JSON",
|
||||
beforeSend: function () {
|
||||
loadLayer = layer.msg("模板获取中,请耐心等待,请勿进行其他操作!", {time: 1000 * 10000});
|
||||
},
|
||||
complete: function () {
|
||||
layer.close(loadLayer);
|
||||
},
|
||||
success: function (res) {
|
||||
repeat_flag = false;
|
||||
layer.msg(res.message);
|
||||
layer.close(index);
|
||||
table.reload();
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
84
addon/wechat/shop/view/message/edit.html
Executable file
@@ -0,0 +1,84 @@
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否开启:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="wechat_is_open" value="1" {if $wechat_is_open == 1}checked{/if} lay-skin="switch">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">模板名称:</label>
|
||||
<div class="layui-input-block">
|
||||
{$message_title}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">模板消息ID:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="template_id" value="{if $info}{$info.template_id_short}{/if}" placeholder="模板消息ID" autocomplete="off" class="layui-input len-long" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">类目模板:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="keyword_name_list" value="{if $info && isset($info.keyword_name_list)}{$info.keyword_name_list}{/if}" placeholder="类目模板,多个逗号隔开" autocomplete="off" class="layui-input len-long" readonly>
|
||||
</div>
|
||||
<div class="word-aux">类目模板的关键词,多个逗号隔开</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label"><span class="required"></span>模板内容:</label>
|
||||
<div class="layui-input-inline">
|
||||
<textarea placeholder="" class="layui-textarea len-long" readonly>{if $info}{$info.content}{/if}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="keywords" value="{$keywords}" />
|
||||
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="backMessageList()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['form', 'colorpicker'], function() {
|
||||
var form = layui.form,
|
||||
repeat_flag = false; //防重复标识
|
||||
form.render();
|
||||
|
||||
form.on('submit(save)', function(data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
|
||||
$.ajax({
|
||||
url: ns.url("wechat://shop/Message/edit"),
|
||||
data: data.field,
|
||||
dataType: 'JSON',
|
||||
type: 'POST',
|
||||
success: function(res) {
|
||||
repeat_flag = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
layer.confirm('编辑成功', {
|
||||
title:'操作提示',
|
||||
btn: ['返回列表', '继续操作'],
|
||||
yes: function(index, layero){
|
||||
location.hash = ns.hash("shop/message/lists")
|
||||
layer.close(index);
|
||||
},
|
||||
btn2: function(index, layero) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function backMessageList() {
|
||||
location.hash = ns.hash("shop/message/lists");
|
||||
}
|
||||
</script>
|
||||
9
addon/wechat/shop/view/public/css/wx_access_statistics.css
Executable file
@@ -0,0 +1,9 @@
|
||||
.access-statistics .access-api-list{display: flex;justify-content: space-between;padding: 0 15px;}
|
||||
.access-statistics .access-api-item{flex-grow: 1;text-align: center;margin-right: 10px;border: 1px solid #e5e5e5;padding-top: 25px;}
|
||||
.access-statistics .access-api-item:last-of-type{margin-right:0;}
|
||||
.access-statistics .access-api-itme-content{height: 80px; line-height: 80px; font-size: 30px;}
|
||||
.access-statistics .access-api-item-title{position: relative;}
|
||||
.access-statistics .access-api-item-title h3{display: inline-block;}
|
||||
.access-statistics .access-api-vice-content{font-size: 25px;}
|
||||
.layui-fluid .layui-tab-title{margin-top: 0;}
|
||||
.layui-tab-content-time{display: inline-block; height: 40px; margin-left: 15px; line-height: 40px;}
|
||||
101
addon/wechat/shop/view/public/css/wx_fans.css
Executable file
@@ -0,0 +1,101 @@
|
||||
.date-picker-btn.selected {
|
||||
background-color: var(--base-color);
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.search_form {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.search_form .reset {
|
||||
background: transparent;
|
||||
border: none;
|
||||
margin-left: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.search_form .layui-form-mid {
|
||||
display: inline-block;
|
||||
float: unset;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.search_form .layui-btn+.layui-btn {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.layui-table {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.layui-layer-content {
|
||||
padding: 15px;
|
||||
height: auto!important;
|
||||
}
|
||||
|
||||
.align-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.headimg-box {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
display: inline-block;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.headimg-box img{
|
||||
max-width: 50px;
|
||||
max-height: 50px;
|
||||
margin: auto;
|
||||
}
|
||||
.layui-table-cell{
|
||||
text-overflow: ellipsis;
|
||||
overflow: initial !important;
|
||||
white-space: initial;
|
||||
}
|
||||
.tag-list{
|
||||
display: inline-block;
|
||||
line-height: 40px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.tag-list span{
|
||||
margin: 2px;
|
||||
padding: 2px 5px;
|
||||
border-radius: 2px;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.progress-layer {
|
||||
width: 400px;
|
||||
background: #fff;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
box-shadow: 1px 1px 50px rgba(0,0,0,.3);
|
||||
padding: 20px 20px;
|
||||
z-index: 100;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.progress-layer h3{
|
||||
line-height: 1;
|
||||
margin-bottom: 15px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.progress-layer .layui-progress-big, .progress-layer .layui-progress-big .layui-progress-bar{
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.progress-layer .layui-progress-text{
|
||||
line-height: 14px;
|
||||
}
|
||||
742
addon/wechat/shop/view/public/css/wx_follow.css
Executable file
@@ -0,0 +1,742 @@
|
||||
.layui-layout-admin .layui-body .body-content{
|
||||
background: #f8f8f8;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.fourstage-nav .layui-tab-title {
|
||||
background: #fff;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.fourstage-nav .layui-tab-title li {
|
||||
line-height: 48px;
|
||||
margin: 0 15px;
|
||||
}
|
||||
|
||||
button, input, select, textarea {
|
||||
font-family: inherit;
|
||||
font-size: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
input:-moz-placeholder, textarea:-moz-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
input::-moz-placeholder, textarea::-moz-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
a:-webkit-any-link {
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.reply-opts a:-webkit-any-link{
|
||||
color: var(--base-color);
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.reply-opts .delet-color:-webkit-any-link {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
button {
|
||||
display: inline-block;
|
||||
padding: 0 22px;
|
||||
min-width: 54px;
|
||||
line-height: 2.42857143;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border-radius: 3px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.layui-body {
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.page-title h2 {
|
||||
font-size: 26px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.type-menu {
|
||||
text-align: left;
|
||||
height: 50px;
|
||||
line-height: 40px;
|
||||
border-bottom: 1px solid #E0E1E2;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.type-menu li {
|
||||
float: left;
|
||||
margin-right: 24px;
|
||||
line-height: 40px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.replay-info {
|
||||
padding: 15px 0 0;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.weixin-normal {
|
||||
position: relative;
|
||||
margin-top: 15px
|
||||
}
|
||||
|
||||
.replay-info .info {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.replay-info h3 {
|
||||
display: inline-block;
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.replay-info h3:last-child {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.replay-button {
|
||||
float: right;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.replay-button>div {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.replay-button:after {
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.replay-button>label {
|
||||
background-color: #1AAD19;
|
||||
border-color: #1AAD19;
|
||||
color: #FFFFFF;
|
||||
display: inline-block;
|
||||
min-width: 54px;
|
||||
line-height: 2.42857143;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border-radius: 3px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.replay-button .layui-layer-page {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.replay-button .layui-form>.layui-btn {
|
||||
display: block;
|
||||
margin: auto;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.replay-button label>input {
|
||||
position: absolute;
|
||||
left: -9999em;
|
||||
}
|
||||
|
||||
.replay-button .search {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-right: .5em;
|
||||
width: 243px;
|
||||
}
|
||||
|
||||
.replay-button .down {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.replay-button .down button {
|
||||
padding: 14px 12px 10px 12px;
|
||||
min-width: unset;
|
||||
}
|
||||
|
||||
.down .show-menu li a {
|
||||
color: #00A717;
|
||||
}
|
||||
|
||||
.down .show-menu li a {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.rule-group {
|
||||
position: relative;
|
||||
/* border: 1px solid #ccc; */
|
||||
margin-bottom: 20px;
|
||||
border-radius: 2px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta:hover h3 .rule-opts a {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 {
|
||||
width: 300px;
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
line-height: 1.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 .rule-opts {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -65px;
|
||||
font-weight: normal;
|
||||
font-size: 12px;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 .rule-opts a {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.rule-group .rule-body {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
margin: 0;
|
||||
/*padding-top: 5px;*/
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.rule-group .rule-body:before, .rule-group .rule-body:after {
|
||||
display: table;
|
||||
content: "";
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.rule-group .long-dashed {
|
||||
position: absolute;
|
||||
top: 80px;
|
||||
width: 100%;
|
||||
border-bottom: 1px dashed #d7d7d7;
|
||||
}
|
||||
|
||||
.weixin-normal .rule-keywords {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner {
|
||||
font-size: 12px;
|
||||
padding: 0 10px 5px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner h4 {
|
||||
color: #000;
|
||||
font-weight: normal;
|
||||
font-size: 14px;
|
||||
margin: 0 0 5px;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.rule-group .keyword-containe {
|
||||
padding-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.rule-group .info:empty {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.keyword-list .keyword {
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
height: 30px;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.keyword .close--circle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.keyword-list .keyword:hover .close--circle {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.close--circle {
|
||||
position: absolute;
|
||||
z-index: 91;
|
||||
top: 5px;
|
||||
right: 10px;
|
||||
font-size: 28px;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.keyword .value {
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
padding: 4px 10px;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #555555;
|
||||
vertical-align: middle;
|
||||
border-radius: 4px 0 0 4px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.input-append .add-on, .input-prepend .add-on {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
height: 20px;
|
||||
min-width: 16px;
|
||||
padding: 4px 5px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
background-color: #eee;
|
||||
border: 1px solid #ccc;
|
||||
margin-left: -4px;
|
||||
border-radius: 0 4px 4px 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.rule-group hr.dashed {
|
||||
border-bottom: 1px dashed #d7d7d7;
|
||||
border-top: none;
|
||||
margin: 0;
|
||||
background-color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
.rule-group .opt {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.rule-group .opt a {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.weixin-normal .rule-replies {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner {
|
||||
font-size: 12px;
|
||||
padding: 0 10px 5px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner h4 {
|
||||
color: #000;
|
||||
font-weight: normal;
|
||||
font-size: 14px;
|
||||
margin: 0 0 5px;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.rule-group .reply-container, .keyword-container {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.rule-group .info {
|
||||
padding: 5px 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.rule-group .info:empty {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ol.reply-list {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.reply-list li, .quick-dropmenu li {
|
||||
position: relative;
|
||||
padding: 8px 90px 8px 5px;
|
||||
list-style: unset;
|
||||
}
|
||||
|
||||
.reply-list .reply-opts a:hover {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.reply-cont {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.reply-summary {
|
||||
display: inline-block;
|
||||
max-width: 360px;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.reply-list .reply-opts, .quick-dropmenu .reply-opts {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
.reply-list li::after, .quick-dropmenu li::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
border-bottom: 1px dashed #d7d7d7;
|
||||
bottom: 0;
|
||||
left: -20px;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.reply-list li:last-child::after, .quick-dropmenu li:last-child::after {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.rule-group .opt .disable-opt {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.badge-success, .label-success {
|
||||
display: inline-block;
|
||||
padding: 2px 4px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
background: #1AAD19;
|
||||
}
|
||||
/***************************************/
|
||||
.misc {
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.misc>a {
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
color: var(--base-color) !important
|
||||
}
|
||||
|
||||
.others {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.others>a {
|
||||
padding: 10px;
|
||||
color: var(--base-color) !important
|
||||
}
|
||||
|
||||
.pull-right {
|
||||
color: #ccc;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
top: 25px;
|
||||
left: 10px;
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
font-size: 12px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.125);
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 10px 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.dropdown-menu li {
|
||||
padding: 0 10px;
|
||||
line-height: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.others:hover .dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdown-menu li:hover {
|
||||
background: var(--base-color);
|
||||
}
|
||||
|
||||
.dropdown-menu li:hover a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.complex-backdrop {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 75px;
|
||||
left: 25px;
|
||||
width: 86%;
|
||||
height: 36.5%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.complex-content {
|
||||
padding: 6px 10px;
|
||||
}
|
||||
|
||||
.ng.ng-image {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ng {
|
||||
position: relative;
|
||||
vertical-align: top;
|
||||
width: 250px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #eee;
|
||||
background-color: #fff;
|
||||
margin-bottom: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.picture>img {
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.msg-music-thumb {
|
||||
height: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.msg-music-thumb a {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px dashed #F2F2F2;
|
||||
display: block;
|
||||
line-height: 100px;
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
#music .layui-textarea {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.voice-player {
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
border: 1px solid #85ac4c;
|
||||
display: inline-block;
|
||||
width: 90px;
|
||||
height: 25px;
|
||||
padding: 0 6px 0 7px;
|
||||
font-size: 12px !important;
|
||||
line-height: 25px;
|
||||
cursor: pointer;
|
||||
background: #a0ce3d;
|
||||
vertical-align: middle;
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.voice-player::before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
left: -13px;
|
||||
top: 6px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 6px solid transparent;
|
||||
border-right: 6px solid #85ac4c;
|
||||
}
|
||||
|
||||
.voice-player .stop {
|
||||
display: inline-block;
|
||||
color: #fff;
|
||||
text-shadow: 1px 1px 1px #8ab433;
|
||||
}
|
||||
|
||||
.popover .close--circle {
|
||||
z-index: initial;
|
||||
}
|
||||
|
||||
.complex-content .close--circle ,.keyword-list .close--circle {
|
||||
position: absolute;
|
||||
z-index: 91;
|
||||
top: -9px;
|
||||
right: -9px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 16px;
|
||||
line-height: 20px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
background: rgba(153, 153, 153, 0.6);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.voice-player .second {
|
||||
display: none;
|
||||
float: right;
|
||||
font-size: 12px;
|
||||
color: #476600;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.voice-player .play {
|
||||
display: inline-block;
|
||||
width: 17px;
|
||||
height: 20px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.voice-player::after {
|
||||
position: absolute;
|
||||
content: "";
|
||||
left: -12px;
|
||||
top: 6px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 6px solid transparent;
|
||||
border-right: 6px solid #a0ce3d;
|
||||
}
|
||||
/*其他*/
|
||||
.ng .close--circle {
|
||||
top: -9px;
|
||||
right: -9px;
|
||||
}
|
||||
|
||||
.ng .ng-item {
|
||||
border-bottom: 1px solid #eee;
|
||||
overflow: hidden;
|
||||
padding: 5px 9px;
|
||||
}
|
||||
|
||||
.ng .label {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/*图文*/
|
||||
.ng .ng-title {
|
||||
display: inline-block !important;
|
||||
overflow: hidden !important;
|
||||
white-space: nowrap !important;
|
||||
text-overflow: ellipsis !important;
|
||||
line-height: 16px;
|
||||
min-height: 16px;
|
||||
vertical-align: middle;
|
||||
max-width: 180px;
|
||||
}
|
||||
|
||||
a.new-window {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.ng .ng-item.view-more {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.ng .ng-item.view-more a {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/*************************************/
|
||||
.rule-container {
|
||||
/*position: absolute;*/
|
||||
/*padding: 5px 10px;*/
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
/*box-shadow: 0px 1px 6px 7px rgba(0, 0, 0, 0.1);*/
|
||||
/*border: 1px solid #e5e5e5; */
|
||||
/*height: 230px;*/
|
||||
/*width: 460px;*/
|
||||
}
|
||||
|
||||
.rule-container .add_reply-top{
|
||||
position: absolute;
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
line-height: 0px;/*为了防止ie下出现题型*/
|
||||
border-bottom: 10px solid #fff;
|
||||
border-left: 10px solid rgba(0,0,0,0);
|
||||
border-right: 10px solid rgba(0,0,0,0);
|
||||
right: 55px;
|
||||
top: -10px;
|
||||
}
|
||||
|
||||
.popover>.close--circle {
|
||||
top: -5px;
|
||||
right: -5px;
|
||||
}
|
||||
|
||||
.rule-container .arrow {
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
top: 50%;
|
||||
left: -13px;
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
.rule-container .arrow i {
|
||||
color: #e5e5e5;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.layui-card-body, .layui-card-header, .layui-form-label, .layui-form-mid,
|
||||
.layui-form-select, .layui-input-block, .layui-input-inline,
|
||||
.layui-textarea {
|
||||
position: unset;
|
||||
}
|
||||
|
||||
.rule-group-container {
|
||||
min-height: 165px
|
||||
}
|
||||
|
||||
.layui-layer-btn .layui-layer-btn1:hover{
|
||||
color: #333 !important;
|
||||
}
|
||||
.layui-layer-btn a:hover{
|
||||
color: #fff !important;
|
||||
}
|
||||
338
addon/wechat/shop/view/public/css/wx_graphic_message.css
Executable file
@@ -0,0 +1,338 @@
|
||||
#graphic_message {
|
||||
/*width: 760px;*/
|
||||
margin-bottom: 90px;
|
||||
padding: 20px;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.layui-elem-quote{
|
||||
margin: 0 0 20px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message {
|
||||
position: relative;
|
||||
width: 320px;
|
||||
min-height: 310px;
|
||||
float: left;
|
||||
border: 1px solid #C5C5C5;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box {
|
||||
position: relative;
|
||||
margin-top: 80px;
|
||||
width: 380px;
|
||||
min-height: 400px;
|
||||
float: left;
|
||||
padding: 15px;
|
||||
margin-left: 20px;
|
||||
border: 1px solid #d1d1d1;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#graphic_message .arrow, #graphic_message .arrow::after {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 7px 7px 6px 0;
|
||||
border-color: transparent #d1d1d1 transparent transparent;
|
||||
position: absolute;
|
||||
left: -7px;
|
||||
top: 19px;
|
||||
}
|
||||
|
||||
#graphic_message .arrow::after {
|
||||
content: "";
|
||||
border-right-color: #f8f8f8;
|
||||
left: 1px;
|
||||
top: -7px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li {
|
||||
border: 1px solid #AAA;
|
||||
border-top-color: #FFF;
|
||||
border-bottom-color: #DDD;
|
||||
background: #FFF;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child {
|
||||
border-top-color: #AAA;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:last-child {
|
||||
border-bottom-color: #AAA;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li content {
|
||||
display: block;
|
||||
margin: 10px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child content {
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li .title {
|
||||
padding-right: 70px;
|
||||
max-height: 48px;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child .title {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: rgba(0, 0, 0, .5);
|
||||
color: #FFF;
|
||||
z-index: 2;
|
||||
line-height: 30px;
|
||||
overflow: hidden;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
max-height: unset;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child .title span {
|
||||
padding: 2px 7px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li .title span {
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li .action {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#graphic_message .action span.edit, #graphic_message .action span.delete {
|
||||
background: rgba(0, 0, 0, .4);
|
||||
color: #FFF;
|
||||
font-size: 14px;
|
||||
padding: 0 5px;
|
||||
display: inline-block;
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li content img {
|
||||
max-width: 100%;
|
||||
vertical-align: middle;
|
||||
border: 0;
|
||||
float: right;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background: #EEE;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li content .empty-img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
float: right;
|
||||
background: #EEE;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child content img {
|
||||
width: 268px;
|
||||
height: auto;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child content .empty-img {
|
||||
width: 268px;
|
||||
height: auto;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li content .empty-hint {
|
||||
height: 20px;
|
||||
width: 60px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -5px;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
color: #AAA;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#graphic_message .graphic-message-list li:first-child content .empty-hint {
|
||||
height: 20px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 7px;
|
||||
margin: auto;
|
||||
color: #AAA;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
#editor {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#graphic_message .add-graphic-message h4::before {
|
||||
top: -19px;
|
||||
position: absolute;
|
||||
content: ' ';
|
||||
border: 8px solid transparent;
|
||||
border-bottom-width: 10px;
|
||||
border-bottom-color: #ddd;
|
||||
left: 148px;
|
||||
}
|
||||
|
||||
#graphic_message .add-graphic-message h4::after {
|
||||
position: absolute;
|
||||
content: ' ';
|
||||
border: 8px solid transparent;
|
||||
border-bottom-width: 10px;
|
||||
border-bottom-color: #f8f8f8;
|
||||
top: -16px;
|
||||
left: 148px;
|
||||
}
|
||||
|
||||
#graphic_message .add-graphic-message h4 {
|
||||
position: relative;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border-top: 1px solid #ddd;
|
||||
-webkit-box-shadow: 0 0 0 1px #ddd;
|
||||
box-shadow: 0 0 0 1px #ddd;
|
||||
padding: 0 6px 4px 10px;
|
||||
width: 304px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#graphic_message .add-graphic-message h4 a {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#graphic_message .layui-input {
|
||||
width: 270px;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box label {
|
||||
display: inline-block;
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box label .hint {
|
||||
color: #AAA;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box .editor-cover,
|
||||
#graphic_message .editor-box .editor-author,
|
||||
#graphic_message .editor-box .editor-title,
|
||||
#graphic_message .editor-box .editor-content {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box .editor-cover .editor-msg-label {
|
||||
position: relative;
|
||||
padding-left: 17px;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box .editor-cover #check_show_cover_pic {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 1px;
|
||||
height: 13px;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box .editor-cover .choose-cover {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
#graphic_message .editor-box .editor-cover .choose-cover a {
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#edui1_bottombar.edui-editor-bottomContainer.edui-default {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.bottom-botton {
|
||||
position: absolute;
|
||||
padding: 20px 0;
|
||||
width: auto;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: -80px;
|
||||
text-align: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.loading {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
padding-top: 20%;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.loading .layui-icon {
|
||||
font-size: 39px;
|
||||
}
|
||||
|
||||
.show {
|
||||
display: block !important;
|
||||
}
|
||||
.choose-cover-pic{
|
||||
margin-bottom: 10px;
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
text-align: center;
|
||||
line-height: 160px;
|
||||
}
|
||||
.choose-cover-pic img{
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
106
addon/wechat/shop/view/public/css/wx_leavemsg.css
Executable file
@@ -0,0 +1,106 @@
|
||||
.user_info{
|
||||
position: relative;
|
||||
/* margin-left: 80px;
|
||||
margin-right: 215px; */
|
||||
}
|
||||
.message_info{
|
||||
margin-left:80px;
|
||||
margin-right:80px;
|
||||
width:auto;
|
||||
}
|
||||
.user_info .avatar{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left:16px;
|
||||
}
|
||||
.user_info img{
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
|
||||
}
|
||||
|
||||
.layui-table .layui-table-cell{
|
||||
padding:1px;
|
||||
}
|
||||
.layui-table thead tr{
|
||||
display:none;
|
||||
}
|
||||
.message_content{
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
color: #8d8d8d;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
white-space:normal;
|
||||
}
|
||||
.layui-icon-reply-fill:hover{
|
||||
color:#393D49 !important;
|
||||
}
|
||||
.headimg{
|
||||
width:80px;
|
||||
}
|
||||
.message_list{
|
||||
font-size:14px;
|
||||
min-height: 46px;
|
||||
/* border: 1px solid #e7e7eb;
|
||||
padding: 15px;*/
|
||||
}
|
||||
.message_time{
|
||||
margin-top: 0;
|
||||
color: #8d8d8d;
|
||||
}
|
||||
.layui-table tbody tr:hover,.layui-table-click{
|
||||
background-color:#FFF;
|
||||
}
|
||||
.layui-table tbody tr{
|
||||
border:none;
|
||||
}
|
||||
.reply-box{
|
||||
display:none;
|
||||
border-top:1px solid #e7e7eb;
|
||||
padding-top:15px;
|
||||
padding-left:80px;
|
||||
padding-right:80px;
|
||||
}
|
||||
.layui-table-header{
|
||||
border:none;
|
||||
}
|
||||
.reply-button{
|
||||
padding-top:15px;
|
||||
}
|
||||
.reply-button button{
|
||||
min-width:100px;
|
||||
}
|
||||
.userinfo-box-headimg{
|
||||
float: left;
|
||||
width: 230px;
|
||||
height: 230px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.userinfo-box-user-info{
|
||||
overflow: hidden;
|
||||
height: 230px;
|
||||
position: relative;
|
||||
}
|
||||
.userinfo-box-user-info-title{
|
||||
width:20px;
|
||||
margin-right:10px;
|
||||
color: #8d8d8d;
|
||||
}
|
||||
.userinfo-box-user-info-content{
|
||||
font-weight:normal;
|
||||
}
|
||||
.layui-layer-tips{
|
||||
width:auto !important;
|
||||
}
|
||||
.userinfo-box-user-info .layui-card-body{
|
||||
color: #333;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
.userinfo-box-user-info-header-title{
|
||||
margin-right:200px;
|
||||
}
|
||||
.layui-tab-title{
|
||||
margin-bottom:15px;
|
||||
}
|
||||
280
addon/wechat/shop/view/public/css/wx_material.css
Executable file
@@ -0,0 +1,280 @@
|
||||
.right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.layui-table-page {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.layui-table-cell {
|
||||
height: auto;
|
||||
line-height: 28px;
|
||||
min-height: 28px;
|
||||
}
|
||||
|
||||
/* ----------------------------------GRAPHIC_MESSAGE_LIST----------------------------- */
|
||||
#graphic_message_list + div .layui-table-box .layui-table td {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-row.grid-demo {
|
||||
border: 1px solid #DEDEDE;
|
||||
border-radius: 5px;
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.article-img span {
|
||||
padding: 2px 4px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12 {
|
||||
padding: 2px 0;
|
||||
border-bottom: 1px solid #DEDEDE;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12.read-all {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12:first-child {
|
||||
padding: 7px 0;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3 {
|
||||
padding-left: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.title {
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.title a {
|
||||
color: #0d73f9;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md4 {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
#graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md4.layui-col-md-offset4 {
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
a.graphic-message-title {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* ----------------------------------MATERIAL_GRAPHIC_MESSAGE_LIST----------------------------- */
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-row.grid-demo {
|
||||
border: 1px solid #DEDEDE;
|
||||
border-radius: 5px;
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.article-img span {
|
||||
background: green;
|
||||
color: #FFF;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12 {
|
||||
padding: 2px 0;
|
||||
border-bottom: 1px solid #DEDEDE;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12.read-all {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12:first-child {
|
||||
padding: 7px 0;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3 {
|
||||
padding-left: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.title {
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
width: 150px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.title a {
|
||||
color: #0d73f9;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md4 {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
#marterial_graphic_message_list + div .layui-table-box .layui-table td[data-field='value'] .layui-col-md4.layui-col-md-offset4 {
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
/* ----------------------------------material_text----------------------------- */
|
||||
#material_text div .layui-table-box .layui-table td {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-row.grid-demo {
|
||||
border: 1px solid #DEDEDE;
|
||||
border-radius: 5px;
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.article-img span {
|
||||
background: green;
|
||||
color: #FFF;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12 {
|
||||
padding: 2px 0;
|
||||
border-bottom: 1px solid #DEDEDE;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12.read-all {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12:first-child {
|
||||
padding: 7px 0;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md12:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3 {
|
||||
padding-left: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.title {
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
width: 150px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md3.title a {
|
||||
color: #0d73f9;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md4 {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
#material_text div .layui-table-box .layui-table td[data-field='value'] .layui-col-md4.layui-col-md-offset4 {
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
/* --------------------------------ADD_MATERIAL_TEXT -------------------------------------- */
|
||||
#add_material_text form.layui-form {
|
||||
padding: 15px;
|
||||
padding-right: 50px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#add_material_text .input-text-hint {
|
||||
float: right;
|
||||
color: #AAA;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
/* -------------------------------- MATERIAL_IMAGE -----------------------------------------*/
|
||||
#material_image .img-list {
|
||||
padding-top: 26px;
|
||||
text-align: center;
|
||||
margin-bottom: 80px;
|
||||
}
|
||||
|
||||
#material_image .img-list::after {
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#material_image .img-list .layui-col-md2 .img {
|
||||
display: inline-block;
|
||||
background: #ccc;
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
text-align: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover !important;
|
||||
background-position: 50% !important;
|
||||
}
|
||||
|
||||
#material_image .buttom-button {
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
left: 50%;
|
||||
margin-left: -66px;
|
||||
}
|
||||
|
||||
#material_image .img-list p.layui-elip {
|
||||
max-width: 110px;
|
||||
padding: 5px 20px;
|
||||
}
|
||||
|
||||
#material_image .img-list .img-check-mask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 11px;
|
||||
right: 11px;
|
||||
bottom: 26px;
|
||||
line-height: 120px;
|
||||
background: rgba(0, 0, 0, .5);
|
||||
}
|
||||
|
||||
#material_image .img-list .img-check-mask[data-show='false'] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#material_image .img-list .layui-icon-ok {
|
||||
color: #FFF;
|
||||
font-size: 36px;
|
||||
}
|
||||
.article-img .bg-color {
|
||||
color: #fff;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
442
addon/wechat/shop/view/public/css/wx_menu.css
Executable file
@@ -0,0 +1,442 @@
|
||||
.hide {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.wx-menu {
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.wx-menu-preview {
|
||||
width: 320px;
|
||||
height: 570px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.mobile-preview {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
border: 1px solid #e7e7eb;
|
||||
}
|
||||
|
||||
.mobile-hd {
|
||||
height: 25px;
|
||||
padding-top: 35px;
|
||||
color: #FFF;
|
||||
background: #000;
|
||||
font-size: 16px;
|
||||
background-image: url(../img/mobile_head.png);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mobile-bd {
|
||||
height: 50px;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-top: 1px solid #e7e7eb;
|
||||
background: transparent url(../img/mobile_foot_default.png) no-repeat 0 0;
|
||||
}
|
||||
|
||||
.wx-menu-list {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
padding-left: 43px;
|
||||
}
|
||||
|
||||
.wx-menu-item-box {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
line-height: 50px;
|
||||
color: #616161;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wx-menu-item-box.add-menu {
|
||||
border-left: 1px solid #e7e7eb;
|
||||
}
|
||||
|
||||
.wx-menu-item {
|
||||
border-left: 1px solid #e7e7eb;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wx-menu-item.active, .wx-sub-menu-item.active {
|
||||
border: 1px solid;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.wx-sub-menu-list {
|
||||
position: absolute;
|
||||
bottom: 62px;
|
||||
width: 136px;
|
||||
border: 1px solid #d0d0d0;
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
.wx-sub-menu-list.two, .wx-sub-menu-list.three {
|
||||
width: 90.328px;
|
||||
}
|
||||
|
||||
.wx-sub-menu-list.active-second {
|
||||
left: 134.328px;
|
||||
}
|
||||
|
||||
.wx-sub-menu-list.active-third {
|
||||
left: 226.328px;
|
||||
}
|
||||
|
||||
.wx-sub-menu-item {
|
||||
border-top: 1px solid #d0d0d0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wx-menu-item, .wx-sub-menu-item {
|
||||
line-height: 50px;
|
||||
background-color: #fafafa;
|
||||
text-align: center;
|
||||
color: #616161;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.wx-sub-menu-list .wx-sub-menu-item {
|
||||
height: 50px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.wx-menu-form {
|
||||
width: auto;
|
||||
margin-left: 340px;
|
||||
min-height: 570px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.form-editor {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
background-color: #f4f5f9;
|
||||
border: 1px solid #e7e7eb;
|
||||
min-width: 560px;
|
||||
}
|
||||
|
||||
.form-editor .form-hd {
|
||||
padding: 10px 20px;
|
||||
border-bottom: 1px solid #e7e7eb;
|
||||
line-height: 31px;
|
||||
}
|
||||
|
||||
.form-hd-name {
|
||||
float: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.form-hd-del {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.form-editor .form-bd {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.item-label {
|
||||
width: 5em;
|
||||
float: left;
|
||||
margin-top: .3em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
.item-group {
|
||||
display: table-cell;
|
||||
vertical-align: top;
|
||||
float: none;
|
||||
width: auto;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.button-list-null {
|
||||
position: absolute;
|
||||
top: 37%;
|
||||
left: 30%;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.tip {
|
||||
color: #AAA;
|
||||
padding: 2px 2px 2px 0;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.tip.error {
|
||||
color: red;
|
||||
}
|
||||
|
||||
input.error {
|
||||
border-color: red !important;
|
||||
}
|
||||
|
||||
.form-bd-content {
|
||||
background-color: #fff;
|
||||
padding: 0 15px 15px;
|
||||
min-height: 290px;
|
||||
margin: 15px 0 0;
|
||||
border-radius: 7px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.item-group.menu-type {
|
||||
padding-left: 17px;
|
||||
}
|
||||
|
||||
.form-bd-item:first-child {
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.form-bd-item {
|
||||
min-height: 35px;
|
||||
line-height: 35px;
|
||||
padding-bottom: 15px
|
||||
}
|
||||
|
||||
.input.layui-input {
|
||||
display: inline-block !important;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.wechat-media i.layui-icon {
|
||||
color: #AAA;
|
||||
font-size: 16px;
|
||||
padding: 0 7px;
|
||||
}
|
||||
|
||||
.wechat-media .layui-this i.layui-icon {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.radio-label input {
|
||||
position: absolute;
|
||||
left: -500vw;
|
||||
top: -500vw;
|
||||
}
|
||||
|
||||
.radio-label i.layui-icon {
|
||||
color: #AAA;
|
||||
}
|
||||
|
||||
.radio-label {
|
||||
margin-right: 15px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
.form-ft {
|
||||
padding-top: 20px;
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.form-bd-list {
|
||||
background: #FFF;
|
||||
border-radius: 7px;
|
||||
padding-left: 22px;
|
||||
padding-top: 7px;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
|
||||
.material-library, .add-material {
|
||||
display: inline-block;
|
||||
width: 40%;
|
||||
margin-top: 15px;
|
||||
text-align: center;
|
||||
padding: 50px 0;
|
||||
border: 1px dotted #CCC;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.material-library object, .add-material object {
|
||||
width: 36px;
|
||||
}
|
||||
|
||||
.material-library {
|
||||
float: left;
|
||||
margin-left: 5%;
|
||||
}
|
||||
|
||||
.material-library i, .add-material i {
|
||||
background-size: 100% 100%;
|
||||
background-color: #FFF;
|
||||
display: block;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
margin: auto;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.material-library i {
|
||||
background-image: url(../img/folder.png);
|
||||
}
|
||||
|
||||
.add-material i {
|
||||
background-image: url(../img/add.png);
|
||||
}
|
||||
|
||||
.add-material {
|
||||
float: right;
|
||||
margin-right: 5%;
|
||||
}
|
||||
|
||||
.material-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.material-img img {
|
||||
max-width: 70%;
|
||||
max-height: 180px;
|
||||
}
|
||||
|
||||
.del {
|
||||
display: inline-block;
|
||||
vertical-align: bottom;
|
||||
color: var(--base-color);
|
||||
text-decoration: solid;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.menu-content .layui-textarea {
|
||||
height: 170px;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.material-type {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.material-type span {
|
||||
background: green;
|
||||
color: #FFF;
|
||||
padding: 2px 4px;
|
||||
display: inline-block;
|
||||
width: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.graphic-message-list {
|
||||
width: 400px;
|
||||
border: 1px solid #CCC;
|
||||
border-radius: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.graphic-message-list .graphic-message-content {
|
||||
border-bottom: 1px solid #DDD;
|
||||
padding: 5px 15px;
|
||||
}
|
||||
|
||||
.graphic-message-list .graphic-message-content:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.graphic-message-list .graphic-message-content .title {
|
||||
display: inline-block;
|
||||
width: 75%;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.graphic-message-list .graphic-message-content .title a {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.graphic-message-list .read-all {
|
||||
padding: 5px 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.graphic-message-list .read-all::after {
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.graphic-message-list .read-all div {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.graphic-message-list .read-all i {
|
||||
float: right;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.text-message {
|
||||
width: 400px;
|
||||
border: 1px solid #CCC;
|
||||
border-radius: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.text-message .text-message-content {
|
||||
border-bottom: 1px solid #DDD;
|
||||
padding: 5px 15px;
|
||||
}
|
||||
|
||||
.text-message .text-message-content .title {
|
||||
width: 380px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
vertical-align: middle;
|
||||
border-top: 1px solid #CCC;
|
||||
margin-top: 10px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.text-message .text-message-content .title a {
|
||||
word-wrap: break-word;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 4;
|
||||
-webkit-box-orient: vertical;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.text-message .text-message-content .material-type {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.wx-menu-item, .wx-menu-item span, .wx-sub-menu-item, .wx-sub-menu-item span {
|
||||
moz-user-select: -moz-none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.article-img .bg-color {
|
||||
color: #fff;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
.text-r{
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
border-color: #ccc;
|
||||
resize:none
|
||||
}
|
||||
77
addon/wechat/shop/view/public/css/wx_preview_graphic_message.css
Executable file
@@ -0,0 +1,77 @@
|
||||
.preview-box {
|
||||
max-width: 600px;
|
||||
height: 779px;
|
||||
background: #FFF;
|
||||
margin: 0 auto;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.rich-media-thumb img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.preview-box::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
}
|
||||
|
||||
.preview-box::-webkit-scrollbar-track {
|
||||
background-color: #EEE;
|
||||
}
|
||||
|
||||
.preview-box::-webkit-scrollbar-thumb {
|
||||
background-color: #CCC;
|
||||
}
|
||||
|
||||
.preview-box::-webkit-scrollbar-thumb:hover {
|
||||
background-color: #AAA
|
||||
}
|
||||
|
||||
.preview-box::-webkit-scrollbar-thumb:active {
|
||||
background-color: #AAA
|
||||
}
|
||||
|
||||
.preview-box > img.head {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.preview-box > .graphic-message {
|
||||
position: relative;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
padding-bottom: 150px;
|
||||
}
|
||||
|
||||
.preview-box > .graphic-message > span.time, .preview-box > .graphic-message > span.author {
|
||||
display: inline-block;
|
||||
color: #AAA;
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
.preview-box > .graphic-message > content {
|
||||
display: block;
|
||||
position: relative;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.preview-box > .graphic-message > .graphic-message-content {
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.preview-box > .graphic-message a.original-text {
|
||||
position: absolute;
|
||||
bottom: 50px;
|
||||
left: 0px;
|
||||
color: #607fa6;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
119
addon/wechat/shop/view/public/css/wx_qrcode.css
Executable file
@@ -0,0 +1,119 @@
|
||||
.qrcode-body {
|
||||
padding: 10px;
|
||||
margin: 10px 0;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
#albumList {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.input-file {
|
||||
position: absolute;
|
||||
top: -10px !important;
|
||||
right: 9px !important;
|
||||
height: 26px !important;
|
||||
width: 94px !important;
|
||||
filter: alpha(opacity:0) !important;
|
||||
opacity: 0 !important;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.qrcode_button {
|
||||
background-color: #51a351;
|
||||
border: none;
|
||||
margin-top: 15px;
|
||||
width: 100%;
|
||||
color: #FFF;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.check {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
right: -1px;
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
display: none;
|
||||
}
|
||||
|
||||
.check div {
|
||||
width: 60%;
|
||||
height: 30px;
|
||||
margin-left: 20%;
|
||||
border: 1px solid #fff;
|
||||
margin-top: 10%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.check div:hover {
|
||||
background: var(--base-color);
|
||||
border: 1px solid var(--base-color);
|
||||
}
|
||||
|
||||
.check div span {
|
||||
font-size: 15px;
|
||||
color: #fff;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.options-btn {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
#albumList li {
|
||||
opacity: 1;
|
||||
height: auto;
|
||||
position: relative;
|
||||
float: left;
|
||||
margin-right: 1%;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
line-height: 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.img-block {
|
||||
width: 100%;
|
||||
}
|
||||
.qrcode {
|
||||
width: 320px;
|
||||
height: 569px;
|
||||
background: #f5f5f5;
|
||||
position: relative;
|
||||
}
|
||||
.qrcode #imgLogo {
|
||||
max-width: 320px;
|
||||
max-height: 569px;
|
||||
}
|
||||
.tdrag-header {
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
position: absolute;
|
||||
left: 59px; top: 15px;
|
||||
cursor: move;
|
||||
}
|
||||
.tdrag-logo {
|
||||
width: 43px;
|
||||
position: absolute;
|
||||
left: 60px;
|
||||
top: 210px;
|
||||
cursor: move;
|
||||
}
|
||||
.tdrag-code{
|
||||
width: 144px;
|
||||
height: 144px;
|
||||
position: absolute;
|
||||
left: 70px;
|
||||
top: 300px;
|
||||
cursor: move;
|
||||
}
|
||||
.tdrag-name{
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
position: absolute;
|
||||
left: 128px;
|
||||
top: 23px;
|
||||
cursor: move;
|
||||
}
|
||||
811
addon/wechat/shop/view/public/css/wx_replay.css
Executable file
@@ -0,0 +1,811 @@
|
||||
button, input, select, textarea {
|
||||
font-family: inherit;
|
||||
font-size: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
input:-moz-placeholder, textarea:-moz-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.empty{width: 100%;margin-top: 15px;text-align: center;padding: 75px 0;}
|
||||
|
||||
input::-moz-placeholder, textarea::-moz-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
}
|
||||
a:-webkit-any-link {
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.reply-opts a:-webkit-any-link {
|
||||
color: var(--base-color);
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.reply-opts .delet-color:-webkit-any-link {
|
||||
color: #ff3d3d;
|
||||
}
|
||||
.rule-group .rule-meta h3 .rule-opts .delet-color {
|
||||
color: #ff3d3d;
|
||||
}
|
||||
|
||||
button {
|
||||
display: inline-block;
|
||||
padding: 0 22px;
|
||||
min-width: 54px;
|
||||
line-height: 2.42857143;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border-radius: 3px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.layui-body {
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.page-title h2 {
|
||||
font-size: 26px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.type-menu {
|
||||
text-align: left;
|
||||
height: 50px;
|
||||
line-height: 40px;
|
||||
border-bottom: 1px solid #E0E1E2;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.type-menu li {
|
||||
float: left;
|
||||
margin-right: 24px;
|
||||
line-height: 40px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.replay-info {
|
||||
padding: 15px 0 0;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.weixin-normal {
|
||||
margin-top: 15px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.replay-info .info {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.replay-info h3 {
|
||||
display: inline-block;
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.replay-info h3:last-child {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.replay-button {
|
||||
float: right;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.replay-button > div {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.replay-button:after {
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.replay-button > label {
|
||||
background-color: #1AAD19;
|
||||
border-color: #1AAD19;
|
||||
color: #FFFFFF;
|
||||
display: inline-block;
|
||||
min-width: 54px;
|
||||
line-height: 2.42857143;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border-radius: 3px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.replay-button .layui-layer-page {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.replay-button .layui-form > .layui-btn {
|
||||
display: block;
|
||||
margin: auto;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.replay-button label > input {
|
||||
position: absolute;
|
||||
left: -9999em;
|
||||
}
|
||||
|
||||
.replay-button .search {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-right: .5em;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.replay-button .down {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.replay-button .down button {
|
||||
padding: 14px 12px 10px 12px;
|
||||
min-width: unset;
|
||||
}
|
||||
|
||||
.down .show-menu li a {
|
||||
color: #00A717;
|
||||
}
|
||||
|
||||
.down .show-menu li a {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.rule-group {
|
||||
border: 1px solid #e5e5e5;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 2px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.rule-group:hover {
|
||||
border: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 .rule-opts a:hover {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
line-height: 1.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 .rule-opts {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0px;
|
||||
font-weight: normal;
|
||||
font-size: 12px;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.rule-group .rule-meta h3 .rule-opts a {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.rule-group .rule-body {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
/* margin: 0 0 10px;
|
||||
padding-top: 5px; */
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.rule-group .rule-body:before, .rule-group .rule-body:after {
|
||||
display: table;
|
||||
content: "";
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
/* .rule-group .long-dashed {
|
||||
position: absolute;
|
||||
top: 80px;
|
||||
width: 100%;
|
||||
border-bottom: 1px dashed #e5e5e5;
|
||||
} */
|
||||
|
||||
.weixin-normal .rule-keywords {
|
||||
float: left;
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner {
|
||||
font-size: 12px;
|
||||
padding: 0 10px 5px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner h4 {
|
||||
color: #000;
|
||||
font-weight: normal;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.rule-group .keyword-containe {
|
||||
padding-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.rule-group .info:empty {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.rule-group .keyword-list, .reply-list {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.keyword-list .keyword {
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
height: 30px;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.keyword .close--circle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.keyword-list .keyword:hover .close--circle {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.complex-content .close--circle ,.keyword-list .close--circle {
|
||||
position: absolute;
|
||||
z-index: 91;
|
||||
top: -9px;
|
||||
right: -9px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 16px;
|
||||
line-height: 20px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
background: rgba(153, 153, 153, 0.6);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.keyword .value {
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
padding: 2px 10px;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #333;
|
||||
vertical-align: middle;
|
||||
border-radius: 2px 0 0 2px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.input-append .add-on, .input-prepend .add-on {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
height: 20px;
|
||||
min-width: 16px;
|
||||
padding: 2px 7px;
|
||||
font-size: 10px;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #ccc;
|
||||
margin-left: -4px;
|
||||
border-radius: 0 2px 2px 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* .rule-group hr.dashed {
|
||||
border-bottom: 1px dashed #d7d7d7;
|
||||
border-top: none;
|
||||
margin: 0;
|
||||
background-color: rgb(255, 255, 255);
|
||||
|
||||
} */
|
||||
.layui-textarea {
|
||||
resize:none
|
||||
}
|
||||
.rule-group .opt {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.rule-group .opt a {
|
||||
color: var(--base-color);
|
||||
}
|
||||
.inner-keywordbox a {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.weixin-normal .rule-replies {
|
||||
position: static;
|
||||
float: left;
|
||||
border-left: 1px solid #f7f7f7;
|
||||
padding-top: 10px;
|
||||
min-height: 115px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner {
|
||||
font-size: 12px;
|
||||
padding: 0 10px 5px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner .inner-keywordbox {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 15px;
|
||||
background: #f7f7f7;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.rule-group .rule-inner h4 {
|
||||
color: #000;
|
||||
font-weight: normal;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.rule-group .reply-container, .keyword-container {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.rule-group .info {
|
||||
padding: 5px 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.rule-group .info:empty {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ol.reply-list {
|
||||
list-style-type: decimal !important;
|
||||
}
|
||||
|
||||
.reply-list li, .quick-dropmenu li {
|
||||
position: relative;
|
||||
padding: 8px 90px 8px 5px;
|
||||
margin-left: 20px;
|
||||
list-style: unset;
|
||||
}
|
||||
|
||||
.reply-list .reply-opts a:hover {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.reply-cont {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.reply-summary {
|
||||
display: inline-block;
|
||||
max-width: 360px;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.reply-list .reply-opts, .quick-dropmenu .reply-opts {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
.reply-list li::after, .quick-dropmenu li::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
border-bottom: 1px dashed #d7d7d7;
|
||||
bottom: 0;
|
||||
left: -20px;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.reply-list li:last-child::after, .quick-dropmenu li:last-child::after {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.rule-group .opt .disable-opt {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.badge-success, .label-success {
|
||||
display: inline-block;
|
||||
padding: 2px 4px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
background-color: #1AAD19;
|
||||
}
|
||||
|
||||
/***************************************/
|
||||
.misc {
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.misc > a {
|
||||
display: inline-block;
|
||||
padding: 7px 10px;
|
||||
color: var(--base-color) !important;
|
||||
border-bottom: 2px solid #fff;
|
||||
}
|
||||
|
||||
.misc .active {
|
||||
color: var(--base-color)!important;
|
||||
border-color: var(--base-color);
|
||||
}
|
||||
|
||||
.others {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.others > a {
|
||||
padding: 10px;
|
||||
color: var(--base-color) !important
|
||||
}
|
||||
|
||||
.pull-right {
|
||||
color: #ccc;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
top: 25px;
|
||||
left: 10px;
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
font-size: 12px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.125);
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 10px 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.dropdown-menu li {
|
||||
padding: 0 10px;
|
||||
line-height: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.others:hover .dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdown-menu li:hover {
|
||||
background: var(--base-color);
|
||||
}
|
||||
|
||||
.dropdown-menu li:hover a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.complex-backdrop {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 75px;
|
||||
left: 25px;
|
||||
width: 86%;
|
||||
height: 36.5%;
|
||||
background-color: #fff;
|
||||
/* -webkit-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.25);
|
||||
box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.25); */
|
||||
/* border:1px solid #E6E6E6; */
|
||||
/* padding-top: 12px; */
|
||||
}
|
||||
|
||||
.layui-layout-admin .layui-body .body-content {
|
||||
background: #f8f8f8;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.fourstage-nav .layui-tab-title {
|
||||
background: #fff;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.fourstage-nav .layui-tab-title li {
|
||||
line-height: 48px;
|
||||
margin: 0 15px;
|
||||
}
|
||||
|
||||
.keyword-content {
|
||||
background: #fff;
|
||||
padding: 15px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
[lay-id=marterial_graphic_message_list] .article-img .bg-color {
|
||||
background-color: #1aad19 !important;
|
||||
}
|
||||
.layui-table-view{
|
||||
background-color: red!important;
|
||||
}
|
||||
|
||||
.complex-content {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.ng.ng-image {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.insert-connect {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 20px;
|
||||
color: var(--base-color) !important;
|
||||
}
|
||||
|
||||
.ng {
|
||||
position: relative;
|
||||
vertical-align: top;
|
||||
width: 250px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #eee;
|
||||
background-color: #fff;
|
||||
margin-bottom: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.picture > img {
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.msg-music-thumb {
|
||||
height: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.msg-music-thumb a {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px dashed #F2F2F2;
|
||||
display: block;
|
||||
line-height: 100px;
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
#music .layui-textarea {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.voice-player {
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
border: 1px solid #85ac4c;
|
||||
display: inline-block;
|
||||
width: 90px;
|
||||
height: 25px;
|
||||
padding: 0 6px 0 7px;
|
||||
font-size: 12px !important;
|
||||
line-height: 25px;
|
||||
cursor: pointer;
|
||||
background: #a0ce3d;
|
||||
vertical-align: middle;
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.voice-player::before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
left: -13px;
|
||||
top: 6px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 6px solid transparent;
|
||||
border-right: 6px solid #85ac4c;
|
||||
}
|
||||
|
||||
.voice-player .stop {
|
||||
display: inline-block;
|
||||
color: #fff;
|
||||
text-shadow: 1px 1px 1px #8ab433;
|
||||
}
|
||||
|
||||
.popover .close--circle {
|
||||
z-index: initial;
|
||||
}
|
||||
|
||||
.close--circle {
|
||||
position: absolute;
|
||||
z-index: 91;
|
||||
top: 5px;
|
||||
right: 10px;
|
||||
font-size: 28px;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.voice-player .second {
|
||||
display: none;
|
||||
float: right;
|
||||
font-size: 12px;
|
||||
color: #476600;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.voice-player .play {
|
||||
display: inline-block;
|
||||
width: 17px;
|
||||
height: 20px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.voice-player::after {
|
||||
position: absolute;
|
||||
content: "";
|
||||
left: -12px;
|
||||
top: 6px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border: 6px solid transparent;
|
||||
border-right: 6px solid #a0ce3d;
|
||||
}
|
||||
|
||||
/*其他*/
|
||||
.ng .close--circle {
|
||||
top: -9px;
|
||||
right: -9px;
|
||||
}
|
||||
|
||||
.ng .ng-item {
|
||||
border-bottom: 1px solid #eee;
|
||||
overflow: hidden;
|
||||
padding: 5px 9px;
|
||||
}
|
||||
|
||||
.ng .label {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/*图文*/
|
||||
.ng .ng-title {
|
||||
display: inline-block !important;
|
||||
overflow: hidden !important;
|
||||
white-space: nowrap !important;
|
||||
text-overflow: ellipsis !important;
|
||||
line-height: 16px;
|
||||
min-height: 16px;
|
||||
vertical-align: middle;
|
||||
max-width: 180px;
|
||||
}
|
||||
|
||||
a.new-window {
|
||||
color: var(--base-color);
|
||||
}
|
||||
|
||||
.ng .ng-item.view-more {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.ng .ng-item.view-more a {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/*************************************/
|
||||
|
||||
.rule-container .add_reply-top{
|
||||
position: absolute;
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
line-height: 0px;/*为了防止ie下出现题型*/
|
||||
border-bottom: 10px solid #fff;
|
||||
border-left: 10px solid rgba(0,0,0,0);
|
||||
border-right: 10px solid rgba(0,0,0,0);
|
||||
right: 55px;
|
||||
top: -10px;
|
||||
}
|
||||
|
||||
.popover > .close--circle {
|
||||
top: -5px;
|
||||
right: -5px;
|
||||
}
|
||||
|
||||
.rule-container .arrow {
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
top: 50%;
|
||||
left: -13px;
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
.rule-container .arrow i {
|
||||
color: #e5e5e5;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.rule-group-container {
|
||||
position: relative;
|
||||
min-height: 165px
|
||||
}
|
||||
|
||||
.search {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 1px;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.layui-form-item .layui-textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.layui-form.hyperlink {
|
||||
padding: 10px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.layui-form.hyperlink .layui-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.layui-layout-shop .fourstage-nav ul li.layui-this:after {
|
||||
border: none !important;
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
background-color: var(--base-color);
|
||||
border-radius: 30px !important;
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
}
|
||||
BIN
addon/wechat/shop/view/public/img/add.png
Executable file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
addon/wechat/shop/view/public/img/administration.png
Executable file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
addon/wechat/shop/view/public/img/appmsg.png
Executable file
|
After Width: | Height: | Size: 29 KiB |
BIN
addon/wechat/shop/view/public/img/appmsg1.png
Executable file
|
After Width: | Height: | Size: 16 KiB |
BIN
addon/wechat/shop/view/public/img/appmsg2.png
Executable file
|
After Width: | Height: | Size: 95 KiB |
BIN
addon/wechat/shop/view/public/img/arrow.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/article-msg.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/audio.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/base_icon.png
Executable file
|
After Width: | Height: | Size: 93 KiB |
BIN
addon/wechat/shop/view/public/img/cart.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
addon/wechat/shop/view/public/img/check_qrcode1.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
addon/wechat/shop/view/public/img/complete.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/config_fans_icon.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
addon/wechat/shop/view/public/img/config_info.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/config_leavemsg_icon.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
addon/wechat/shop/view/public/img/config_mass_icon.png
Executable file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
addon/wechat/shop/view/public/img/config_material_icon.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
addon/wechat/shop/view/public/img/config_menu_icon.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
addon/wechat/shop/view/public/img/config_message_icon.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
addon/wechat/shop/view/public/img/config_qrcode_icon.png
Executable file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
addon/wechat/shop/view/public/img/config_replay_icon.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
addon/wechat/shop/view/public/img/config_share_icon.png
Executable file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
addon/wechat/shop/view/public/img/config_wechat_icon.png
Executable file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
addon/wechat/shop/view/public/img/edition.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
addon/wechat/shop/view/public/img/flow/arrow.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/flow/complete.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/flow/config_info.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/flow/edition.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
addon/wechat/shop/view/public/img/flow/public_number.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/flow/register.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/folder.png
Executable file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
addon/wechat/shop/view/public/img/icon-header.png
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
addon/wechat/shop/view/public/img/icon.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
addon/wechat/shop/view/public/img/icon_audio_player.png
Executable file
|
After Width: | Height: | Size: 19 KiB |
BIN
addon/wechat/shop/view/public/img/index_author.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/index_weixin.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
addon/wechat/shop/view/public/img/material_delete.png
Executable file
|
After Width: | Height: | Size: 1003 B |
BIN
addon/wechat/shop/view/public/img/material_download.png
Executable file
|
After Width: | Height: | Size: 15 KiB |
BIN
addon/wechat/shop/view/public/img/material_edit.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
addon/wechat/shop/view/public/img/menu_icon/menu_wchat_selected.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/menu_icon/menu_wechat.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/menu_icon/wechat_icon.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/menu_icon/wechat_icon_new.png
Executable file
|
After Width: | Height: | Size: 829 B |
BIN
addon/wechat/shop/view/public/img/menu_icon/wechat_icon_select.png
Executable file
|
After Width: | Height: | Size: 694 B |
BIN
addon/wechat/shop/view/public/img/menu_preview.png
Executable file
|
After Width: | Height: | Size: 21 KiB |
BIN
addon/wechat/shop/view/public/img/mobile_foot_default.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/mobile_head.png
Executable file
|
After Width: | Height: | Size: 12 KiB |
BIN
addon/wechat/shop/view/public/img/picture.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/public_number.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/register.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/set_up.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
addon/wechat/shop/view/public/img/small_procedures.png
Executable file
|
After Width: | Height: | Size: 667 B |
BIN
addon/wechat/shop/view/public/img/template_qrcode.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
addon/wechat/shop/view/public/img/video.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/wechat.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/wechat/shop/view/public/img/wx_feature_set.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/wechat/shop/view/public/img/wx_menu_icos.png
Executable file
|
After Width: | Height: | Size: 228 B |
16
addon/wechat/shop/view/public/js/common.js
Executable file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* 素材库
|
||||
* @param type
|
||||
*/
|
||||
function material(type) {
|
||||
layui.use(['layer'], function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: "素材库",
|
||||
area: ['890px', '700px'],
|
||||
fixed: false, //不固定
|
||||
maxmin: false,
|
||||
content: ns.url("wechat://shop/material/material", {request_mode: 'iframe', type: type}),
|
||||
})
|
||||
})
|
||||
}
|
||||
475
addon/wechat/shop/view/public/js/wx_default.js
Executable file
@@ -0,0 +1,475 @@
|
||||
WxReplay = function (limit = 0, limits = []) {
|
||||
var _this = this;
|
||||
_this._dom = null;
|
||||
_this.eventFlg = true;
|
||||
|
||||
_this.listCount = 0;
|
||||
_this.limit = limit == false ? 15 : limit;
|
||||
_this.limits = limit == false ? [15, 20, 50] : limits;
|
||||
_this.page = 1;
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取关注后回复列表
|
||||
*/
|
||||
WxReplay.prototype.getData = function (d) {
|
||||
var _this = d._this;
|
||||
var page = _this.page;
|
||||
var limit = _this.limit;
|
||||
var rule_type = d.rule_type;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/default'),
|
||||
async: false,
|
||||
data: {"page": page, "limit": limit, "rule_type": rule_type},
|
||||
success: function (data) {
|
||||
_this.listCount = data.data.count;
|
||||
_this.aD.addReolayList(data.data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* layui分页
|
||||
*/
|
||||
WxReplay.prototype.pageInit = function (d) {
|
||||
var _this = d._this;
|
||||
layui.use('laypage', function () {
|
||||
var laypage = layui.laypage;
|
||||
var page = 1;
|
||||
var hash_arr = getHashArr();
|
||||
$.each(hash_arr,function(index, itemobj){
|
||||
var item_arr = itemobj.split("=");
|
||||
if(item_arr.length == 2){
|
||||
switch(item_arr[0]){
|
||||
case "page":
|
||||
page = item_arr[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
laypage.render({
|
||||
elem: 'list_page',
|
||||
count: _this.listCount,
|
||||
limit: _this.limit,
|
||||
limits: _this.limits,
|
||||
layout: ns.get_page_param(),
|
||||
curr: page, //获取起始页
|
||||
jump: function (obj, first) {
|
||||
_this.limit = obj.limit;
|
||||
if (!first) {
|
||||
_this.page = obj.curr;
|
||||
_this.getData({_this: _this, "rule_type": 'KEYWORDS'});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 事件操作
|
||||
* @param e 事件对象
|
||||
*/
|
||||
WxReplay.prototype.e = function (e) {
|
||||
try {
|
||||
//_this为replay对象 //_dom 为元素dom
|
||||
var _this = e.data._this;
|
||||
_this._dom = e.target;
|
||||
var eventFlg = _this.eventFlg;
|
||||
if (!eventFlg) return;
|
||||
_this.eventFlg = false;
|
||||
var _dom = e.target;
|
||||
var dataEvent = $(_dom).attr("nc-event");
|
||||
var dataAction = $(_dom).attr("nc-action");
|
||||
var type = e.type;
|
||||
if (dataEvent != type) {
|
||||
if ($(_dom).attr("nc-event2") != type) {
|
||||
_this.eventFlg = true;
|
||||
return;
|
||||
} else {
|
||||
dataEvent = $(_dom).attr("nc-event2");
|
||||
dataAction = $(_dom).attr("nc-action2");
|
||||
}
|
||||
}
|
||||
|
||||
var eventObj = null;
|
||||
switch (dataEvent) {
|
||||
case "click":
|
||||
eventObj = _this.clickEvent;
|
||||
break;
|
||||
case "mouseenter" :
|
||||
eventObj = _this.mouseenterEvent;
|
||||
break;
|
||||
case "mouseleave" :
|
||||
eventObj = _this.mouseleaveEvent;
|
||||
break;
|
||||
}
|
||||
if (eventObj) {
|
||||
|
||||
_this.evalFun(eventObj, dataAction, {"_this": _this});
|
||||
|
||||
_this.eventFlg = true;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
_this.eventFlg = true;
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 点击事件
|
||||
*/
|
||||
WxReplay.prototype.clickEvent = {
|
||||
click: function () {
|
||||
|
||||
},
|
||||
//添加一条回复
|
||||
addReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var reply_content = $(_dom).attr('reply_content');
|
||||
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "设置默认回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_reply").html(),
|
||||
success: function (layero) {
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("textarea[name='reply_content']").val("");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//编辑回复
|
||||
editReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var reply_content = $(_dom).attr('reply_content');
|
||||
var request_type = $(_dom).attr('type');
|
||||
$("#hidden_reply_type").val(request_type);
|
||||
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "修改默认回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_reply").html(),
|
||||
success: function (layero) {
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("input[name='key_id']").val(key_id);
|
||||
$(layero).find("textarea[name='reply_content']").val(reply_content);
|
||||
|
||||
$(".voice").css("display", "none");
|
||||
$(".voice").next("span").css("display", "none");
|
||||
|
||||
if (request_type == 'music') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="voice-wrapper" data-voice-src="' + reply_content + '">';
|
||||
active_pic += '<span class="voice-player">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<span class="stop">点击播放</span>';
|
||||
active_pic += '<span class="second"></span>';
|
||||
active_pic += '<i class="play" style="display:none;"></i>';
|
||||
active_pic += '</span>';
|
||||
active_pic += '</div>';
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
|
||||
} else if (request_type == 'other') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<a href="h" target="_blank" class="new-window" title="' + reply_content + '"><span class="label label-success">' + reply_content + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else if (request_type == 'articles') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">图 文</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="" target="_blank" class="new-window" title="rgrg">' + reply_content + '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else {
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//删除回复
|
||||
delReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr("data-key_id");
|
||||
var flag = true;
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "是否删除该条回复",
|
||||
offset: "auto",
|
||||
content: '删除后,关注该公众号的用户将不再接收该回复,确定删除?'
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
if (!flag) return;
|
||||
flag = false;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/deleteReply'),
|
||||
data: {"rule_id": rule_id, "key_id": key_id},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//音乐
|
||||
music: function (d) {
|
||||
$("#hidden_reply_type").val('music');
|
||||
$(".complex-backdrop").css("display", "none"); //清空文本框
|
||||
$("textarea[name='reply_content']").val("");
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '音乐素材',
|
||||
area: ['652px', "380px"],
|
||||
offset: "auto",
|
||||
content: $("#music"),
|
||||
success: function (layero) {
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* 移入事件
|
||||
*/
|
||||
|
||||
WxReplay.prototype.mouseenterEvent = {};
|
||||
|
||||
/**
|
||||
* 移出事件
|
||||
*/
|
||||
WxReplay.prototype.mouseleaveEvent = {};
|
||||
|
||||
/**
|
||||
* 执行传过来的方法
|
||||
* @param eventObj
|
||||
* @param funcName
|
||||
* @param d
|
||||
*/
|
||||
WxReplay.prototype.evalFun = function (eventObj, funcName, d = {}) {
|
||||
for (i in eventObj) {
|
||||
if (i == funcName) {
|
||||
eval(eventObj[i](d));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 元素操作 da(documentAction)
|
||||
*/
|
||||
WxReplay.prototype.aD = {
|
||||
|
||||
addReolayList: function (d) {
|
||||
var data = d.list;
|
||||
var html = '';
|
||||
if (data.length) {
|
||||
$.each(data, function (i) {
|
||||
var d = data[i];
|
||||
html += '<div class="rule-group layui-row" data-rule_id="' + d.rule_id + '">';
|
||||
html += '<div class="rule-meta bg-color-light-9">';
|
||||
html += '<h3><span class="rule-name">规则: 默认回复</span></h3>';
|
||||
html += '</div>';
|
||||
html += '<div class="rule-body">';
|
||||
html += '</div>';
|
||||
html += '<div class="rule-replies layui-col-md12">';
|
||||
html += '<div class="rule-inner">';
|
||||
// html += '<h4>自动回复: <span class="send-method"> </span></h4>';
|
||||
html += '<div class="reply-container">';
|
||||
|
||||
if (d.replay_list.length <= 0) {
|
||||
html += '<div class="info">还没有任何回复!</div>';
|
||||
} else {
|
||||
html += '<div class="info"></div>';
|
||||
}
|
||||
html += '<ol class="reply-list">';
|
||||
|
||||
if (d.replay_list.length > 0) {
|
||||
for (var j in d.replay_list) {
|
||||
|
||||
html += '<li>';//回复列表
|
||||
html += '<div class="reply-cont">';
|
||||
html += '<div class="reply-summary">';
|
||||
if (d.replay_list[j].type == 'text') {
|
||||
html += '<span class="label label-success">文本</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
} else if (d.replay_list[j].type == 'music') {
|
||||
html += '<div class="voice-wrapper" data-voice-src="' + d.replay_list[j].reply_content + '">';
|
||||
html += '<span class="voice-player">';
|
||||
html += '<span class="stop">点击播放</span>';
|
||||
html += '<span class="second" style="display: block;"></span>';
|
||||
html += '<i class="play" style="display:none;"></i>';
|
||||
html += '</span>';
|
||||
html += '</div>';
|
||||
} else if (d.replay_list[j].type == 'other') {
|
||||
html += '<span class="label label-success">' + d.replay_list[j].reply_content + '</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
} else if (d.replay_list[j].type == 'articles') {
|
||||
html += '<span class="label label-success">图文</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<div class="reply-opts">';
|
||||
var reply_content_to = d.replay_list[j].reply_content.replace(/"/g, "'");
|
||||
html += '<a class="js-edit-it js-replay" href="javascript:;" reply_content="' + reply_content_to + '" data-key_id="' + j + '" type="' + d.replay_list[j].type + '" nc-event="click" nc-action="editReply">编辑</a> - ';
|
||||
html += '<a class="js-delete-it js-replay delet-color" href="javascript:;" data-key_id="' + j + '" nc-event="click" nc-action="delReply">删除</a>';
|
||||
html += '</div>';
|
||||
html += '</li>';
|
||||
|
||||
}
|
||||
}
|
||||
html += '</ol>';
|
||||
html += '</div>';
|
||||
// html += '<hr class="dashed">';
|
||||
html += '<div class="opt">';
|
||||
if (d.replay_list.length < 1) {
|
||||
html += '<a class="js-add-reply add-reply-menu js-replay" href="javascript:;" nc-event="click" nc-action="addReply">设置回复</a>';
|
||||
} else {
|
||||
html += '<span class="disable-opt hide">最多一条回复</span>';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
});
|
||||
} else {
|
||||
html += '<div class="rule-group layui-row" data-rule_id="">';
|
||||
html += '<div class="rule-meta bg-color-light-9">';
|
||||
html += '<h3><span class="rule-name">规则: 默认回复</span></h3>';//title
|
||||
html += '</div>';
|
||||
html += '<div class="rule-body">';
|
||||
html += '</div>';
|
||||
html += '<div class="rule-replies layui-col-md12">';
|
||||
html += '<div class="rule-inner">';
|
||||
// html += '<h4>自动回复: <span class="send-method"> </span></h4>';
|
||||
html += '<div class="reply-container">';
|
||||
html += '<div class="info">还没有任何回复!</div>';
|
||||
html += '</div>';
|
||||
html += '<hr class="dashed">';
|
||||
html += '<div class="opt">';
|
||||
html += '<a class="js-add-reply add-reply-menu js-replay" href="javascript:;" nc-event="click" nc-action="addReply">设置回复</a>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
$("#load_rule_list").html(html);
|
||||
}
|
||||
};
|
||||
|
||||
WxReplay.prototype.sendAjax = function (param = {}) {
|
||||
var d = $.extend({
|
||||
"url": '',
|
||||
"type": "post",
|
||||
"data": {},
|
||||
"async": true,
|
||||
"success": ''
|
||||
}, param);
|
||||
try {
|
||||
$.ajax({
|
||||
url: d.url,
|
||||
type: d.type,
|
||||
data: d.data,
|
||||
async: d.async,
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (typeof (d.success) == "function") {
|
||||
d.success(res);
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
//其他
|
||||
$(".dropdown-menu li").click(function () {
|
||||
$("#hidden_reply_type").val('other');
|
||||
var title = $(this).text();
|
||||
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<a href="h" target="_blank" class="new-window" title="' + title + '"><span class="label label-success">' + title + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(title);
|
||||
});
|
||||
|
||||
//插入链接
|
||||
function hyperlink(d) {
|
||||
$("#hidden_reply_type").val('text');
|
||||
$(".complex-backdrop").css("display", "none"); //清空文本框
|
||||
// $("#add_reply").find("textarea[name='reply_content']").val("");
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
area: ['306px', "auto"],
|
||||
offset: "auto",
|
||||
content: $("#hyperlink").html(),
|
||||
success: function (layero) {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
476
addon/wechat/shop/view/public/js/wx_follow.js
Executable file
@@ -0,0 +1,476 @@
|
||||
WxReplay = function (limit = 0, limits = []) {
|
||||
var _this = this;
|
||||
_this._dom = null;
|
||||
_this.eventFlg = true;
|
||||
|
||||
_this.listCount = 0;
|
||||
_this.limit = limit == false ? 15 : limit;
|
||||
_this.limits = limit == false ? [15, 20, 50] : limits;
|
||||
_this.page = 1;
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取关注后回复列表
|
||||
*/
|
||||
WxReplay.prototype.getData = function (d) {
|
||||
var _this = d._this;
|
||||
var page = _this.page;
|
||||
var limit = _this.limit;
|
||||
var rule_type = d.rule_type;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/follow'),
|
||||
async: false,
|
||||
data: {"page": page, "limit": limit, "rule_type": rule_type},
|
||||
success: function (data) {
|
||||
_this.listCount = data.data.count;
|
||||
_this.aD.addReplayList(data.data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* layui分页
|
||||
*/
|
||||
WxReplay.prototype.pageInit = function (d) {
|
||||
var _this = d._this;
|
||||
layui.use('laypage', function () {
|
||||
var laypage = layui.laypage;
|
||||
var page = 1;
|
||||
var hash_arr = getHashArr();
|
||||
$.each(hash_arr,function(index, itemobj){
|
||||
var item_arr = itemobj.split("=");
|
||||
if(item_arr.length == 2){
|
||||
switch(item_arr[0]){
|
||||
case "page":
|
||||
page = item_arr[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
laypage.render({
|
||||
elem: 'list_page',
|
||||
count: _this.listCount,
|
||||
limit: _this.limit,
|
||||
limits: _this.limits,
|
||||
layout: ns.get_page_param(),
|
||||
curr: page,
|
||||
jump: function (obj, first) {
|
||||
_this.limit = obj.limit;
|
||||
if (!first) {
|
||||
_this.page = obj.curr;
|
||||
_this.getData({_this: _this, "rule_type": 'KEYWORDS'});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 事件操作
|
||||
* @param e 事件对象
|
||||
*/
|
||||
WxReplay.prototype.e = function (e) {
|
||||
try {
|
||||
//_this为replay对象 //_dom 为元素dom
|
||||
var _this = e.data._this;
|
||||
_this._dom = e.target;
|
||||
var eventFlg = _this.eventFlg;
|
||||
if (!eventFlg) return;
|
||||
_this.eventFlg = false;
|
||||
var _dom = e.target;
|
||||
var dataEvent = $(_dom).attr("nc-event");
|
||||
var dataAction = $(_dom).attr("nc-action");
|
||||
var type = e.type;
|
||||
if (dataEvent != type) {
|
||||
if ($(_dom).attr("nc-event2") != type) {
|
||||
_this.eventFlg = true;
|
||||
return;
|
||||
} else {
|
||||
dataEvent = $(_dom).attr("nc-event2");
|
||||
dataAction = $(_dom).attr("nc-action2");
|
||||
}
|
||||
}
|
||||
|
||||
var eventObj = null;
|
||||
switch (dataEvent) {
|
||||
case "click":
|
||||
eventObj = _this.clickEvent;
|
||||
break;
|
||||
case "mouseenter" :
|
||||
eventObj = _this.mouseenterEvent;
|
||||
break;
|
||||
case "mouseleave" :
|
||||
eventObj = _this.mouseleaveEvent;
|
||||
break;
|
||||
}
|
||||
if (eventObj) {
|
||||
|
||||
_this.evalFun(eventObj, dataAction, {"_this": _this});
|
||||
|
||||
_this.eventFlg = true;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
_this.eventFlg = true;
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 点击事件
|
||||
*/
|
||||
WxReplay.prototype.clickEvent = {
|
||||
click: function () {
|
||||
|
||||
},
|
||||
|
||||
//添加一条回复
|
||||
addReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var reply_content = $(_dom).attr('reply_content');
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "设置自动回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_reply").html(),
|
||||
success: function (layero) {
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("textarea[name='reply_content']").val("");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//编辑回复
|
||||
editReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var reply_content = $(_dom).attr('reply_content');
|
||||
var request_type = $(_dom).attr('type');
|
||||
$("#hidden_reply_type").val(request_type);
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "修改自动回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_reply").html(),
|
||||
success: function (layero) {
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("input[name='key_id']").val(key_id);
|
||||
$(layero).find("textarea[name='reply_content']").val(reply_content);
|
||||
|
||||
$(".voice").css("display", "none");
|
||||
$(".voice").next("span").css("display", "none");
|
||||
|
||||
if (request_type == 'music') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="voice-wrapper" data-voice-src="' + reply_content + '">';
|
||||
active_pic += '<span class="voice-player">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<span class="stop">点击播放</span>';
|
||||
active_pic += '<span class="second"></span>';
|
||||
active_pic += '<i class="play" style="display:none;"></i>';
|
||||
active_pic += '</span>';
|
||||
active_pic += '</div>';
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
|
||||
} else if (request_type == 'other') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<a href="h" target="_blank" class="new-window" title="' + reply_content + '"><span class="label label-success">' + reply_content + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else if (request_type == 'articles') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">图 文</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="" target="_blank" class="new-window" title="rgrg">' + reply_content + '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else {
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//删除回复
|
||||
delReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr("data-key_id");
|
||||
var flag = true;
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "是否删除该条回复",
|
||||
offset: "auto",
|
||||
content: '删除后,关注该公众号的用户将不再接收该回复,确定删除?'
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
if (!flag) return;
|
||||
flag = false;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/deleteReply'),
|
||||
data: {"rule_id": rule_id, "key_id": key_id},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//音乐
|
||||
music: function (d) {
|
||||
$("#hidden_reply_type").val('music');
|
||||
$(".complex-backdrop").css("display", "none"); //清空文本框
|
||||
$("#add_reply").find("textarea[name='reply_content']").val("");
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '音乐素材',
|
||||
area: ['652px', "380px"],
|
||||
offset: "auto",
|
||||
content: $("#music").html(),
|
||||
success: function (layero) {
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* 移入事件
|
||||
*/
|
||||
|
||||
WxReplay.prototype.mouseenterEvent = {};
|
||||
|
||||
/**
|
||||
* 移出事件
|
||||
*/
|
||||
WxReplay.prototype.mouseleaveEvent = {};
|
||||
|
||||
/**
|
||||
* 执行传过来的方法
|
||||
* @param eventObj
|
||||
* @param funcName
|
||||
* @param d
|
||||
*/
|
||||
WxReplay.prototype.evalFun = function (eventObj, funcName, d = {}) {
|
||||
for (i in eventObj) {
|
||||
if (i == funcName) {
|
||||
eval(eventObj[i](d));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 元素操作 da(documentAction)
|
||||
*/
|
||||
WxReplay.prototype.aD = {
|
||||
|
||||
addReplayList: function (d) {
|
||||
var data = d.list;
|
||||
var html = '';
|
||||
if (data.length) {
|
||||
$.each(data, function (i) {
|
||||
var d = data[i];
|
||||
html += '<div class="rule-group layui-row" data-rule_id="' + d.rule_id + '">';
|
||||
html += '<div class="rule-meta bg-color-light-9">';
|
||||
html += '<h3><span class="rule-name">规则: 关注后自动回复</span></h3>';//title
|
||||
html += '</div>';
|
||||
html += '<div class="rule-body">';
|
||||
html += '</div>';
|
||||
html += '<div class="rule-replies layui-col-md12">';
|
||||
html += '<div class="rule-inner">';
|
||||
// html += '<h4>自动回复: <span class="send-method"> </span></h4>';
|
||||
html += '<div class="reply-container">';
|
||||
|
||||
if (d.replay_list.length <= 0) {
|
||||
html += '<div class="info">还没有任何回复!</div>';
|
||||
} else {
|
||||
html += '<div class="info"></div>';
|
||||
}
|
||||
html += '<ol class="reply-list">';
|
||||
|
||||
if (d.replay_list.length > 0) {
|
||||
for (var j in d.replay_list) {
|
||||
|
||||
html += '<li>';//回复列表
|
||||
html += '<div class="reply-cont">';
|
||||
html += '<div class="reply-summary">';
|
||||
if (d.replay_list[j].type == 'text') {
|
||||
html += '<span class="label label-success">文本</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
} else if (d.replay_list[j].type == 'music') {
|
||||
html += '<div class="voice-wrapper" data-voice-src="' + d.replay_list[j].reply_content + '">';
|
||||
html += '<span class="voice-player">';
|
||||
html += '<span class="stop">点击播放</span>';
|
||||
html += '<span class="second" style="display: block;"></span>';
|
||||
html += '<i class="play" style="display:none;"></i>';
|
||||
html += '</span>';
|
||||
html += '</div>';
|
||||
} else if (d.replay_list[j].type == 'other') {
|
||||
html += '<span class="label label-success">' + d.replay_list[j].reply_content + '</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
} else if (d.replay_list[j].type == 'articles') {
|
||||
html += '<span class="label label-success">图文</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<div class="reply-opts">';
|
||||
var reply_content_to = d.replay_list[j].reply_content.replace(/"/g, "'");
|
||||
html += '<a class="js-edit-it js-replay" href="javascript:;" data-key_id="' + j + '" reply_content="' + reply_content_to + '" type="' + d.replay_list[j].type + '" nc-event="click" nc-action="editReply">编辑</a> - ';
|
||||
html += '<a class="js-delete-it js-replay" href="javascript:;" data-key_id="' + j + '" nc-event="click" nc-action="delReply">删除</a>';
|
||||
html += '</div>';
|
||||
html += '</li>';
|
||||
|
||||
}
|
||||
}
|
||||
html += '</ol>';
|
||||
html += '</div>';
|
||||
html += '<hr class="dashed">';
|
||||
html += '<div class="opt">';
|
||||
if (d.replay_list.length < 1) {
|
||||
html += '<a class="js-add-reply add-reply-menu js-replay" href="javascript:;" nc-event="click" nc-action="addReply">设置回复</a>';
|
||||
} else {
|
||||
html += '<span class="disable-opt hide">最多一条回复</span>';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
});
|
||||
} else {
|
||||
html += '<div class="rule-group layui-row" data-rule_id="">';
|
||||
html += '<div class="rule-meta bg-color-light-9">';
|
||||
html += '<h3><span class="rule-name">规则: 关注后自动回复</span></h3>';//title
|
||||
html += '</div>';
|
||||
html += '<div class="rule-body">';
|
||||
html += '</div>';
|
||||
html += '<div class="rule-replies layui-col-md12">';
|
||||
html += '<div class="rule-inner">';
|
||||
// html += '<h4>自动回复: <span class="send-method"> </span></h4>';
|
||||
html += '<div class="reply-container">';
|
||||
html += '<div class="info">还没有任何回复!</div>';
|
||||
html += '</div>';
|
||||
html += '<hr class="dashed">';
|
||||
html += '<div class="opt">';
|
||||
html += '<a class="js-add-reply add-reply-menu js-replay" href="javascript:;" nc-event="click" nc-action="addReply">设置回复</a>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
$("#load_rule_list").html(html);
|
||||
}
|
||||
};
|
||||
|
||||
WxReplay.prototype.sendAjax = function (param = {}) {
|
||||
var d = $.extend({
|
||||
"url": '',
|
||||
"type": "post",
|
||||
"data": {},
|
||||
"async": true,
|
||||
"success": ''
|
||||
}, param);
|
||||
try {
|
||||
$.ajax({
|
||||
url: d.url,
|
||||
type: d.type,
|
||||
data: d.data,
|
||||
async: d.async,
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (typeof (d.success) == "function") {
|
||||
d.success(res);
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
//其他
|
||||
$(".dropdown-menu li").click(function () {
|
||||
$("#hidden_reply_type").val('other');
|
||||
var title = $(this).text();
|
||||
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<a href="h" target="_blank" class="new-window" title="' + title + '"><span class="label label-success">' + title + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(title);
|
||||
|
||||
});
|
||||
|
||||
|
||||
//插入链接
|
||||
function hyperlink(d) {
|
||||
$("#hidden_reply_type").val('text');
|
||||
$(".complex-backdrop").css("display", "none"); //清空文本框
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
area: ['306px', "auto"],
|
||||
offset: "auto",
|
||||
content: $("#hyperlink").html(),
|
||||
success: function (layero) {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
417
addon/wechat/shop/view/public/js/wx_graphic_message.js
Executable file
@@ -0,0 +1,417 @@
|
||||
var vue_obj;
|
||||
var repeat_flag = false;//防重复标识
|
||||
$(function () {
|
||||
|
||||
initVue();
|
||||
if ($('#edit_flag').val()) {
|
||||
setTimeout(function () {
|
||||
vue_obj.loadGraphicMessageInfo();
|
||||
}, 20);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// 初始化Vue
|
||||
function initVue() {
|
||||
// 挂载父组件
|
||||
vue_obj = new Vue({
|
||||
el: '#graphic_message', // 挂载点标识
|
||||
data: { // 数据
|
||||
article_item_list: [
|
||||
{
|
||||
msg_type: 1, // 消息类型
|
||||
title: '', // 标题
|
||||
autor: '', // 作者
|
||||
content: '', // 内容
|
||||
url: '', // 原文链接
|
||||
show_cover_pic: 0, // 正文是否显示封面图
|
||||
cover: {
|
||||
path: '', // 封面路径
|
||||
media_id: '' // 封面media_id
|
||||
},
|
||||
digest: '', // 摘要
|
||||
},
|
||||
],
|
||||
edit_mask_list: [
|
||||
{
|
||||
is_show: false, // 是否显示列表修改菜单 ---对应图文消息列表
|
||||
}
|
||||
],
|
||||
max_item_list: 8,
|
||||
current_msg_index: 0, // 当前选中消息下标
|
||||
material_id: 0, // 当前图文消息ID
|
||||
inputTitle: '',
|
||||
inputAutor: '',
|
||||
inputOriginalUrl: '',
|
||||
checkShowCoverPic: 0,
|
||||
coverImg: '',
|
||||
editBoxTopPosition: 80,
|
||||
move_index: -1,
|
||||
loading: false,
|
||||
editor: null
|
||||
},
|
||||
watch: {
|
||||
//输入标题
|
||||
inputTitle: function (val) {
|
||||
this.article_item_list[this.current_msg_index].title = val;
|
||||
},
|
||||
//输入作者
|
||||
inputAutor: function (val) {
|
||||
this.article_item_list[this.current_msg_index].autor = val;
|
||||
},
|
||||
// 输入原文链接
|
||||
inputOriginalUrl: function (val) {
|
||||
this.article_item_list[this.current_msg_index].url = val;
|
||||
},
|
||||
// 正文是否显示封面图
|
||||
checkShowCoverPic: function (val) {
|
||||
this.article_item_list[this.current_msg_index].show_cover_pic = val;
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
var _self = this;
|
||||
_self.material_id = $('#material_id').val();
|
||||
_self.editor = UE.getEditor('editor');
|
||||
if(_self.material_id == 0){
|
||||
_self.reloadUpload();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 添加图文消息
|
||||
addGraphicMessage: function (e) {
|
||||
getContent();
|
||||
var article_item_list = this.article_item_list;
|
||||
if (article_item_list.length > 7) {
|
||||
layer.msg('多图文消息内容不可超过8个');
|
||||
return false;
|
||||
}
|
||||
|
||||
var new_item_msg = {
|
||||
msg_type: 1, // 消息类型
|
||||
title: '', // 标题
|
||||
autor: '', // 作者
|
||||
content: '', // 内容
|
||||
url: '', // 原文链接
|
||||
show_cover_pic: 0, // 正文是否显示封面
|
||||
cover: {
|
||||
path: '', // 封面路径
|
||||
media_id: '' // 封面media_id
|
||||
},
|
||||
digest: '', // 摘要
|
||||
};
|
||||
var new_edit_mask = {
|
||||
is_show: false
|
||||
};
|
||||
// 添加新图文消息
|
||||
this.article_item_list.push(new_item_msg);
|
||||
this.edit_mask_list.push(new_edit_mask);
|
||||
// 初始化新图文消息
|
||||
this.editor.setContent('');
|
||||
this.current_msg_index = article_item_list.length - 1;// 更新当前选中消息
|
||||
this.inputTitle = '';// 初始化输入标题
|
||||
this.inputAutor = '';// 初始化输入作者
|
||||
this.checkShowCoverPic = '';
|
||||
this.inputOriginalUrl = '';
|
||||
this.coverImg = '';
|
||||
var _num = article_item_list.length - 1;
|
||||
var _top = 250;
|
||||
_top = _num == 0 ? 80 : _top;
|
||||
_num = _num > 0 ? _num - 1 : _num;
|
||||
this.editBoxTopPosition = 72 * _num + _top;
|
||||
|
||||
setTimeout(()=>{
|
||||
this.reloadUpload();
|
||||
},600)
|
||||
},
|
||||
// 选择编辑中图文消息
|
||||
chooseGraphicMessage: function (index) {
|
||||
getContent();
|
||||
var article = this.article_item_list[index];
|
||||
this.current_msg_index = index;
|
||||
this.inputTitle = article.title; // 初始化输入标题
|
||||
this.inputAutor = article.autor; // 初始化输入作者
|
||||
this.editor.setContent(article.content); // 初始化ueditor输入
|
||||
this.checkShowCoverPic = article.show_cover_pic;
|
||||
this.inputOriginalUrl = article.url;
|
||||
this.coverImg = article.cover.path;
|
||||
var _num = index;
|
||||
var _top = 250;
|
||||
_top = _num == 0 ? 80 : _top;
|
||||
_num = _num > 0 ? _num - 1 : _num;
|
||||
this.editBoxTopPosition = 72 * _num + _top;
|
||||
|
||||
setTimeout(()=>{
|
||||
this.reloadUpload();
|
||||
},600)
|
||||
},
|
||||
//鼠标经过
|
||||
moveThis: function (index) {
|
||||
this.move_index = index;
|
||||
},
|
||||
leaveThis: function (index) {
|
||||
this.move_index = -1;
|
||||
},
|
||||
// 加载当前图文消息
|
||||
loadGraphicMessageInfo: function () {
|
||||
var _self = this;
|
||||
var id = _self.material_id;
|
||||
_self.loading = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url("wechat://shop/material/getMaterialInfo"),
|
||||
data: {id},
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
data = data.data;
|
||||
if (data.value != null && data.id > 0) {
|
||||
//延时渲染
|
||||
var count_timer = 0;
|
||||
var timer = setInterval(function () {
|
||||
try {
|
||||
// 初始化
|
||||
_self.article_item_list = new Array();
|
||||
_self.edit_mask_list = new Array();
|
||||
// 循环赋值
|
||||
count_timer++;
|
||||
if (count_timer > 5) {
|
||||
clearInterval(timer);
|
||||
layer.msg('加载失败');
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var index in data.value) {
|
||||
var msg = data.value[index];
|
||||
|
||||
var new_item_msg = {
|
||||
msg_type: 1, // 消息类型
|
||||
title: msg.title, // 标题
|
||||
autor: msg.autor, // 作者
|
||||
content: msg.content, // 内容
|
||||
url: msg.url,
|
||||
cover: msg.cover, // 封面
|
||||
show_cover_pic: msg.show_cover_pic, // 正文是否显示封面
|
||||
digest: msg.digest, // 摘要
|
||||
};
|
||||
var new_edit_mask = {
|
||||
is_show: false
|
||||
};
|
||||
// 添加新图文消息
|
||||
_self.article_item_list.push(new_item_msg);
|
||||
_self.edit_mask_list.push(new_edit_mask);
|
||||
// 初始化新图文消息
|
||||
_self.current_msg_index = 0; // 更新当前选中消息
|
||||
|
||||
if (index == 0) {
|
||||
_self.inputTitle = msg.title; // 初始化输入标题
|
||||
_self.inputAutor = msg.autor; // 初始化输入作者
|
||||
_self.editor.setContent(msg.content); // 初始化ueditor输入
|
||||
_self.checkShowCoverPic = msg.show_cover_pic;
|
||||
_self.inputOriginalUrl = msg.url;
|
||||
_self.inputDigest = msg.digest;
|
||||
_self.coverImg = msg.cover.path;
|
||||
_self.loading = false;
|
||||
}
|
||||
}
|
||||
clearInterval(timer);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.msg('加载失败');
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 修改当前图文消息
|
||||
editGraphicMessage: function () {
|
||||
getContent();
|
||||
|
||||
var _self = this;
|
||||
if (!_self.verification(_self)) return;
|
||||
|
||||
var id = _self.material_id;
|
||||
var article_item_list = JSON.parse(JSON.stringify(_self.article_item_list));
|
||||
article_item_list[0].cover.path = $("#logo").val();
|
||||
var value = JSON.stringify(article_item_list);
|
||||
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/edit'),
|
||||
data: {id, value},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code == 0) {
|
||||
location.hash = ns.hash('wechat://shop/material/lists');
|
||||
} else {
|
||||
repeat_flag = false;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 保存图文消息
|
||||
saveGraphicMessage: function (e) {
|
||||
getContent();
|
||||
|
||||
var _self = this;
|
||||
if (!_self.verification(_self)) return;
|
||||
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
var article_item_list = JSON.parse(JSON.stringify(_self.article_item_list));
|
||||
var value = JSON.stringify(article_item_list);
|
||||
|
||||
var type = 1;
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: ns.url('wechat://shop/material/add'),
|
||||
data: {type, value},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (res.code == 0) {
|
||||
//_self.material_id = res.data;
|
||||
location.hash = ns.hash('wechat://shop/material/lists');
|
||||
} else {
|
||||
repeat_flag = false;
|
||||
}
|
||||
layer.msg(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 添加封面图
|
||||
addCover: function (e) {
|
||||
// uploadAlbumalbum_contain();
|
||||
},
|
||||
// 删除图文消息
|
||||
deleteGraphicMessage: function (_index) {
|
||||
var _self = this;
|
||||
layer.confirm(
|
||||
'确认删除?',
|
||||
{
|
||||
btn: ['确认', '取消'], //可以无限个按钮
|
||||
},
|
||||
function (index, layero) {
|
||||
if (_index == _self.article_item_list.length - 1) {
|
||||
_self.chooseGraphicMessage(_index - 1);
|
||||
} else {
|
||||
if (_self.current_msg_index != 0) {
|
||||
var _num = _self.current_msg_index - 1;
|
||||
var _top = 250;
|
||||
_top = _num == 0 ? 80 : _top;
|
||||
_num = _num > 0 ? _num - 1 : _num;
|
||||
_self.editBoxTopPosition = 72 * _num + _top;
|
||||
}
|
||||
_self.current_msg_index = _self.current_msg_index - 1;
|
||||
}
|
||||
_self.article_item_list.splice(_index, 1);
|
||||
layer.close(index);
|
||||
},
|
||||
function (index) {
|
||||
layer.close(index);
|
||||
}
|
||||
);
|
||||
},
|
||||
//验证
|
||||
verification: function (_self) {
|
||||
var article_item_list = _self.article_item_list;
|
||||
var falg = true;
|
||||
var hint_type = '';
|
||||
|
||||
for (var index in article_item_list) {
|
||||
var article = article_item_list[index];
|
||||
|
||||
if (article.title == '' && falg) {
|
||||
layer.msg('标题不可为空 !');
|
||||
hint_type = 'title';
|
||||
falg = false;
|
||||
}
|
||||
|
||||
if (article.cover.path == '' && falg) {
|
||||
layer.msg('封面图片不可为空 !');
|
||||
hint_type = 'cover';
|
||||
falg = false;
|
||||
}
|
||||
|
||||
if ((article.content == '' || article.content == '<p><span style="color:#A7A7Ab;">从这里开始输入正文</span></p>') && falg) {
|
||||
layer.msg('正文不可为空 !');
|
||||
hint_type = 'content';
|
||||
falg = false;
|
||||
}
|
||||
|
||||
if (article.url != '' && (article.url.indexOf('http://') != 0 && article.url.indexOf('https://') != 0) && falg) {
|
||||
layer.msg('原文链接无效,请输入http:// 或 https://为前缀的有效地址 !');
|
||||
hint_type = 'url';
|
||||
falg = false;
|
||||
}
|
||||
|
||||
if (article.digest == '' && falg) {
|
||||
var content = article.content.replace(/<\/?.+?>/g, "");
|
||||
content = content.replace(/ /g, "");
|
||||
content = content.replace(" ", " ");
|
||||
content = content.replace("'", "'");
|
||||
content = content.substr(0, 64);
|
||||
|
||||
_self.article_item_list[index].digest = content;
|
||||
}
|
||||
|
||||
if (!falg) {
|
||||
_self.chooseGraphicMessage(index);
|
||||
|
||||
if (hint_type == 'title') {
|
||||
$('#input_title').focus();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
reloadUpload: function () {
|
||||
var upload = new Upload({
|
||||
elem: '#uploadImg',
|
||||
callback:function (res) {
|
||||
if (res.code >= 0) {
|
||||
//成功之后将图片的路径存放再隐藏域中,便于提交使用
|
||||
// $("input[name='web_qrcode']").val(res.data.pic_path);
|
||||
vue_obj.coverImg = ns.img(res.data.pic_path);
|
||||
vue_obj.article_item_list[vue_obj.current_msg_index].cover.path = ns.img(res.data.pic_path);
|
||||
//将图片展示在页面上
|
||||
// $("#webQrcodeUpload").html("<img src=" + ns.img(res.data.pic_path) + " >");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 相册选择图片回调
|
||||
* @param data
|
||||
* @param name
|
||||
*/
|
||||
function albumUploadSuccess(data, name) {
|
||||
if (data.length != undefined && data.length > 0) {
|
||||
if (data.length > 1) {
|
||||
layer.msg('封面图只可选择一张');
|
||||
}
|
||||
path = ns.img(data[0].path);
|
||||
var article_item_list = vue_obj.article_item_list;
|
||||
var index = vue_obj.current_msg_index;
|
||||
article_item_list[index].cover.path = path;
|
||||
vue_obj.article_item_list = article_item_list;
|
||||
vue_obj.coverImg = path;
|
||||
} else {
|
||||
layer.msg('图片添加失败');
|
||||
}
|
||||
}
|
||||
|
||||
//获取富文本内容
|
||||
function getContent(){
|
||||
vue_obj.article_item_list[vue_obj.current_msg_index].content = vue_obj.editor.getContent();
|
||||
}
|
||||
128
addon/wechat/shop/view/public/js/wx_material.js
Executable file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* 素材列表
|
||||
*/
|
||||
layui.use(['form', 'table', 'element'], function() {
|
||||
var form = layui.form,
|
||||
element = layui.element;
|
||||
|
||||
form.render();
|
||||
|
||||
element.on('tab(list_tab)', function() {
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: {
|
||||
'type': this.getAttribute('lay-id')
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var table = new Table({
|
||||
elem: '#graphic_message_list',
|
||||
filter: "graphic_message",
|
||||
url: ns.url('wechat://shop/material/lists'),
|
||||
cols: [[
|
||||
{
|
||||
field: 'value',
|
||||
width: '30%',
|
||||
title: '标题',
|
||||
align: 'center',
|
||||
templet: '#title',
|
||||
unresize : 'true'
|
||||
},
|
||||
{
|
||||
field: 'create_time',
|
||||
width: '30%',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
templet: '#create_time',
|
||||
unresize : 'true'
|
||||
},
|
||||
{
|
||||
field: 'update_time',
|
||||
width: '25%',
|
||||
title: '更新时间',
|
||||
align: 'center',
|
||||
templet: '#update_time',
|
||||
unresize : 'true'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '15%',
|
||||
toolbar: '#operation',
|
||||
unresize : 'true',
|
||||
align:'right'
|
||||
}
|
||||
]]
|
||||
});
|
||||
//监听工具条
|
||||
table.tool(function(obj) {
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case "edit":
|
||||
if(data.type == 1){
|
||||
location.hash = ns.hash('wechat://shop/material/edit', {"id": data.id});
|
||||
}else{
|
||||
location.hash = ns.hash('wechat://shop/material/edittextmaterial', {"id": data.id});
|
||||
}
|
||||
break;
|
||||
case "delete":
|
||||
delMaterial(data.id, 1, data.media_id);
|
||||
break;
|
||||
}
|
||||
});
|
||||
/**
|
||||
* 删除素材
|
||||
*/
|
||||
function delMaterial(id, type, media_id) {
|
||||
layer.confirm(
|
||||
'确认删除?', {
|
||||
btn: ['确认', '取消'],
|
||||
},
|
||||
function(index, layero) {
|
||||
$.ajax({
|
||||
url: ns.url('wechat://shop/material/delete'),
|
||||
data: {
|
||||
id,
|
||||
media_id
|
||||
},
|
||||
dataType: "JSON",
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code == 0) {
|
||||
table.reload()
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
},
|
||||
function(index) {
|
||||
layer.close(index);
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 图文消息预览
|
||||
*/
|
||||
function preview(id, index = 0) {
|
||||
var url = ns.href('wechat://shop/material/previewgraphicmessage', {
|
||||
"id": id,
|
||||
"i": index
|
||||
});
|
||||
window.open(url);
|
||||
}
|
||||
|
||||
function previewtext(id, index = 0) {
|
||||
var url = ns.href('wechat://shop/material/previewtextmessage', {
|
||||
"id": id,
|
||||
"i": index
|
||||
});
|
||||
window.open(url);
|
||||
}
|
||||
|
||||
265
addon/wechat/shop/view/public/js/wx_material_mannager.js
Executable file
@@ -0,0 +1,265 @@
|
||||
var layer_index = '';
|
||||
var add_layer_index = '';
|
||||
var limit = 15;
|
||||
var laytpl;
|
||||
var laypage;
|
||||
var repeat_flag = false;//防重复标识
|
||||
|
||||
function chooseMaterial(type) {
|
||||
loadMaterialList(type);
|
||||
var content_id = $('#marterial_graphic_message');
|
||||
if (type == 1) {
|
||||
content_id = $('#marterial_graphic_message');
|
||||
} else if (type == 2) {
|
||||
content_id = $('#material_image');
|
||||
} else if (type == 5) {
|
||||
content_id = $('#material_text');
|
||||
}
|
||||
layer_index = layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
// shade: [0],
|
||||
area: ['800px', '450px'],
|
||||
content: content_id,
|
||||
success: function (layero, index) {
|
||||
var mask = $(".layui-layer-shade");
|
||||
mask.appendTo(layero.parent());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 素材列表
|
||||
*/
|
||||
function loadMaterialList(type) {
|
||||
if (type == 1) {
|
||||
var table = new Table({
|
||||
elem: '#marterial_graphic_message_list',
|
||||
filter: "marterial_graphic_message",
|
||||
// width: '780',
|
||||
url: ns.url("wechat://shop/material/lists"),
|
||||
where: {type: 1, limit},
|
||||
cols: [[
|
||||
{
|
||||
field: 'value',
|
||||
width: '35%',
|
||||
title: '标题',
|
||||
align: 'center',
|
||||
templet: '#graphic_message_title'
|
||||
},
|
||||
{
|
||||
field: 'create_time',
|
||||
width: '25%',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
templet: '#create_time'
|
||||
},
|
||||
{
|
||||
field: 'update_time',
|
||||
width: '20%',
|
||||
title: '更新时间',
|
||||
align: 'center',
|
||||
templet: '#update_time'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '20%',
|
||||
toolbar: '#operation',
|
||||
align:'right'
|
||||
}
|
||||
]]
|
||||
});
|
||||
|
||||
//监听工具条
|
||||
table.tool(function (obj) {
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case "choose":
|
||||
try{
|
||||
parent.chooseGraphicMessage(data);
|
||||
}catch(e){
|
||||
console.error("chooseGraphicMessage()");
|
||||
}
|
||||
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
|
||||
parent.layer.close(index);
|
||||
// chooseGraphicMessage(data);
|
||||
// layer.close(layer_index);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}else if (type == 5) {
|
||||
var table = new Table({
|
||||
elem: '#material_text_list',
|
||||
filter: "material_text",
|
||||
// width: '780',
|
||||
url: ns.url("wechat://shop/material/lists"),
|
||||
where: {type: 5},
|
||||
cols: [[
|
||||
{
|
||||
field: 'value',
|
||||
width: '40%',
|
||||
title: '内容',
|
||||
align: 'center',
|
||||
templet: '#text_content'
|
||||
},
|
||||
{
|
||||
field: 'create_time',
|
||||
width: '25%',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
templet: '#create_time'
|
||||
},
|
||||
{
|
||||
field: 'update_time',
|
||||
width: '25%',
|
||||
title: '更新时间',
|
||||
align: 'center',
|
||||
templet: '#update_time'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '10%',
|
||||
toolbar: '#operation',
|
||||
align:'right'
|
||||
}
|
||||
]]
|
||||
});
|
||||
|
||||
//监听工具条
|
||||
table.tool(function (obj) {
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case "choose":
|
||||
try{
|
||||
parent.chooseTextMessage(data);
|
||||
|
||||
}catch(e){
|
||||
console.error("chooseTextMessage()");
|
||||
}
|
||||
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
|
||||
parent.layer.close(index);
|
||||
//
|
||||
// chooseTextMessage(data);
|
||||
// layer.close(layer_index);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 图文消息预览
|
||||
*/
|
||||
function preview(id, index = 0) {
|
||||
var parme = {"id": id, "i": index};
|
||||
var url = ns.url("wechat://shop/material/previewgraphicmessage", {id: id, i: index});
|
||||
window.open(url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文本消息预览
|
||||
*/
|
||||
function previewTexts(event, media_id, index, subIndex = "") {
|
||||
var content = $(".text-message-content .title>a").html();
|
||||
var html = "";
|
||||
html += "<div><textarea id='text_content' class='text-r'>"+ content +"</textarea></div>";
|
||||
layer_index = layer.open({
|
||||
type: 1,
|
||||
closeBtn: 0, //不显示关闭按钮
|
||||
anim: 2,
|
||||
area: ['380px', '230px'],
|
||||
shadeClose: true, //开启遮罩关闭
|
||||
btn: ['确定', '取消'],
|
||||
title : "文本信息",
|
||||
content: html,
|
||||
yes:function(){
|
||||
var text_r = $(".text-r").val();
|
||||
$(".text-message-content .title>a").html(text_r);
|
||||
if(subIndex >= 0){
|
||||
menu.button[index].sub_button[subIndex]['text'] = text_r;
|
||||
}else{
|
||||
menu.button[index]['text'] = text_r;
|
||||
}
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/editTextMaterial'),
|
||||
data: {media_id: media_id, content : text_r},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
}
|
||||
});
|
||||
|
||||
layer.close(layer_index);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function previewText(content) {
|
||||
layer.open({
|
||||
title: '文本内容',
|
||||
content: content
|
||||
})
|
||||
}
|
||||
|
||||
function addMaterial(type) {
|
||||
addMaterialForm(type);
|
||||
var content_id = $('#add_material_text');
|
||||
|
||||
add_layer_index = layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
// shade: [0],
|
||||
area: ['800px', '646px'],
|
||||
content: content_id,
|
||||
success: function (layero, index) {
|
||||
var mask = $(".layui-layer-shade");
|
||||
mask.appendTo(layero.parent());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addMaterialForm(type) {
|
||||
if (type == 5) {
|
||||
layui.use('form', function () {
|
||||
var form = layui.form;
|
||||
|
||||
$('#material_text_content').on('input', function (e) {
|
||||
var num = e.target.value.length;
|
||||
num = 300 - parseInt(num);
|
||||
$('#add_material_text .input-text-hint').html('剩余' + num);
|
||||
});
|
||||
form.verify({
|
||||
'material_text_content': function (value, item) {
|
||||
if (value == '' || value == undefined) {
|
||||
return '文本内容不可为空';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
form.on('submit(addText)', function (data) {
|
||||
var value = JSON.stringify(data.field);
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/addTextMaterial'),
|
||||
data: {type: 5, value},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
repeat_flag = false;
|
||||
if (res.code == 0) {
|
||||
layer.close(add_layer_index);
|
||||
var _data = {
|
||||
id: res.data,
|
||||
value: data.field
|
||||
};
|
||||
typeof chooseTextMessage == 'function' && chooseTextMessage(_data)
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
752
addon/wechat/shop/view/public/js/wx_menu.js
Executable file
@@ -0,0 +1,752 @@
|
||||
var loading_index;
|
||||
var menu = new Vue({
|
||||
el: '#menu',
|
||||
data: {
|
||||
button: [],
|
||||
menuIndex: [-1, -1],// 分别是一二级菜单的index
|
||||
menuObj: {}, // 当前选择的菜单 对应的值
|
||||
subMenuPlusShow: true,// 二级菜单 添加按钮显示
|
||||
name: '',
|
||||
type: 'media',
|
||||
key: '',
|
||||
url: '',
|
||||
media_type: '',
|
||||
media_id: '',
|
||||
appid: '',
|
||||
pagepath: '',
|
||||
error_hint: '',
|
||||
picurl: '',
|
||||
text: '',
|
||||
graphic_message: [],
|
||||
position_x: '',
|
||||
position_y: '',
|
||||
change_active: true,
|
||||
},
|
||||
watch: {
|
||||
name: function (v, ov) {
|
||||
this.setValue('name', v);
|
||||
},
|
||||
type: function (v, ov) {
|
||||
if (ov == 'media') {
|
||||
this.setValue('media_type', 'text');
|
||||
this.media_type = 'text';
|
||||
}
|
||||
this.setValue('type', v);
|
||||
},
|
||||
key: function (v, ov) {
|
||||
this.setValue('key', v);
|
||||
},
|
||||
url: function (v, ov) {
|
||||
this.setValue('url', v);
|
||||
},
|
||||
media_id: function (v, ov) {
|
||||
this.setValue('media_id', v);
|
||||
},
|
||||
appid: function (v, ov) {
|
||||
this.setValue('appid', v);
|
||||
},
|
||||
pagepath: function (v, ov) {
|
||||
this.setValue('pagepath', v);
|
||||
},
|
||||
text: function (v, ov) {
|
||||
this.setValue('text', v);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addMenu: function () {
|
||||
var _self = this;
|
||||
var menuItem = {
|
||||
'name': '菜单名称',
|
||||
};
|
||||
var length = _self.button.length;
|
||||
_self.name = '菜单名称';
|
||||
_self.button.push(menuItem);
|
||||
_self.chooseMenu(length, -1);
|
||||
_self.setValue('type', 'media');
|
||||
_self.setValue('media_type', 'text');
|
||||
_self.media_type = 'text';
|
||||
_self.type = 'media';
|
||||
|
||||
},
|
||||
addSubMenu: function (index) {
|
||||
var menuItem, subMenuItem;
|
||||
var _self = this;
|
||||
if (_self.button[index].sub_button != undefined && _self.button[index].sub_button.length >= 5) {
|
||||
layer.msg('每个一级菜单最多包含5个子菜单');
|
||||
return false;
|
||||
}
|
||||
if (_self.button[index].sub_button == undefined || _self.button[index].sub_button.length == 0) {
|
||||
menuItem = {
|
||||
'name': _self.button[index].name,
|
||||
'sub_button': []
|
||||
};
|
||||
_self.button[index] = menuItem;
|
||||
}
|
||||
subMenuItem = {
|
||||
'name': '子菜单名称'
|
||||
};
|
||||
this.name = '子菜单名称';
|
||||
var second_index = this.button[index].sub_button.length;
|
||||
var subMenuLength = second_index + 1;
|
||||
_self.button[index].sub_button.push(subMenuItem);
|
||||
_self.subMenuPlusShow = subMenuLength >= 5 ? false : true;
|
||||
_self.chooseMenu(index, second_index);
|
||||
_self.setValue('type', 'media');
|
||||
_self.setValue('media_type', 'text');
|
||||
_self.type = 'media';
|
||||
_self.media_type = 'text';
|
||||
delete _self.button[index].type;
|
||||
delete _self.button[index].url;
|
||||
delete _self.button[index].key;
|
||||
delete _self.button[index].media_id;
|
||||
delete _self.button[index].appid;
|
||||
delete _self.button[index].pagepath;
|
||||
delete _self.button[index].media_type;
|
||||
delete _self.button[index].picurl;
|
||||
delete _self.button[index].text;
|
||||
delete _self.button[index].graphic_message;
|
||||
},
|
||||
// 选择 菜单,first_index = 一级菜单 0-2; second_index = 二级菜单下标 0-4
|
||||
chooseMenu: function (first_index, second_index) {
|
||||
var _self = this;
|
||||
var change_active = _self.change_active;
|
||||
if (change_active === false) {
|
||||
_self.change_active = true;
|
||||
return false;
|
||||
}
|
||||
_self.menuIndex = [first_index, second_index];
|
||||
if (_self.button[first_index].sub_button != undefined) {
|
||||
_self.subMenuPlusShow = _self.button[first_index].sub_button.length >= 5 ? false : true;
|
||||
} else {
|
||||
_self.subMenuPlusShow = true;
|
||||
}
|
||||
_self.initMenuInfo();
|
||||
},
|
||||
// 删除菜单
|
||||
deleteMenu: function () {
|
||||
var _self = this;
|
||||
var first_index = _self.menuIndex[0];
|
||||
var second_index = _self.menuIndex[1];
|
||||
|
||||
layer.open({
|
||||
title: '删除确认',
|
||||
content: '确定删除菜单 "' + _self.name + '"?',
|
||||
btn: ['确认', '关闭'],
|
||||
btn1: function () {
|
||||
_self.delMenu(first_index, second_index);
|
||||
},
|
||||
success: function (layero, index) {
|
||||
this.enterEsc = function (event) {
|
||||
if (event.keyCode === 13) {
|
||||
_self.delMenu(first_index, second_index);
|
||||
layer.close(index);
|
||||
return false; // 阻止系统默认事件
|
||||
} else if (event.keyCode === 27) {
|
||||
layer.close(index);
|
||||
return false; // 阻止系统默认事件
|
||||
}
|
||||
};
|
||||
$(document).on('keydown', this.enterEsc); // 监听键盘事件,关闭层
|
||||
},
|
||||
end: function () {
|
||||
$(document).off('keydown', this.enterEsc); // 解除键盘关闭事件
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseMediaType: function (type) {
|
||||
var _self = this;
|
||||
var first_index = _self.menuIndex[0];
|
||||
var second_index = _self.menuIndex[1];
|
||||
switch (type) {
|
||||
case 1 :
|
||||
_self.setValue('media_type', 'graphic_message');
|
||||
_self.media_type = 'graphic_message';
|
||||
break;
|
||||
case 2 :
|
||||
_self.setValue('media_type', 'picture');
|
||||
_self.media_type = 'picture';
|
||||
break;
|
||||
case 3 :
|
||||
_self.setValue('media_type', 'audio');
|
||||
_self.media_type = 'audio';
|
||||
break;
|
||||
case 4 :
|
||||
_self.setValue('media_type', 'video');
|
||||
_self.media_type = 'video';
|
||||
break;
|
||||
case 5 :
|
||||
_self.setValue('media_type', 'text');
|
||||
_self.media_type = 'text';
|
||||
break;
|
||||
}
|
||||
},
|
||||
material: function (type) {
|
||||
switch (type) {
|
||||
case 1 :
|
||||
material(1);
|
||||
break;
|
||||
case 2 :
|
||||
material(2);
|
||||
break;
|
||||
case 3 :
|
||||
break;
|
||||
case 4 :
|
||||
break;
|
||||
case 5 :
|
||||
material(5);
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 添加素材
|
||||
addMaterial: function (type) {
|
||||
switch (type) {
|
||||
case 1 :
|
||||
window.open(ns.href("wechat://shop/material/add"));
|
||||
break;
|
||||
case 2 :
|
||||
uploadSingle();
|
||||
break;
|
||||
case 3 :
|
||||
break;
|
||||
case 4 :
|
||||
break;
|
||||
case 5 :
|
||||
addMaterial(5);
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 删除素材
|
||||
deleteMaterial: function (type) {
|
||||
var _self = this;
|
||||
switch (type) {
|
||||
case 1 :
|
||||
_self.setValue('media_id', '');
|
||||
_self.setValue('graphic_message', []);
|
||||
_self.graphic_message = [];
|
||||
break;
|
||||
case 2 :
|
||||
_self.setValue('media_id', '');
|
||||
_self.setValue('picurl', '');
|
||||
_self.picurl = '';
|
||||
break;
|
||||
case 3 :
|
||||
break;
|
||||
case 4 :
|
||||
break;
|
||||
case 5 :
|
||||
_self.setValue('media_id', '');
|
||||
_self.setValue('text', '');
|
||||
_self.text = '';
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 预览图文
|
||||
preview: function (id, index = 0) {
|
||||
preview(id, index);
|
||||
},
|
||||
// 预览文本
|
||||
previewText: function (text) {
|
||||
previewText(text);
|
||||
},
|
||||
// 预览文本
|
||||
previewTexts: function (text) {
|
||||
var index = this.menuIndex[0];
|
||||
var subIndex = this.menuIndex[1];
|
||||
if(subIndex >= 0){
|
||||
previewTexts(text, this.button[index].sub_button[subIndex]['media_id'], index, subIndex, 2);
|
||||
}else{
|
||||
previewTexts(text, this.button[index]['media_id'], index, subIndex, 1);
|
||||
}
|
||||
},
|
||||
setValue: function (menu_key, menu_value) {
|
||||
var index = this.menuIndex[0];
|
||||
var subIndex = this.menuIndex[1];
|
||||
if (subIndex >= 0) {
|
||||
this.button[index].sub_button[subIndex][menu_key] = menu_value;
|
||||
} else {
|
||||
this.button[index][menu_key] = menu_value;
|
||||
}
|
||||
},
|
||||
initMenuInfo: function () {
|
||||
var _self = this;
|
||||
var index = _self.menuIndex[0];
|
||||
var subIndex = _self.menuIndex[1];
|
||||
var info;
|
||||
if (subIndex >= 0) {
|
||||
info = _self.button[index].sub_button[subIndex];
|
||||
} else {
|
||||
info = _self.button[index];
|
||||
}
|
||||
|
||||
_self.name = info.name ? info.name : '';
|
||||
_self.type = info.type ? info.type : '';
|
||||
_self.key = info.key ? info.key : '';
|
||||
_self.url = info.url ? info.url : '';
|
||||
_self.media_type = info.media_type ? info.media_type : '';
|
||||
_self.media_id = info.media_id ? info.media_id : '';
|
||||
_self.appid = info.appid ? info.appid : '';
|
||||
_self.pagepath = info.pagepath ? info.pagepath : '';
|
||||
_self.picurl = info.picurl ? info.picurl : '';
|
||||
_self.text = info.text ? info.text : '';
|
||||
_self.graphic_message = info.graphic_message ? info.graphic_message : [];
|
||||
|
||||
},
|
||||
// 执行删除
|
||||
delMenu: function (first_index, second_index) {
|
||||
var _self = this;
|
||||
if (second_index == -1) {
|
||||
var length = _self.button.length;
|
||||
_self.button.splice(first_index, 1);
|
||||
if (length == 1) {
|
||||
this.menuIndex[0] = -1;
|
||||
}
|
||||
first_index = first_index == length - 1 ? first_index - 1 : first_index;
|
||||
length = length - 1 <= 0 ? -1 : length;
|
||||
} else {
|
||||
var length = _self.button[first_index].sub_button.length;
|
||||
_self.button[first_index].sub_button.splice(second_index, 1);
|
||||
second_index = second_index == length - 1 ? second_index - 1 : second_index;
|
||||
if (length == 1) {
|
||||
_self.button[first_index].media_type = 'text';
|
||||
_self.button[first_index].type = 'media';
|
||||
}
|
||||
}
|
||||
layer.msg('成功删除菜单 "' + _self.name + '"', {icon: 1});
|
||||
if (length != -1) _self.chooseMenu(first_index, second_index);
|
||||
},
|
||||
// 加载自定义菜单
|
||||
loadMenu: function () {
|
||||
var _self = this;
|
||||
$.ajax({
|
||||
//TODO 有的客户服务器在加载了html页面后再相同地址请求数据会无法识别为json请求,所以加个数据做区分就不会有问题
|
||||
url: ns.url('wechat://shop/menu/menu', {type:'json'}),
|
||||
data: {},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (res.code != 0) {
|
||||
layer.msg(res.message);
|
||||
}
|
||||
res = res.data;
|
||||
try {
|
||||
var data = {};
|
||||
if (res.value == '') return false;
|
||||
if (res.value.button == undefined || res.value.button == '' || res.value.button == null) {
|
||||
return false;
|
||||
}
|
||||
_self.button = res.value.button;
|
||||
_self.menuIndex[-1, -1];
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
layer.msg('加载失败');
|
||||
}
|
||||
})
|
||||
},
|
||||
// 保存自定义菜单
|
||||
saveMenu: function () {
|
||||
var _self = this;
|
||||
var value = {};
|
||||
var json_data = {};
|
||||
var button = JSON.parse(JSON.stringify(_self.button));
|
||||
|
||||
if (!_self.verification(button)[0]) {
|
||||
return;
|
||||
}
|
||||
var button_backup = JSON.parse(JSON.stringify(button));
|
||||
value.button = button;
|
||||
value = JSON.stringify(value);
|
||||
|
||||
json_data.button = _self.dataProcessing(button_backup);
|
||||
json_data = JSON.stringify(json_data);
|
||||
$.ajax({
|
||||
url: ns.url("wechat://shop/menu/edit"),
|
||||
data: {value, json_data},
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
},
|
||||
error: function (e) {
|
||||
layer.msg('保存失败');
|
||||
}
|
||||
})
|
||||
},
|
||||
// 输入名称验证
|
||||
checkName: function (e, type = '') {
|
||||
var _self = this;
|
||||
var str = e.target.value;
|
||||
_self.error_hint = '';
|
||||
|
||||
if (str == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == 'sub_button') {
|
||||
var res = /^[a-zA-Z-0-9]{1,16}$/.test((str + '').replace(/[\u4e00-\u9fa5]/g, 'aa'));
|
||||
if (!res) {
|
||||
layer.msg('菜单名称不可超过8个汉字或16个字母');
|
||||
_self.error_hint = 'name';
|
||||
_self.name = subStringLen(_self.name, 16);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
var res = /^[a-zA-Z-0-9]{1,8}$/.test((str + '').replace(/[\u4e00-\u9fa5]/g, 'aa'));
|
||||
if (!res) {
|
||||
layer.msg('菜单名称不可超过4个汉字或8个字母');
|
||||
_self.error_hint = 'name';
|
||||
_self.name = subStringLen(_self.name, 8);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
verification: function (button, _times = 0) {
|
||||
var _self = this;
|
||||
var _flag = true;
|
||||
var _index = -1;
|
||||
var _arr = [];
|
||||
for (var index in button) {
|
||||
var value = button[index];
|
||||
if (value.sub_button == undefined || value.sub_button == null || value.sub_button.length == 0) {
|
||||
|
||||
if (value.name == '' || value.name == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('请输入菜单名称');
|
||||
break;
|
||||
}
|
||||
|
||||
if (value.type == '' || value.type == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('请选择菜单内容');
|
||||
break;
|
||||
}
|
||||
|
||||
if (value.type == 'view') {
|
||||
delete value.key;
|
||||
delete value.appid;
|
||||
delete value.pagepath;
|
||||
delete value.media_type;
|
||||
delete value.media_id;
|
||||
delete value.picurl;
|
||||
delete value.graphic_message;
|
||||
delete value.text;
|
||||
if (value.url == '' || value.url == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('页面地址不可为空');
|
||||
break;
|
||||
}
|
||||
|
||||
if (value.url.indexOf('https://') != 0 && value.url.indexOf('http://') != 0) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('请输入 http:// 或 https:// 为前缀的有效地址');
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (value.type == 'miniprogram') {
|
||||
delete value.key;
|
||||
delete value.media_type;
|
||||
delete value.media_id;
|
||||
delete value.picurl;
|
||||
delete value.graphic_message;
|
||||
delete value.text;
|
||||
if (value.url == '' || value.url == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('备用网页不可为空');
|
||||
break;
|
||||
}
|
||||
|
||||
if (value.url.indexOf('https://') != 0 && value.url.indexOf('http://') != 0) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('请输入 http:// 或 https:// 为前缀的有效地址');
|
||||
break;
|
||||
}
|
||||
|
||||
if (value.appid == '' || value.appid == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('小程序appid不可为空');
|
||||
break;
|
||||
}
|
||||
|
||||
if (value.pagepath == '' || value.pagepath == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('小程序页面路径不可为空');
|
||||
break;
|
||||
}
|
||||
} else if (value.type == 'media') {
|
||||
delete value.key;
|
||||
delete value.appid;
|
||||
delete value.pagepath;
|
||||
delete value.url;
|
||||
if (value.media_type == 'graphic_message') {
|
||||
delete value.picurl;
|
||||
delete value.text;
|
||||
if (value.graphic_message == undefined || value.graphic_message[0] == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('图文消息不可为空');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (value.media_type == 'picture') {
|
||||
delete value.graphic_message;
|
||||
delete value.text;
|
||||
if (value.picurl == undefined || value.picurl == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('图片素材不可为空');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (value.media_type == 'text') {
|
||||
delete value.picurl;
|
||||
delete value.graphic_message;
|
||||
if (value.text == '' || value.text == undefined) {
|
||||
_flag = false;
|
||||
_index = index;
|
||||
layer.msg('文本素材不可为空');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_index = index;
|
||||
_arr = _self.verification(value.sub_button, 1);
|
||||
if (!_arr[0]) {
|
||||
_flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!_flag) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (_times == 0 && !_flag) {
|
||||
if (_arr[0] != undefined && !_arr[0]) {
|
||||
_flag = false;
|
||||
_self.chooseMenu(_index, _arr[1]);
|
||||
} else {
|
||||
_self.chooseMenu(_index, -1);
|
||||
}
|
||||
}
|
||||
|
||||
return [_flag, _index, button];
|
||||
},
|
||||
//media 事件 转换为 click 事件
|
||||
dataProcessing: function (buttons) {
|
||||
var _self = this;
|
||||
for (var first_index in buttons) {
|
||||
if (first_index == 'indexOfElem' || first_index == 'removeElem') {
|
||||
delete buttons[first_index];
|
||||
continue;
|
||||
}
|
||||
if (buttons[first_index].sub_button == undefined || buttons[first_index].sub_button == null || buttons[first_index].sub_button.length == 0) {
|
||||
delete buttons[first_index].sub_button;
|
||||
if (buttons[first_index].type == 'media') {
|
||||
delete buttons[first_index].media_type;
|
||||
delete buttons[first_index].picurl;
|
||||
delete buttons[first_index].text;
|
||||
delete buttons[first_index].graphic_message;
|
||||
buttons[first_index].type = 'click';
|
||||
buttons[first_index].key = buttons[first_index].media_id;
|
||||
delete buttons[first_index].media_id;
|
||||
}
|
||||
} else {
|
||||
for (var second_index in buttons[first_index].sub_button) {
|
||||
if (buttons[first_index].sub_button[second_index].type == 'media') {
|
||||
delete buttons[first_index].sub_button[second_index].media_type;
|
||||
delete buttons[first_index].sub_button[second_index].picurl;
|
||||
delete buttons[first_index].sub_button[second_index].text;
|
||||
delete buttons[first_index].sub_button[second_index].graphic_message;
|
||||
buttons[first_index].sub_button[second_index].type = 'click';
|
||||
buttons[first_index].sub_button[second_index].key = buttons[first_index].sub_button[second_index].media_id;
|
||||
delete buttons[first_index].sub_button[second_index].media_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return buttons;
|
||||
},
|
||||
// 菜单拖拽移动
|
||||
// dragMove(e, index){
|
||||
// var _self = this;
|
||||
// var button = _self.button;
|
||||
// var menuIndex = _self.menuIndex;
|
||||
//
|
||||
// var length = button.length;
|
||||
//
|
||||
// if (length != undefined && length > 1) {
|
||||
// var odiv = e.target;
|
||||
// var disX = e.clientX;
|
||||
// var ele = $('.wx-menu-item-box-' + index);
|
||||
// // var min = 0 - index * 93.67;
|
||||
// // var max = 0 + (length - index - 1) * 93.67;
|
||||
// ele.css({'left': 0, 'z-index': 0, 'opacity' : 1});
|
||||
// document.onmousemove = (e)=>{
|
||||
// var left = e.clientX - disX;
|
||||
// if (index == 0) {
|
||||
// if (left > 47 && left < 94) {
|
||||
// var new_item = button[index];
|
||||
// button[index] = button[index + 1];
|
||||
// button[index + 1] = new_item;
|
||||
// console.log(button);
|
||||
// console.log();
|
||||
// _self.button = button;
|
||||
// _self.menuIndex[0] = index + 1;
|
||||
// _self.initMenuInfo();
|
||||
// console.log(_self.button);
|
||||
// }
|
||||
// } else if (index == 1) {
|
||||
//
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
// ele.css({'left': left + 'px', 'z-index': 10});
|
||||
// if ((left > 5 || left < -5) && _self.change_active !== false) {
|
||||
// _self.change_active = false;
|
||||
// }
|
||||
// };
|
||||
// document.onmouseup = (e) => {
|
||||
// ele.css({'left': 0, 'z-index': 0, 'opacity' : 1});
|
||||
// document.onmousemove = null;
|
||||
// document.onmouseup = null;
|
||||
// };
|
||||
// }
|
||||
// },
|
||||
// // 子菜单拖拽移动
|
||||
// dragMoveItem(e, second_index){
|
||||
// var _self = this;
|
||||
// var button = _self.button;
|
||||
// var menuIndex = _self.menuIndex;
|
||||
// var index = menuIndex[0];
|
||||
// var length = button[index].sub_button.length;
|
||||
// // var min = 0 - second_index * 50;
|
||||
// // var max = 0 + (length - second_index - 1) * 50;
|
||||
// if (length != undefined && length > 1) {
|
||||
// var odiv = e.target;
|
||||
// var disY = e.clientY;
|
||||
// var ele = $('.wx-sub-menu-item-' + second_index);
|
||||
// ele.css({'top': 0, 'z-index': 0, 'opacity' : 1});
|
||||
// document.onmousemove = (e)=>{
|
||||
// var top = e.clientY - disY;
|
||||
// ele.css({'top': top, 'z-index': 10});
|
||||
// if ((top > 5 || top < -5) && _self.change_active !== false) {
|
||||
// _self.change_active = false;
|
||||
// }
|
||||
// };
|
||||
// document.onmouseup = (e) => {
|
||||
// ele.css({'top': 0, 'z-index': 0, 'opacity' : 1});
|
||||
// document.onmousemove = null;
|
||||
// document.onmouseup = null;
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
},
|
||||
});
|
||||
|
||||
$(function () {
|
||||
setTimeout(function () {
|
||||
menu.loadMenu();
|
||||
}, 50)
|
||||
});
|
||||
|
||||
/**
|
||||
* 单图上传回调
|
||||
*
|
||||
* @param _data
|
||||
* @param _name
|
||||
*/
|
||||
function singleImageUploadSuccess(_data, _name) {
|
||||
if (_data.path != undefined) {
|
||||
layer.closeAll('page');
|
||||
loading_index = layer.load(2, {time: 10 * 1000});
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ns.url('wechat://shop/material/add'),
|
||||
dataType: "JSON",
|
||||
data: {
|
||||
'type': 2,
|
||||
'path': _data.path,
|
||||
'title': _data.file_name
|
||||
},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
layer.close(loading_index);
|
||||
if (res.code == 0) {
|
||||
menu.setValue('media_id', 'MATERIAL_PICTURE_' + res.data);
|
||||
menu.setValue('picurl', ns.img(_data.path));
|
||||
menu.picurl = ns.img(_data.path);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片素材选择回调
|
||||
*/
|
||||
function materialPicCallBack(_data) {
|
||||
menu.setValue('media_id', 'MATERIAL_PICTURE_' + _data.file_id);
|
||||
menu.setValue('picurl', _data.path);
|
||||
menu.picurl = _data.path;
|
||||
}
|
||||
|
||||
/**
|
||||
* 图文选择回调
|
||||
* @param _data
|
||||
*/
|
||||
function chooseGraphicMessage(_data) {
|
||||
var graphic_message = new Array();
|
||||
for (var index in _data.value) {
|
||||
graphic_message[index] = {};
|
||||
graphic_message[index].title = _data.value[index].title;
|
||||
graphic_message[index].id = _data.id;
|
||||
}
|
||||
menu.setValue('media_id', 'MATERIAL_GRAPHIC_MESSAGE_' + _data.id);
|
||||
menu.setValue('graphic_message', graphic_message);
|
||||
menu.graphic_message = graphic_message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文本选择回调
|
||||
*/
|
||||
function chooseTextMessage(_data) {
|
||||
menu.setValue('media_id', 'MATERIAL_TEXT_MESSAGE_' + _data.id);
|
||||
menu.setValue('text', _data.value.content);
|
||||
menu.text = _data.value.content;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文本回调
|
||||
*/
|
||||
function textMessageAddSuccess(_data) {
|
||||
menu.setValue('media_id', 'MATERIAL_TEXT_MESSAGE_' + _data.id);
|
||||
menu.setValue('text', _data.value.content);
|
||||
menu.text = _data.value.content;
|
||||
}
|
||||
|
||||
function subStringLen(str, len) {
|
||||
var regexp = /[^\x00-\xff]/g;
|
||||
if (str.replace(regexp, "aa").length <= len) {
|
||||
return str;
|
||||
}
|
||||
var m = Math.floor(len / 2);
|
||||
for (var i = m, j = str.length; i < j; i++) {
|
||||
if (str.substring(0, i).replace(regexp, "aa").length >= len) {
|
||||
return str.substring(0, i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
139
addon/wechat/shop/view/public/js/wx_qrcode.js
Executable file
@@ -0,0 +1,139 @@
|
||||
$(document).ready(function() {
|
||||
var fontSize = $("#font_size").val();
|
||||
$(".tdrag-name").css("fontSize", fontSize + 'px');
|
||||
|
||||
$(".tdrag-header").Tdrag({
|
||||
scope: "#divBlock"
|
||||
});
|
||||
|
||||
$(".tdrag-logo").Tdrag({
|
||||
scope: "#divBlock"
|
||||
});
|
||||
|
||||
$(".tdrag-code").Tdrag({
|
||||
scope: "#divBlock"
|
||||
});
|
||||
|
||||
$(".tdrag-name").Tdrag({
|
||||
scope: "#divBlock"
|
||||
});
|
||||
});
|
||||
|
||||
layui.use(['form', 'colorpicker'], function() {
|
||||
var form = layui.form,
|
||||
colorpicker = layui.colorpicker,
|
||||
repeat_flag = false; //防重复标识
|
||||
|
||||
/**
|
||||
* 监听保存
|
||||
*/
|
||||
form.on('submit(save)', function(data) {
|
||||
if (repeat_flag) return false;
|
||||
repeat_flag = true;
|
||||
var field = data.field;
|
||||
if(field.is_logo_show == 'on'){
|
||||
field.is_logo_show = 1;
|
||||
}else{
|
||||
field.is_logo_show = 0;
|
||||
}
|
||||
field.header_left = $("#header").position().left;
|
||||
field.header_top = $("#header").position().top;
|
||||
field.name_left = $("#name").position().left;
|
||||
field.name_top = $("#name").position().top;
|
||||
field.logo_left = $("#logo").position().left;
|
||||
field.logo_top = $("#logo").position().top;
|
||||
field.code_left = $("#code").position().left;
|
||||
field.code_top = $("#code").position().top;
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: url,
|
||||
data: field,
|
||||
dataType: 'JSON',
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
location.hash = ns.hash("wechat://shop/wechat/qrcode");
|
||||
repeat_flag = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 图片上传
|
||||
*/
|
||||
var posterWidth = 640, posterHeight = 1134;
|
||||
|
||||
var upload = new Upload({
|
||||
elem: '#background',
|
||||
auto: false,
|
||||
choose: function(obj) {
|
||||
obj.preview(function(index, file, result) {
|
||||
var img = new Image();
|
||||
img.onload = function() {
|
||||
if (posterWidth == img.width && posterHeight == img.height) {
|
||||
obj.upload(index, file);
|
||||
} else {
|
||||
layer.msg('海报尺寸必须为:' + posterWidth + 'px * ' + posterHeight + 'px');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
img.src = result;
|
||||
});
|
||||
},
|
||||
callback: function(res) {
|
||||
if (res.code >= 0) {
|
||||
$("#imgLogo").attr("src", ns.img(res.data.pic_path));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 文字颜色
|
||||
*/
|
||||
colorpicker.render({
|
||||
elem: '#font_color', //绑定元素
|
||||
color: default_color,
|
||||
done: function(color) {
|
||||
$(".tdrag-name").css("color", color);
|
||||
$("input[name='nick_font_color']").val(color);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 监听字体变化
|
||||
*/
|
||||
$("input[name=nick_font_size]").blur(function() {
|
||||
$("#name").css("fontSize", $(this).val() + "px");
|
||||
});
|
||||
|
||||
/**
|
||||
* 表单验证
|
||||
*/
|
||||
form.verify({
|
||||
int: function(value) {
|
||||
if (value == "") {
|
||||
return false;
|
||||
}
|
||||
if (value < 0 || !(value % 1 === 0)) {
|
||||
return '请输入大于0的整数'
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* 是否显示logo
|
||||
*/
|
||||
form.on('switch(logo)', function(data){
|
||||
if(data.elem.checked) {
|
||||
//开
|
||||
$('#logo').show();
|
||||
}else {
|
||||
//关
|
||||
$('#logo').hide();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function backWechatQrcode() {
|
||||
location.hash = ns.hash("wechat://shop/wechat/qrcode");
|
||||
}
|
||||
676
addon/wechat/shop/view/public/js/wx_replay.js
Executable file
@@ -0,0 +1,676 @@
|
||||
var form;
|
||||
layui.use('form', function() {
|
||||
form = layui.form;
|
||||
form.render();
|
||||
});
|
||||
|
||||
/**
|
||||
* 微信回复
|
||||
*/
|
||||
WxReplay = function (limit = 0, limits = []) {
|
||||
var _this = this;
|
||||
_this._dom = null;
|
||||
_this.eventFlg = true;
|
||||
_this.listCount = 0;
|
||||
_this.limit = limit == false ? 15 : limit;
|
||||
_this.limits = limit == false ? [15, 20, 50] : limits;
|
||||
|
||||
var page = 1;
|
||||
var hash_arr = getHashArr();
|
||||
$.each(hash_arr,function(index, itemobj){
|
||||
var item_arr = itemobj.split("=");
|
||||
if(item_arr.length == 2){
|
||||
switch(item_arr[0]){
|
||||
case "page":
|
||||
page = item_arr[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
_this.page = page;
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取关键词回复列表
|
||||
*/
|
||||
WxReplay.prototype.getData = function (d) {
|
||||
var _this = d._this;
|
||||
var page = _this.page;
|
||||
var limit = _this.limit;
|
||||
var rule_type = d.rule_type;
|
||||
var search_text = d.search_text == null ? {} : d.search_text;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/replay'),
|
||||
async: false,
|
||||
data: {"page": page, "limit": limit, "rule_type": rule_type, "search_text": search_text},
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
_this.listCount = data.data.count;
|
||||
_this.aD.addReplayList(data.data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* layui分页
|
||||
*/
|
||||
WxReplay.prototype.pageInit = function (d) {
|
||||
var _this = d._this;
|
||||
|
||||
layui.use('laypage', function () {
|
||||
var laypage = layui.laypage;
|
||||
laypage.render({
|
||||
elem: 'list_page',
|
||||
count: _this.listCount,
|
||||
limit: _this.limit,
|
||||
limits: _this.limits,
|
||||
layout: ns.get_page_param().layout,
|
||||
prev: '<i class="layui-icon layui-icon-left"></i>',
|
||||
next: '<i class="layui-icon layui-icon-right"></i>',
|
||||
curr: _this.page,
|
||||
jump: function (obj, first) {
|
||||
_this.limit = obj.limit;
|
||||
if (!first) {
|
||||
_this.page = obj.curr;
|
||||
_this.getData({_this: _this, "rule_type": 'KEYWORDS'});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 事件操作
|
||||
* @param e 事件对象
|
||||
*/
|
||||
WxReplay.prototype.e = function (e) {
|
||||
try {
|
||||
//_this为replay对象 //_dom 为元素dom
|
||||
var _this = e.data._this;
|
||||
_this._dom = e.target;
|
||||
var eventFlg = _this.eventFlg;
|
||||
if (!eventFlg) return;
|
||||
_this.eventFlg = false;
|
||||
var _dom = e.target;
|
||||
var dataEvent = $(_dom).attr("nc-event");
|
||||
var dataAction = $(_dom).attr("nc-action");
|
||||
var type = e.type;
|
||||
if (dataEvent != type) {
|
||||
if ($(_dom).attr("nc-event2") != type) {
|
||||
_this.eventFlg = true;
|
||||
return;
|
||||
} else {
|
||||
dataEvent = $(_dom).attr("nc-event2");
|
||||
dataAction = $(_dom).attr("nc-action2");
|
||||
}
|
||||
}
|
||||
|
||||
var eventObj = null;
|
||||
switch (dataEvent) {
|
||||
case "click":
|
||||
eventObj = _this.clickEvent;
|
||||
break;
|
||||
case "mouseenter" :
|
||||
eventObj = _this.mouseenterEvent;
|
||||
break;
|
||||
case "mouseleave" :
|
||||
eventObj = _this.mouseleaveEvent;
|
||||
break;
|
||||
}
|
||||
if (eventObj) {
|
||||
|
||||
_this.evalFun(eventObj, dataAction, {"_this": _this});
|
||||
|
||||
_this.eventFlg = true;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
_this.eventFlg = true;
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 点击事件
|
||||
*/
|
||||
WxReplay.prototype.clickEvent = {
|
||||
click: function () {},
|
||||
|
||||
//添加回复
|
||||
addRule: function (d) {
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: "新建自动回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_auto_replay").html(),
|
||||
success: function(layero, index) {
|
||||
$(layero).find("input[name='rule_id']").val(0);
|
||||
$(layero).find("input[name='layer_index']").val(index);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
editRule: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var ruke_name = $(_dom).attr('data-ruke_name');
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: "修改自动回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_auto_replay").html(),
|
||||
success: function (layero, index) {
|
||||
$(layero).find("button[type='reset']").hide();
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("input[name='layer_index']").val(index);
|
||||
$(layero).find("input[name='key_rule_name']").val(ruke_name);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
delRule: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var flag = true;
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "删除",
|
||||
offset: "auto",
|
||||
content: ' 确定要删除规则吗?'
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
if (!flag) return;
|
||||
flag = false;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/deleteRule'),
|
||||
data: {"rule_id": rule_id},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
//关闭弹出层
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//添加关键词
|
||||
addKeywords: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: "添加关键词",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_keywords").html(),
|
||||
success: function (layero, index) {
|
||||
form.render();
|
||||
$(layero).find("input[name='layer_index']").val(index);
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//编辑关键词
|
||||
editKeywords: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var keyword_name = $(_dom).attr('keyword_name');
|
||||
var keywords_type = $(_dom).parent().find('.add-on').attr("keyword_type");
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: "添加关键词",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_keywords").html(),
|
||||
success: function (layero, index) {
|
||||
form.render();
|
||||
$(layero).find("input[name='layer_index']").val(index);
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("input[name='key_id']").val(key_id);
|
||||
$(layero).find("input[name='keywords_name']").val(keyword_name);
|
||||
$(layero).find("input[name='keywords_type']").each(function (i, item) {
|
||||
if ($(item).val() == keywords_type) {
|
||||
$(item).prop('checked', true);
|
||||
form.render();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//删除关键词
|
||||
delKeywords: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr("data-key_id");
|
||||
var flag = true;
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "是否删除关键词",
|
||||
offset: "auto",
|
||||
content: ''
|
||||
, btn: ['保存', '返回']
|
||||
, yes: function (index, layero) {
|
||||
if (!flag) return;
|
||||
flag = false;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/deleteKeywords'),
|
||||
data: {"rule_id": rule_id, "key_id": key_id},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
//关闭弹出层
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//添加一条回复
|
||||
addReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var reply_content = $(_dom).attr('reply_content');
|
||||
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "添加自动回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_reply").html(),
|
||||
success: function (layero, index) {
|
||||
$(layero).find("input[name='layer_index']").val(index);
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(".image,.voice").css("display", "inline-block");
|
||||
$(".image,.voice").next("span").css("display", "inline-block");
|
||||
$(".complex-backdrop").css("display", "none"); //清空文本框
|
||||
$(layero).find("textarea[name='reply_content']").val("");
|
||||
},
|
||||
cancel: function(){
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
//编辑回复
|
||||
editReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr('data-key_id');
|
||||
var reply_content = $(_dom).attr('reply_content');
|
||||
var request_type = $(_dom).attr('type');
|
||||
$("#hidden_reply_type").val(request_type);
|
||||
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "修改自动回复",
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#add_reply").html(),
|
||||
success: function (layero, index) {
|
||||
$(layero).find("input[name='layer_index']").val(index);
|
||||
$(layero).find("input[name='rule_id']").val(rule_id);
|
||||
$(layero).find("input[name='key_id']").val(key_id);
|
||||
$(layero).find("textarea[name='reply_content']").val(reply_content);
|
||||
|
||||
$(".voice").css("display", "none");
|
||||
$(".voice").next("span").css("display", "none");
|
||||
|
||||
if (request_type == 'image') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single ng-image">';
|
||||
active_pic += '<a class="picture" target="_blank" href=""><img src="' + ns.img(reply_content) + '" alt=""/></a>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else if (request_type == 'music') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="voice-wrapper" data-voice-src="' + reply_content + '">';
|
||||
active_pic += '<span class="voice-player">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<span class="stop">点击播放</span>';
|
||||
active_pic += '<span class="second"></span>';
|
||||
active_pic += '<i class="play" style="display:none;"></i>';
|
||||
active_pic += '</span>';
|
||||
active_pic += '</div>';
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
|
||||
} else if (request_type == 'other') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<a href="h" target="_blank" class="new-window" title="' + reply_content + '"><span class="label label-success">' + reply_content + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else if (request_type == 'articles') {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">图 文</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="" target="_blank" class="new-window" title="' + reply_content + '">' + reply_content + '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(layero).find(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
} else {
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
}
|
||||
},
|
||||
cancel: function(){
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
//删除回复
|
||||
delReply: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
var rule_id = $(_dom).parents(".rule-group").attr("data-rule_id");
|
||||
var key_id = $(_dom).attr("data-key_id");
|
||||
var flag = true;
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
title: "删除",
|
||||
offset: "auto",
|
||||
content: '确定删除该条回复吗?'
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
if (!flag) return;
|
||||
flag = false;
|
||||
_this.sendAjax({
|
||||
url: ns.url('wechat://shop/replay/deleteReply'),
|
||||
data: {"rule_id": rule_id, "key_id": key_id},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
//关闭弹出层
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//音乐
|
||||
music: function (d) {
|
||||
$("#hidden_reply_type").val('music');
|
||||
$(".complex-backdrop").css("display", "none"); //清空文本框
|
||||
$("textarea[name='reply_content']").val("");
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '音乐素材',
|
||||
area: ['850px'],
|
||||
offset: "auto",
|
||||
content: $("#music").html()
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* 移入事件
|
||||
*/
|
||||
WxReplay.prototype.mouseenterEvent = {
|
||||
groupEnter: function (d) {
|
||||
var _this = d._this;
|
||||
var _dom = _this._dom;
|
||||
$(_dom).css({"border": "2px solid #333"});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 移出事件
|
||||
*/
|
||||
WxReplay.prototype.mouseleaveEvent = {};
|
||||
|
||||
/**
|
||||
* 执行传过来的方法
|
||||
* @param eventObj
|
||||
* @param funcName
|
||||
* @param d
|
||||
*/
|
||||
WxReplay.prototype.evalFun = function (eventObj, funcName, d = {}) {
|
||||
for (i in eventObj) {
|
||||
if (i == funcName) {
|
||||
eval(eventObj[i](d));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 元素操作 da(documentAction)
|
||||
*/
|
||||
WxReplay.prototype.aD = {
|
||||
|
||||
addReplayList: function (d) {
|
||||
var data = d.list;
|
||||
var html = '';
|
||||
$.each(data, function (i) {
|
||||
var d = data[i];
|
||||
html += '<div class="rule-group layui-row" data-rule_id="' + d.rule_id + '">';
|
||||
html += '<div class="rule-meta bg-color-light-9">';
|
||||
html += '<h3><span class="rule-name">' + d.rule_name + '</span><div class="rule-opts"><a href="javascript:;" class="js-edit-rule js-replay" nc-event="click" nc-action="editRule" data- data-id="' + d.rule_id + '" data-ruke_name="' + d.rule_name + '">编辑</a><span> - </span><a href="javascript:;" class="js-del-rule js-replay" data-id="' + d.rule_id + '" nc-event="click" nc-action="delRule">删除</a></div></h3>';//title
|
||||
html += '</div>';
|
||||
html += '<div class="rule-body">';
|
||||
html += '<div class="long-dashed"></div>';
|
||||
html += '<div class="rule-keywords layui-col-md5">';
|
||||
html += '<div class="rule-inner"><h4>关键词:</h4>';
|
||||
html += '<div class="keyword-container">';
|
||||
if (d.key_list.length <= 0) {
|
||||
html += '<div class="info">还没有任何关键字!</div>';
|
||||
} else {
|
||||
html += '<div class="info"></div>';
|
||||
}
|
||||
html += '<div class="keyword-list">';//关键词列表
|
||||
if (d.key_list.length > 0) {
|
||||
for (i in d.key_list) {
|
||||
html += '<div class="keyword input-append" >';
|
||||
html += '<a href="javascript:;" class="close--circle js-replay" data-key_id="' + i + '" nc-event="click" nc-action="delKeywords">×</a>';//删除关键词
|
||||
html += '<span class="value js-replay" keyword_name="' + d.key_list[i].keywords_name + '" data-key_id="' + i + '" nc-event="click" nc-action="editKeywords">' + d.key_list[i].keywords_name + '</span>';
|
||||
if (d.key_list[i].keywords_type == 0) {
|
||||
html += '<span class="add-on" keyword_type="' + d.key_list[i].keywords_type + '"> 全匹配</span>';
|
||||
} else {
|
||||
html += '<span class="add-on" keyword_type="' + d.key_list[i].keywords_type + '"> 模糊</span>';
|
||||
}
|
||||
html += '</div>';
|
||||
}
|
||||
}
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<hr class="dashed"/>';
|
||||
html += '<div class="opt">';
|
||||
html += '<a href="javascript:;" class="js-add-keyword js-replay" nc-event="click" nc-action="addKeywords">+ 添加关键词</a>'; //添加关键词
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<div class="rule-replies layui-col-md7">';
|
||||
html += '<div class="rule-inner">';
|
||||
html += '<h4>自动回复: <span class="send-method">随机发送</span></h4>';
|
||||
html += '<div class="reply-container">';
|
||||
if (d.replay_list.length <= 0) {
|
||||
html += '<div class="info">还没有任何回复!</div>';
|
||||
} else {
|
||||
html += '<div class="info"></div>';
|
||||
}
|
||||
html += '<ol class="reply-list">';
|
||||
|
||||
if (d.replay_list.length > 0) {
|
||||
for (j in d.replay_list) {
|
||||
|
||||
html += '<li>';//回复列表
|
||||
html += '<div class="reply-cont">';
|
||||
html += '<div class="reply-summary">';
|
||||
if (d.replay_list[j].type == 'text') {
|
||||
html += '<span class="label label-success">文本</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
} else if (d.replay_list[j].type == 'image') {
|
||||
html += '<span class="label"><img src="' + ns.img(d.replay_list[j].reply_content) + '" alt=""/></span>';
|
||||
} else if (d.replay_list[j].type == 'music') {
|
||||
html += '<div class="voice-wrapper" data-voice-src="' + d.replay_list[j].reply_content + '">';
|
||||
html += '<span class="voice-player">';
|
||||
html += '<span class="stop">点击播放</span>';
|
||||
html += '<span class="second" style="display: block;"></span>';
|
||||
html += '<i class="play" style="display:none;"></i>';
|
||||
html += '</span>';
|
||||
html += '</div>';
|
||||
} else if (d.replay_list[j].type == 'other') {
|
||||
html += '<span class="label label-success">' + d.replay_list[j].reply_content + '</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
} else if (d.replay_list[j].type == 'articles') {
|
||||
html += '<span class="label label-success">图文</span> ';
|
||||
html += '<span class="label">' + d.replay_list[j].reply_content + '</span>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '<div class="reply-opts">';
|
||||
var reply_content_to = d.replay_list[j].reply_content.replace(/"/g, "'");
|
||||
html += '<a class="js-edit-it js-replay" href="javascript:;" reply_content="' + reply_content_to + '" data-key_id="' + j + '" type="' + d.replay_list[j].type + '" nc-event="click" nc-action="editReply">编辑</a> - ';
|
||||
html += '<a class="js-delete-it js-replay" href="javascript:;" data-key_id="' + j + '" nc-event="click" nc-action="delReply">删除</a>';
|
||||
html += '</div>';
|
||||
html += '</li>';
|
||||
|
||||
}
|
||||
}
|
||||
html += '</ol>';
|
||||
html += '</div>';
|
||||
html += '<hr class="dashed"/>';
|
||||
html += '<div class="opt">';
|
||||
if (d.replay_list.length < 10) {
|
||||
html += '<a class="js-add-reply add-reply-menu js-replay" href="javascript:;" nc-event="click" nc-action="addReply">+ 添加一条回复</a>';
|
||||
} else {
|
||||
html += '<span class="disable-opt hide">最多十条回复</span>';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
});
|
||||
|
||||
if (d.count > 0) {
|
||||
$("#load_rule_list").html(html);
|
||||
} else {
|
||||
html = '<div class="empty">暂无数据!</div>';
|
||||
$("#load_rule_list").html(html);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
WxReplay.prototype.sendAjax = function (param = {}) {
|
||||
var d = $.extend({
|
||||
"url": '',
|
||||
"type": "post",
|
||||
"data": {},
|
||||
"async": true,
|
||||
"success": ''
|
||||
}, param);
|
||||
try {
|
||||
$.ajax({
|
||||
url: d.url,
|
||||
type: d.type,
|
||||
data: d.data,
|
||||
async: d.async,
|
||||
dataType: "JSON",
|
||||
success: function (res) {
|
||||
if (typeof (d.success) == "function") {
|
||||
d.success(res);
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
//其他
|
||||
$(".dropdown-menu li").click(function () {
|
||||
$("#hidden_reply_type").val('other');
|
||||
var title = $(this).text();
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<a href="javascript:;" class="new-window" title="' + title + '"><span class="label label-success">' + title + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="javascript:;" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(title);
|
||||
$("span.pull-right").hide();
|
||||
|
||||
});
|
||||
|
||||
//插入链接
|
||||
function hyperlink (d) {
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
area: ['450px'],
|
||||
offset: "auto",
|
||||
content: $("#hyperlink").html(),
|
||||
success: function(layero) {
|
||||
}
|
||||
});
|
||||
}
|
||||
292
addon/wechat/shop/view/replay/default.html
Executable file
@@ -0,0 +1,292 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_follow.css">
|
||||
|
||||
<div class="weixin-normal rule-autoreplay-page">
|
||||
<div id="load_rule_list"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="add_reply">
|
||||
<!--添加回复-->
|
||||
<div class="layui-form rule-container">
|
||||
<input type="hidden" name="layer_index" value="">
|
||||
<input type="hidden" name="rule_id" value="">
|
||||
<input type="hidden" name="key_id" value="-1">
|
||||
<!-- <div class="arrow"><i class="layui-icon"></i></div> -->
|
||||
<span class="add_reply-top"></span>
|
||||
<!--<a href="javascript:;" class="close--circle js-close">×</a>-->
|
||||
<div>
|
||||
<div class="misc">
|
||||
<!-- <a href="javascript:;" class="js-replay" nc-event="click" nc-action="emotion">表情</a> -->
|
||||
<a href="javascript:hyperlink();" class="js-replay">插入链接</a>
|
||||
<a href="javascript:;" class="image" onclick="material(5);">文本消息</a>
|
||||
<!-- <a href="javascript:;" class="js-replay" nc-event="click" nc-action="music">音乐</a> -->
|
||||
<a href="javascript:;" class="js-replay" onclick="material(1);">选择图文</a>
|
||||
<!--<div class="others">-->
|
||||
<!--<a href="javascript:;">其他<i class="caret"></i></a>-->
|
||||
<!--<ul class="dropdown-menu">-->
|
||||
<!--{volist name="link_list" id="vo"}-->
|
||||
<!--<li><a class="js-open-goods" data-action-type="{$vo.name}" data-complex-mode="true" href="javascript:;">{$vo.title}</a></li>-->
|
||||
<!--{/volist}-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<textarea placeholder="请输入内容" class="layui-textarea reply-content" name="reply_content" maxlength="300" lay-verify="required|content" ></textarea>
|
||||
<div class="complex-backdrop">
|
||||
<div class="complex-content"></div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-block" style="margin-top:10px;margin-left: 0;">
|
||||
<button class="layui-btn" type="button" lay-submit lay-filter="add_reply">确定</button>
|
||||
<span class="pull-right">还能输入 <i>300</i> 个字</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" value="" id="hidden_reply_type"/>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="hyperlink">
|
||||
<!-- 插入链接 -->
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="title" lay-verify="required|title" autocomplete="off" placeholder="http://" class="layui-input">
|
||||
</div>
|
||||
<button class="layui-btn" lay-submit lay-filter="hyperlink">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="music">
|
||||
<!-- 音乐素材 -->
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label msg-music-thumb"><a href="javascript:;" class="js-replay" nc-event="click" nc-action="thumbnail"><i class="layui-icon"></i></a></label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="title" placeholder="音乐标题" autocomplete="off" class="layui-input" lay-verify="required|title" style="margin-bottom: 10px;">
|
||||
<textarea placeholder="音乐描述" class="layui-textarea" name="description" maxlength="300" lay-verify="required|description" ></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label">普通音质</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="music_url" placeholder="填写音乐地址" autocomplete="off" class="layui-input" lay-verify="required|url">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label">高清音质</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="hq_music_url" placeholder="填写音乐地址" autocomplete="off" class="layui-input" lay-verify="required|url">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<button class="layui-btn" lay-submit lay-filter="music" style="float: right; margin-right: 10px;">确定</button>
|
||||
</div>
|
||||
<input type="hidden" name="thumb_attachment_id" value="">
|
||||
</div>
|
||||
</script>
|
||||
<script type='text/javascript' src='WECHAT_JS/wx_default.js'></script>
|
||||
<script src="WECHAT_JS/common.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var replay = new WxReplay(3,[3,6,9]);
|
||||
replay.getData({"_this": replay, "rule_type": 'AFTER'});//数据初始化
|
||||
replay.pageInit({"_this": replay});//分页初始化
|
||||
// $(".js-replay").bind("click", {"_this": replay}, replay.e); //元素事件
|
||||
$(".rule-autoreplay-page,.replay-button").delegate(".js-replay","click",{"_this": replay},replay.e);
|
||||
layui.use(['form'], function () {
|
||||
var form = layui.form;
|
||||
|
||||
//添加和修改回复
|
||||
form.on('submit(add_reply)', function (data) {
|
||||
var d = data.field;
|
||||
var rule_id = d.rule_id;
|
||||
var key_id = d.key_id;
|
||||
var reply_content = $.trim(d.reply_content);
|
||||
var layer_index = d.layer_index;
|
||||
var type = $("#hidden_reply_type").val() ? $("#hidden_reply_type").val() : "text";
|
||||
|
||||
var param = {
|
||||
url: ns.url('wechat://shop/replay/editReplays'),
|
||||
data: {"rule_id": rule_id,"reply_content":reply_content, "key_id":key_id, "type" : type,"replay_type":"default"},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
replay.sendAjax(param);
|
||||
});
|
||||
|
||||
//插入链接 确定
|
||||
form.on('submit(hyperlink)', function (data, index) {
|
||||
var d = data.field;
|
||||
var url = d.title;
|
||||
if (url.indexOf('http://') == -1 && url.indexOf('https://') == -1) {
|
||||
url = 'http://' + url;
|
||||
}
|
||||
|
||||
var textarea = $(".reply-content").val();
|
||||
if(textarea.indexOf("href") != -1){
|
||||
|
||||
var num_1 = textarea.indexOf("'");
|
||||
var num_2 = textarea.indexOf("'", num_1 + 1);
|
||||
var text = textarea.slice(num_1 + 1 ,num_2);
|
||||
var value = textarea.replace(text, url);
|
||||
|
||||
}else{
|
||||
var value = "<a href='"+ url +"'>"+ textarea +"</a>";
|
||||
}
|
||||
|
||||
$("textarea[name='reply_content']").val(value);
|
||||
layer.close(layer.index);
|
||||
});
|
||||
|
||||
//音乐 确定
|
||||
form.on('submit(music)', function (data, index) {
|
||||
var d = data.field;
|
||||
var thumb_attachment_id = d.thumb_attachment_id;
|
||||
var title = d.title;
|
||||
var description = d.description;
|
||||
var music_url = d.music_url;
|
||||
var hq_music_url = d.hq_music_url;
|
||||
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="voice-wrapper" data-voice-src="'+music_url+'">';
|
||||
active_pic += '<span class="voice-player">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<span class="stop">点击播放</span>';
|
||||
active_pic += '<span class="second"></span>';
|
||||
active_pic += '<i class="play" style="display:none;"></i>';
|
||||
active_pic += '</span>';
|
||||
active_pic += '</div>';
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display","block");
|
||||
$("textarea[name='reply_content']").val(music_url);
|
||||
|
||||
layer.close(layer.index);
|
||||
});
|
||||
});
|
||||
|
||||
//关闭 清除
|
||||
$(".js-close").click(function(){
|
||||
$("textarea[name='reply_content']").val();
|
||||
$('.complex-backdrop').css("display","none");
|
||||
$(".layui-layer-shade").remove();
|
||||
});
|
||||
|
||||
//清除
|
||||
$("body").off('click',".js-delete-complex").on('click',".js-delete-complex",function(){
|
||||
$("textarea[name='reply_content']").val('');
|
||||
$('.complex-backdrop').css("display","none");
|
||||
});
|
||||
});
|
||||
|
||||
//音乐回调
|
||||
function albumUploadSuccess(o,name){
|
||||
$("#hidden_reply_type").val('image');
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single ng-image">';
|
||||
active_pic += '<a class="picture" target="_blank" href=""><img src="'+nc.img(o[0]['small_pic_path'])+'" alt=""/></a>';
|
||||
active_pic += '</div>';
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display","block");
|
||||
$("textarea[name='reply_content']").val(o[0]['small_pic_path']);
|
||||
}
|
||||
|
||||
//图文回调
|
||||
function chooseGraphicMessage(data) {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">图 文</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="'+data.value[0].url+'" target="_blank" class="new-window" title="'+data.value[0].title+'">' + data.value[0].title + '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="'+data.value[0].url+'" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(data.value[0].title);
|
||||
$("#hidden_reply_type").val('articles');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
function chooseTextMessage(data){
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">文 本</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="javascript:;" title="'+data.value.content+'">' + data.value.content + '</a>';
|
||||
active_pic += '</div>';
|
||||
// active_pic += '<a href="h" target="_blank" class="new-window" title="' + data.value.content + '"><span class="label label-success">' + data.value.content + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(data.value.content);
|
||||
$("span.pull-right").hide();
|
||||
$("#hidden_reply_type").val('text');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
//弹出框的位置
|
||||
$("body").off('click',".add-reply-menu").on('click',".add-reply-menu",function(){
|
||||
var x = $(this).position().top;
|
||||
var y = $(this).position().left;
|
||||
var real_x = 16;
|
||||
var real_y = 72;
|
||||
$('.rule-container').css('top', real_x);
|
||||
$('.rule-container').css('left', real_y);
|
||||
|
||||
var m = '<i class="layui-icon"></i>';
|
||||
$('.rule-container .arrow').html(m);
|
||||
$('.rule-container .arrow').css('right', 'auto');
|
||||
$('.rule-container .arrow').css('left', '-13px');
|
||||
|
||||
$('.pull-right').find('i').text(300);
|
||||
});
|
||||
|
||||
//编辑弹出框的位置
|
||||
$("body").off('click',".js-edit-it").on('click',".js-edit-it",function(){
|
||||
var x = $(this).position().top;
|
||||
var y = $(this).position().left;
|
||||
var real_x = x + 78;
|
||||
var real_y = y;
|
||||
$('.rule-container').css('top', real_x);
|
||||
$('.rule-container').css('right', real_y);
|
||||
|
||||
var s = '<i class="layui-icon"></i>';
|
||||
$('.rule-container .arrow').html(s);
|
||||
$('.rule-container .arrow').css('left', 'auto');
|
||||
$('.rule-container .arrow').css('right', 3);
|
||||
|
||||
var text_leng = $('.rule-container').find(".layui-textarea").val().length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
});
|
||||
|
||||
$("body").off('keydown',".layui-textarea").on('keydown',".layui-textarea",function(){
|
||||
var text_leng = $(this).val().length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
})
|
||||
</script>
|
||||
332
addon/wechat/shop/view/replay/follow.html
Executable file
@@ -0,0 +1,332 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_follow.css">
|
||||
|
||||
<div class="weixin-normal rule-autoreplay-page">
|
||||
<div id="load_rule_list"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="add_reply">
|
||||
<!--添加回复-->
|
||||
<div class="layui-form rule-container">
|
||||
<input type="hidden" name="layer_index" value="">
|
||||
<input type="hidden" name="rule_id" value="">
|
||||
<input type="hidden" name="key_id" value="-1">
|
||||
<!--<div class="arrow"><i class="layui-icon"></i></div>-->
|
||||
<!--<a href="javascript:;" class="close--circle js-close">×</a>-->
|
||||
<div>
|
||||
<div class="misc">
|
||||
<!-- <a href="javascript:;" class="js-replay" nc-event="click" nc-action="emotion">表情</a> -->
|
||||
<a href="javascript:hyperlink();" class="js-replay">插入链接</a>
|
||||
<a href="javascript:;" class="image" onclick="material(5);">文本消息</a>
|
||||
<!-- <a href="javascript:;" class="js-replay" nc-event="click" nc-action="music">音乐</a> -->
|
||||
<a href="javascript:;" class="js-replay" onclick="material(1);">选择图文</a>
|
||||
<!--<div class="others">-->
|
||||
<!--<a href="javascript:;">其他<i class="caret"></i></a>-->
|
||||
<!--<ul class="dropdown-menu">-->
|
||||
<!--{volist name="link_list" id="vo"}-->
|
||||
<!--<li><a class="js-open-goods" data-action-type="{$vo.name}" data-complex-mode="true" href="javascript:;">{$vo.title}</a></li>-->
|
||||
<!--{/volist}-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<textarea placeholder="请输入内容" class="layui-textarea" name="reply_content" maxlength="300" lay-verify="required|content" ></textarea>
|
||||
<div class="complex-backdrop">
|
||||
<div class="complex-content"></div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-block" style="margin-top:10px;margin-left: 0;">
|
||||
<button class="layui-btn" type="button" lay-submit lay-filter="add_reply">确定</button>
|
||||
<span class="pull-right">还能输入 <i>300</i> 个字</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" value="" id="hidden_reply_type"/>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="hyperlink">
|
||||
<!-- 插入链接 -->
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item" style="margin-bottom:0;">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="title" lay-verify="required|title" autocomplete="off" placeholder="http://" class="layui-input">
|
||||
</div>
|
||||
<button class="layui-btn" lay-submit lay-filter="hyperlink">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="music">
|
||||
<!-- 音乐素材 -->
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label msg-music-thumb"><a href="javascript:;" class="js-replay" nc-event="click" nc-action="thumbnail"><i class="layui-icon"></i></a></label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="title" placeholder="音乐标题" autocomplete="off" class="layui-input" lay-verify="required|title" style="margin-bottom: 10px;">
|
||||
<textarea placeholder="音乐描述" class="layui-textarea" name="description" maxlength="300" lay-verify="required|description" ></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label">普通音质</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="music_url" placeholder="填写音乐地址" autocomplete="off" class="layui-input" lay-verify="required|url">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label">高清音质</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="hq_music_url" placeholder="填写音乐地址" autocomplete="off" class="layui-input" lay-verify="required|url">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<button class="layui-btn" lay-submit lay-filter="music" style="float: right; margin-right: 10px;">确定</button>
|
||||
</div>
|
||||
<input type="hidden" name="thumb_attachment_id" value="">
|
||||
</div>
|
||||
</script>
|
||||
<script type='text/javascript' src='WECHAT_JS/wx_follow.js'></script>
|
||||
<script src="WECHAT_JS/common.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$.fn.extend({
|
||||
insertAtCaret: function(myValue, type){
|
||||
var $t=$(this)[0];
|
||||
if (document.selection) {
|
||||
this.focus();
|
||||
sel = document.selection.createRange();
|
||||
sel.text = myValue;
|
||||
this.focus();
|
||||
}
|
||||
else
|
||||
if ($t.selectionStart || $t.selectionStart == '0') {
|
||||
|
||||
var startPos = $t.selectionStart;
|
||||
var endPos = $t.selectionEnd;
|
||||
var scrollTop = $t.scrollTop;
|
||||
if(type == 'url'){
|
||||
if($t.value.substring(0, startPos).indexOf("href") != -1){
|
||||
|
||||
var num_1 = $t.value.substring(0, startPos).indexOf("'");
|
||||
var num_2 = $t.value.substring(0, startPos).indexOf("'", num_1 + 1);
|
||||
var text = $t.value.substring(0, startPos).slice(num_1 + 1 ,num_2);
|
||||
$t.value = $t.value.substring(0, startPos).replace(text, myValue);
|
||||
|
||||
}else{
|
||||
$t.value = "<a href='"+ myValue +"'>"+ $t.value.substring(0, startPos) +"</a>";
|
||||
}
|
||||
}
|
||||
// $t.value = $t.value.substring(0, startPos) + myValue + $t.value.substring(endPos, $t.value.length);
|
||||
|
||||
this.focus();
|
||||
$t.selectionStart = startPos + myValue.length;
|
||||
$t.selectionEnd = startPos + myValue.length;
|
||||
$t.scrollTop = scrollTop;
|
||||
}
|
||||
else {
|
||||
this.value += myValue;
|
||||
this.focus();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
var replay = new WxReplay(3,[3,6,9]);
|
||||
replay.getData({"_this": replay, "rule_type": 'AFTER'});//数据初始化
|
||||
replay.pageInit({"_this": replay});//分页初始化
|
||||
// $(".js-replay").bind("click", {"_this": replay}, replay.e); //元素事件
|
||||
$(".rule-autoreplay-page,.replay-button").delegate(".js-replay","click",{"_this": replay},replay.e);
|
||||
//form 操作模块
|
||||
layui.use(['form'], function () {
|
||||
var form = layui.form;
|
||||
|
||||
//添加和修改回复
|
||||
form.on('submit(add_reply)', function (data) {
|
||||
|
||||
var d = data.field;
|
||||
var rule_id = d.rule_id;
|
||||
var key_id = d.key_id;
|
||||
var reply_content = $.trim(d.reply_content);
|
||||
var layer_index = d.layer_index;
|
||||
var type = $("#hidden_reply_type").val() ? $("#hidden_reply_type").val() : "text";
|
||||
|
||||
var param = {
|
||||
url: ns.url('wechat://shop/replay/editReplays'),
|
||||
data: {"rule_id": rule_id,"reply_content":reply_content, "key_id":key_id, "type" : type,"replay_type":"follow"},
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
replay.sendAjax(param);
|
||||
});
|
||||
|
||||
//插入链接 确定
|
||||
form.on('submit(hyperlink)', function (data, index) {
|
||||
var d = data.field;
|
||||
var url = d.title;
|
||||
if (url.indexOf('http://') == -1 && url.indexOf('https://') == -1) {
|
||||
url = 'http://' + url;
|
||||
}
|
||||
var textarea = $("textarea[name='reply_content']").val();
|
||||
if(textarea.indexOf("href") != -1){
|
||||
|
||||
var num_1 = textarea.indexOf("'");
|
||||
var num_2 = textarea.indexOf("'", num_1 + 1);
|
||||
var text = textarea.slice(num_1 + 1 ,num_2);
|
||||
var value = textarea.replace(text, url);
|
||||
|
||||
}else{
|
||||
var value = "<a href='"+ url +"'>"+ textarea +"</a>";
|
||||
}
|
||||
|
||||
$("textarea[name='reply_content']").val(value);
|
||||
layer.close(layer.index);
|
||||
});
|
||||
|
||||
//音乐 确定
|
||||
form.on('submit(music)', function (data, index) {
|
||||
var d = data.field;
|
||||
var thumb_attachment_id = d.thumb_attachment_id;
|
||||
var title = d.title;
|
||||
var description = d.description;
|
||||
var music_url = d.music_url;
|
||||
var hq_music_url = d.hq_music_url;
|
||||
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="voice-wrapper" data-voice-src="'+music_url+'">';
|
||||
active_pic += '<span class="voice-player">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<span class="stop">点击播放</span>';
|
||||
active_pic += '<span class="second"></span>';
|
||||
active_pic += '<i class="play" style="display:none;"></i>';
|
||||
active_pic += '</span>';
|
||||
active_pic += '</div>';
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display","block");
|
||||
$("textarea[name='reply_content']").val(music_url);
|
||||
|
||||
layer.close(layer.index);
|
||||
});
|
||||
});
|
||||
|
||||
//关闭 清除
|
||||
$(".js-close").click(function(){
|
||||
$("textarea[name='reply_content']").val();
|
||||
$('.complex-backdrop').css("display","none");
|
||||
$(".layui-layer-shade").remove();
|
||||
});
|
||||
|
||||
//清除
|
||||
$("body").off('click',".js-delete-complex").on('click',".js-delete-complex",function(){
|
||||
$("textarea[name='reply_content']").val('');
|
||||
$('.complex-backdrop').css("display","none");
|
||||
});
|
||||
});
|
||||
|
||||
//音乐回调
|
||||
function albumUploadSuccess(o,name){
|
||||
$("#hidden_reply_type").val('image');
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single ng-image">';
|
||||
active_pic += '<a class="picture" target="_blank" href=""><img src="'+nc.img(o[0]['small_pic_path'])+'" alt=""/></a>';
|
||||
active_pic += '</div>';
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display","block");
|
||||
$("textarea[name='reply_content']").val(o[0]['small_pic_path']);
|
||||
}
|
||||
|
||||
//图文回调
|
||||
function chooseGraphicMessage(data) {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">图 文</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="'+data.value[0].url+'" target="_blank" class="new-window" title="'+data.value[0].title+'">' + data.value[0].title + '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="'+data.value[0].url+'" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(data.value[0].title);
|
||||
$("#hidden_reply_type").val('articles');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
function chooseTextMessage(data){
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">文 本</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="javascript:;" title="'+data.value.content+'">' + data.value.content + '</a>';
|
||||
active_pic += '</div>';
|
||||
// active_pic += '<a href="h" target="_blank" class="new-window" title="' + data.value.content + '"><span class="label label-success">' + data.value.content + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(data.value.content);
|
||||
$("span.pull-right").hide();
|
||||
$("#hidden_reply_type").val('text');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
//弹出框的位置
|
||||
$("body").off('click',".add-reply-menu").on('click',".add-reply-menu",function(){
|
||||
var x = $(this).position().top;
|
||||
var y = $(this).position().left;
|
||||
var real_x = 16;
|
||||
var real_y = 72;
|
||||
$('.rule-container').css('top', real_x);
|
||||
$('.rule-container').css('left', real_y);
|
||||
|
||||
var m = '<i class="layui-icon"></i>';
|
||||
$('.rule-container .arrow').html(m);
|
||||
$('.rule-container .arrow').css('right', 'auto');
|
||||
$('.rule-container .arrow').css('left', '-13px');
|
||||
|
||||
$('.pull-right').find('i').text(300);
|
||||
});
|
||||
|
||||
//编辑弹出框的位置
|
||||
$("body").off('click',".js-edit-it").on('click',".js-edit-it",function(){
|
||||
var x = $(this).position().top;
|
||||
var real_x = x;
|
||||
var real_y = 85;
|
||||
$('.rule-container').css('top', real_x);
|
||||
$('.rule-container').css('right', real_y);
|
||||
|
||||
var s = '<i class="layui-icon"></i>';
|
||||
$('.rule-container .arrow').html(s);
|
||||
$('.rule-container .arrow').css('left', 'auto');
|
||||
$('.rule-container .arrow').css('right', 3);
|
||||
|
||||
var text_leng = $('.rule-container').find(".layui-textarea").val().length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
});
|
||||
|
||||
$("body").off('keydown',".layui-textarea").on('keydown',".layui-textarea",function(){
|
||||
var text_leng = $(this).val().length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
})
|
||||
</script>
|
||||
461
addon/wechat/shop/view/replay/replay.html
Executable file
@@ -0,0 +1,461 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_replay.css">
|
||||
<style>
|
||||
.layui-layout-admin .single-filter-box{padding-bottom: 0;}
|
||||
</style>
|
||||
|
||||
<div class="keyword-content">
|
||||
<div class="single-filter-box">
|
||||
<div class='info'>
|
||||
<button class='add-replay js-replay layui-btn' type="button" nc-event="click" nc-action="addRule">新建自动回复</button>
|
||||
</div>
|
||||
<div class="layui-form">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="rule_name" id="search_text" placeholder="请输入规则" class="layui-input">
|
||||
<button type="button" class="layui-btn layui-btn-primary" onclick="search()">
|
||||
<i class="layui-icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="weixin-normal rule-autoreplay-page">
|
||||
<div id="load_rule_list" class="rule-group-container"></div>
|
||||
<div id="list_page" style="text-align: right;"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="add_auto_replay">
|
||||
<!--添加一条规则-->
|
||||
<div class="layui-form">
|
||||
<input type="hidden" name="layer_index" value="">
|
||||
<input type="hidden" name="rule_id" value="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm"><span class="required">*</span>规则名称</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="key_rule_name" placeholder="关键字回复规格名称" autocomplete="off" class="layui-input" required lay-verify="required"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" type="button" lay-submit lay-filter="add_rule_replay">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="add_keywords">
|
||||
<!--添加关键字-->
|
||||
<div class="layui-form">
|
||||
<input type="hidden" name="layer_index" value=""/>
|
||||
<input type="hidden" name="rule_id" value=""/>
|
||||
<input type="hidden" name="key_id" value="-1"/>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label sm">关键字</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="keywords_name" placeholder="关键词最多支持15个字" autocomplete="off" class="layui-input" required lay-verify="required|length"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label sm">规则</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="keywords_type" value="0" title="全匹配" checked/>
|
||||
<input type="radio" name="keywords_type" value="1" title="模糊"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row sm">
|
||||
<button class="layui-btn" type="button" lay-submit lay-filter="add_keywords">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="add_reply">
|
||||
<!--添加回复-->
|
||||
<div class="layui-form rule-container">
|
||||
<input type="hidden" name="layer_index" value=""/>
|
||||
<input type="hidden" name="rule_id" value=""/>
|
||||
<input type="hidden" name="key_id" value="-1"/>
|
||||
<input type="hidden" value="" id="hidden_reply_type" />
|
||||
<input type="hidden" value="" id="hidden_media_id" />
|
||||
<!--<div class="arrow">-->
|
||||
<!--<i class="layui-icon"></i>-->
|
||||
<!--</div>-->
|
||||
<!--<a href="javascript:;" class="close--circle js-close">×</a>-->
|
||||
<div>
|
||||
<div class="misc">
|
||||
<!-- <a href="javascript:;" class="js-replay" nc-event="click" nc-action="emotion">表情</a> -->
|
||||
<a href="javascript:hyperlink();" class="js-replay">插入链接</a>
|
||||
<a href="javascript:;" class="image" onclick="material(5);">文本消息</a>
|
||||
<!-- <a href="javascript:;" class="voice" onclick="chooseMaterial(3);">音频</a> -->
|
||||
<!-- <a href="javascript:;" class="js-replay" nc-event="click" nc-action="music">音乐</a> -->
|
||||
<a href="javascript:;" class="js-replay" onclick="material(1);">选择图文</a>
|
||||
<!--<div class="others">-->
|
||||
<!--<a href="javascript:;">其他<i class="caret"></i></a>-->
|
||||
<!--<ul class="dropdown-menu">-->
|
||||
<!--{volist name="link_list" id="vo"}-->
|
||||
<!--<li>-->
|
||||
<!--<a class="js-open-goods" data-action-type="{$vo.name}" data-complex-mode="true" href="javascript:;">{$vo.title}</a>-->
|
||||
<!--</li>-->
|
||||
<!--{/volist}-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<textarea placeholder="请输入内容" class="layui-textarea" name="reply_content" maxlength="300" lay-verify="required|content"></textarea>
|
||||
<div class="complex-backdrop">
|
||||
<div class="complex-content"></div>
|
||||
</div>
|
||||
<div class="layui-input-block" style="margin-top: 10px; margin-left: 0;">
|
||||
<button class="layui-btn" type="button" lay-submit lay-filter="add_reply">确定</button>
|
||||
<span class="pull-right">还能输入 <i>300</i> 个字 </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="hyperlink">
|
||||
<!-- 插入链接 -->
|
||||
<div class="layui-form hyperlink">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="title" onkeyup="value=value.replace(/[\u4e00-\u9fa5]/ig,'')" lay-verify="required|title" autocomplete="off" placeholder="http://" class="layui-input"/>
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" lay-submit lay-filter="hyperlink">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="music">
|
||||
<!-- 音乐素材 -->
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label msg-music-thumb">
|
||||
<a href="javascript:chooseMaterial(2);" class="js-replay" nc-event="click" nc-action="thumbnail">
|
||||
<i class="layui-icon"></i>
|
||||
</a>
|
||||
</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="title" placeholder="音乐标题" autocomplete="off" class="layui-input" lay-verify="required|title" style="margin-bottom: 10px;"/>
|
||||
<textarea placeholder="音乐描述" class="layui-textarea" name="description" maxlength="300" lay-verify="required|description"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label">普通音质</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="music_url" placeholder="填写音乐地址" autocomplete="off" class="layui-input" lay-verify="required|url"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<label class="layui-form-label">高清音质</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="hq_music_url" placeholder="填写音乐地址" autocomplete="off" class="layui-input" lay-verify="required|url"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<button class="layui-btn" lay-submit lay-filter="music" style="float: right; margin-right: 10px;">确定</button>
|
||||
</div>
|
||||
<input type="hidden" name="thumb_attachment_id" value=""/>
|
||||
</div>
|
||||
</script>
|
||||
<script type='text/javascript' src='WECHAT_JS/wx_replay.js'></script>
|
||||
<script src="WECHAT_JS/common.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var replay = new WxReplay(3, [ 3, 6, 9 ]);
|
||||
replay.getData({
|
||||
"_this" : replay,
|
||||
"rule_type" : 'KEYWORDS'
|
||||
});//数据初始化
|
||||
replay.pageInit({
|
||||
"_this" : replay
|
||||
});//分页初始化
|
||||
// $(".js-replay").bind("click", {"_this": replay}, replay.e); //元素事件
|
||||
$(".rule-autoreplay-page,.info").delegate(".js-replay", "click", {
|
||||
"_this" : replay
|
||||
}, replay.e);
|
||||
|
||||
layui .use([ 'form' ], function() {
|
||||
var form = layui.form;
|
||||
|
||||
//添加关键字回复
|
||||
form.on('submit(add_rule_replay)', function(data) {
|
||||
var d = data.field;
|
||||
var dom = data.form;
|
||||
var rule_id = d.rule_id;
|
||||
var rule_name = $.trim(d.key_rule_name); //关键词名称
|
||||
var layer_index = d.layer_index;
|
||||
var param = {
|
||||
url : ns.url('wechat://shop/replay/addOrEditRule'),
|
||||
data : {
|
||||
"rule_name" : rule_name,
|
||||
"rule_id" : rule_id
|
||||
},
|
||||
success : function(res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
//关闭弹出层
|
||||
$(dom).find('button[type="reset"]').click();
|
||||
|
||||
replay.getData({
|
||||
"_this" : replay,
|
||||
"rule_type" : 'KEYWORDS'
|
||||
});//数据初始化
|
||||
replay.pageInit({
|
||||
"_this" : replay
|
||||
});//分页初始化
|
||||
|
||||
layer.close(layer_index);
|
||||
}
|
||||
}
|
||||
};
|
||||
replay.sendAjax(param);
|
||||
});
|
||||
|
||||
//添加关键字
|
||||
form.on('submit(add_keywords)', function(data) {
|
||||
var d = data.field;
|
||||
var rule_id = d.rule_id;
|
||||
var key_id = d.key_id;
|
||||
var keywords_name = $.trim(d.keywords_name);
|
||||
var keywords_type = d.keywords_type;
|
||||
var layer_index = d.layer_index;
|
||||
form.verify({
|
||||
length : function(val, dom) {
|
||||
if (val.length > 15) {
|
||||
layer.msg("关键词最多支持15个字");
|
||||
}
|
||||
}
|
||||
});
|
||||
var param = {
|
||||
url : ns.url('wechat://shop/replay/editKeywords'),
|
||||
data : {
|
||||
"rule_id" : rule_id,
|
||||
"keywords_name" : keywords_name,
|
||||
"keywords_type" : keywords_type,
|
||||
"key_id" : key_id
|
||||
},
|
||||
success : function(res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
replay.sendAjax(param);
|
||||
});
|
||||
|
||||
//添加和修改回复
|
||||
form.on('submit(add_reply)', function(data) {
|
||||
var d = data.field;
|
||||
var rule_id = d.rule_id;
|
||||
var key_id = d.key_id;
|
||||
var reply_content = $.trim(d.reply_content);
|
||||
var layer_index = d.layer_index;
|
||||
var type = $("#hidden_reply_type").val() ? $("#hidden_reply_type").val() : "text";
|
||||
var media_id = $('#hidden_media_id').val();
|
||||
|
||||
var param = {
|
||||
url : ns.url('wechat://shop/replay/editReplays'),
|
||||
data : {
|
||||
"rule_id" : rule_id,
|
||||
"reply_content" : reply_content,
|
||||
"key_id" : key_id,
|
||||
"type" : type,
|
||||
'media_id' : media_id
|
||||
},
|
||||
success : function(res) {
|
||||
layer.msg(res.message);
|
||||
if (res.code >= 0) {
|
||||
$('#hidden_media_id').val('');
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
replay.sendAjax(param);
|
||||
});
|
||||
|
||||
//插入链接 确定
|
||||
form.on('submit(hyperlink)', function(data, index) {
|
||||
var d = data.field;
|
||||
var url = d.title;
|
||||
if (url.indexOf('http://') == -1 & url.indexOf('https://') == -1) {
|
||||
url = 'http://' + url;
|
||||
}
|
||||
var content = $("textarea[name='reply_content']").val();
|
||||
$("textarea[name='reply_content']").val(content + url);
|
||||
var text_leng = (content + url).length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
layer.close(layer.index);
|
||||
});
|
||||
|
||||
//音乐 确定
|
||||
form.on('submit(music)', function(data, index) {
|
||||
var d = data.field;
|
||||
var thumb_attachment_id = d.thumb_attachment_id;
|
||||
var title = d.title;
|
||||
var description = d.description;
|
||||
var music_url = d.music_url;
|
||||
var hq_music_url = d.hq_music_url;
|
||||
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="voice-wrapper" data-voice-src="'+music_url+'">';
|
||||
active_pic += '<span class="voice-player">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<span class="stop">点击播放</span>';
|
||||
active_pic += '<span class="second"></span>';
|
||||
active_pic += '<i class="play" style="display:none;"></i>';
|
||||
active_pic += '</span>';
|
||||
active_pic += '</div>';
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(music_url);
|
||||
$("#hidden_reply_type").val('music');
|
||||
layer.close(layer.index);
|
||||
});
|
||||
});
|
||||
|
||||
//关闭 清除
|
||||
$(".js-close").click(function() {
|
||||
$("textarea[name='reply_content']").val('');
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
});
|
||||
|
||||
//清除
|
||||
$("body").off('click', ".js-delete-complex").on('click', ".js-delete-complex", function() {
|
||||
$("textarea[name='reply_content']").val('');
|
||||
$("span.pull-right").show();
|
||||
$('.complex-backdrop').css("display", "none");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//图片回调
|
||||
function materialPicCallBack(data) {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single ng-image">';
|
||||
active_pic += '<a class="picture" target="_blank" href="'+data['url']+'"><img src="' + ns.img(data['path']) + '" alt=""/></a>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("span.pull-right").hide();
|
||||
$("textarea[name='reply_content']").val(data['path']);
|
||||
$("#hidden_reply_type").val('image');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
//图文回调
|
||||
function chooseGraphicMessage(data) {
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">图 文</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
//active_pic += '<a href="'+data.value[0].url+'" target="_blank" class="new-window" title="'+data.value[0].title+'">' + data.value[0].title + '</a>';
|
||||
active_pic += '<a href="javascript:;" title="'+data.value[0].title+'">' + data.value[0].title + '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
// active_pic += '<a href="'+data.value[0].url+'" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<a href="javascript:;" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(data.value[0].title);
|
||||
$("span.pull-right").hide();
|
||||
$("#hidden_reply_type").val('articles');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
function chooseTextMessage(data){
|
||||
var active_pic = '';
|
||||
active_pic += '<div class="ng ng-single">';
|
||||
active_pic += '<a href="javascript:;" class="close--circle js-delete-complex">×</a>';
|
||||
active_pic += '<div class="ng-item">';
|
||||
active_pic += '<span class="label label-success">文 本</span>';
|
||||
active_pic += '<div class="ng-title">';
|
||||
active_pic += '<a href="javascript:;" title="'+data.value.content+'">' + data.value.content + '</a>';
|
||||
active_pic += '</div>';
|
||||
// active_pic += '<a href="h" target="_blank" class="new-window" title="' + data.value.content + '"><span class="label label-success">' + data.value.content + '</span></a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '<div class="ng-item view-more">';
|
||||
active_pic += '<a href="" target="_blank" class="clearfix new-window">';
|
||||
active_pic += '<span class="pull-left">阅读全文</span>';
|
||||
active_pic += '<span class="pull-right">></span>';
|
||||
active_pic += '</a>';
|
||||
active_pic += '</div>';
|
||||
active_pic += '</div>';
|
||||
|
||||
$(".complex-content").html(active_pic);
|
||||
$('.complex-backdrop').css("display", "block");
|
||||
$("textarea[name='reply_content']").val(data.value.content);
|
||||
$("span.pull-right").hide();
|
||||
$("#hidden_reply_type").val('text');
|
||||
$("#hidden_media_id").val(data.media_id);
|
||||
}
|
||||
|
||||
//弹出框的位置
|
||||
$("body").off('click', ".add-reply-menu").on('click', ".add-reply-menu", function() {
|
||||
var x = $(this).position().top;
|
||||
var y = $(this).position().left;
|
||||
var real_x = x - 180;
|
||||
var real_y = y + 120;
|
||||
$('.rule-container').css('top', real_x);
|
||||
$('.rule-container').css('left', real_y);
|
||||
|
||||
var m = '<i class="layui-icon"></i>';
|
||||
$('.rule-container .arrow').html(m);
|
||||
$('.rule-container .arrow').css('right', 'auto');
|
||||
$('.rule-container .arrow').css('left', '-13px');
|
||||
|
||||
$('.pull-right').find('i').text(300);
|
||||
});
|
||||
|
||||
//编辑弹出框的位置
|
||||
$("body").off('click',".js-edit-it").on('click',".js-edit-it", function() {
|
||||
var x = $(this).offset().top;
|
||||
var y = $(this).offset().left;
|
||||
var real_x = x - 220;
|
||||
var real_y = y - 730;
|
||||
$('.rule-container').css('top', real_x);
|
||||
$('.rule-container').css('left', real_y);
|
||||
|
||||
var s = '<i class="layui-icon"></i>';
|
||||
$('.rule-container .arrow').html(s);
|
||||
$('.rule-container .arrow').css('left', 'auto');
|
||||
$('.rule-container .arrow').css('right', 3);
|
||||
|
||||
var text_leng = $('.rule-container').find(".layui-textarea").val().length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
});
|
||||
|
||||
$("body").off('keydown', ".layui-textarea").on('keydown', ".layui-textarea", function() {
|
||||
var text_leng = $(this).val().length;
|
||||
var left_leng = 300 - text_leng;
|
||||
$('.pull-right').find('i').text(left_leng);
|
||||
});
|
||||
|
||||
function search(){
|
||||
var replay = new WxReplay(3, [ 3, 6, 9 ]);
|
||||
var search_text = $("#search_text").val();
|
||||
replay.getData({
|
||||
"_this" : replay,
|
||||
"rule_type" : 'KEYWORDS',
|
||||
"search_text" : search_text
|
||||
});//数据初始化
|
||||
replay.pageInit({
|
||||
"_this" : replay
|
||||
});
|
||||
}
|
||||
</script>
|
||||
278
addon/wechat/shop/view/stat/stat.html
Executable file
@@ -0,0 +1,278 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_access_statistics.css">
|
||||
<script src="SHOP_JS/echarts.min.js"></script>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">用户分析/昨日</span>
|
||||
</div>
|
||||
<div class="layui-card-body access-statistics">
|
||||
<ul class="access-api-list ">
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>新关注人数</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content">{if !empty($yesterday_user_data.new_user)}{$yesterday_user_data.new_user}{else/}0{/if}</p>
|
||||
</li>
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>取消关注人数</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content">{if !empty($yesterday_user_data.cancel_user)}{$yesterday_user_data.cancel_user}{else/}0{/if}</p>
|
||||
</li>
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>净增关注人数</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content">{if !empty($yesterday_user_data.net_growth_user)}{$yesterday_user_data.net_growth_user}{else/}0{/if}</p>
|
||||
</li>
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>累积关注人数</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content">{if !empty($yesterday_user_data.cumulate_user)}{$yesterday_user_data.cumulate_user}{else/}0{/if}</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">接口分析/昨日</span>
|
||||
</div>
|
||||
<div class="layui-card-body access-statistics">
|
||||
<ul class="access-api-list">
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>调用次数</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content">{if !empty($yesterday_interface_data.callback_count)}{$yesterday_interface_data.callback_count}{else/}--{/if}</p>
|
||||
</li>
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>失败率</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content">{if !empty($yesterday_interface_data.fail_count)}{$yesterday_interface_data.fail_count}{else/}--{/if}</p>
|
||||
</li>
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>平均耗时(毫秒)</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content">{if !empty($yesterday_interface_data.callback_count) && !empty($yesterday_interface_data.total_time_cost)}{php}echo round($yesterday_interface_data['total_time_cost']/$yesterday_interface_data['callback_count'],2);{/php}{else/}--{/if}</p>
|
||||
</li>
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>最大耗时(毫秒)</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content">{if !empty($yesterday_interface_data.max_time_cost)}{$yesterday_interface_data.max_time_cost}{else/}--{/if}</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">趋势图</span>
|
||||
</div>
|
||||
<div class="layui-card-body access-statistics">
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="chart_tab">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this" lay-id="user">用户分析</li>
|
||||
<li lay-id="interface">接口分析</li>
|
||||
</ul>
|
||||
<blockquote class="layui-elem-quote" style="margin-top:10px;" >
|
||||
<span class="layui-breadcrumb" lay-separator="|" >
|
||||
<a href="javascript:void(0)" class="layui-breadcrumb-item layui-breadcrumb-active" lay-util="week">最近7天</a>
|
||||
<a href="javascript:void(0)" class="layui-breadcrumb-item" lay-util="month">最近30天</a>
|
||||
</span>
|
||||
</blockquote>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<div id="user_chart" style="width: 100%;height:400px;"></div>
|
||||
</div>
|
||||
<div class="layui-tab-item" id="interface_main">
|
||||
<div id="interface_chart" style="width: 100%;height:400px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var is_render = true;
|
||||
var date_type = "week";
|
||||
layui.use(['element', 'util'], function(){
|
||||
var element = layui.element,
|
||||
util = layui.util;
|
||||
|
||||
usersummarystatistics();
|
||||
element.on('tab(chart_tab)', function(){
|
||||
if(this.getAttribute('lay-id') == "interface" && is_render){
|
||||
is_render = false;
|
||||
interfaceSummaryStatistics();
|
||||
}
|
||||
});
|
||||
|
||||
//按钮事件
|
||||
util.event('lay-util', {
|
||||
week: function(othis){
|
||||
$(".layui-breadcrumb-item").removeClass("layui-breadcrumb-active");
|
||||
$(othis).addClass("layui-breadcrumb-active");
|
||||
date_type = "week";
|
||||
usersummarystatistics();
|
||||
if(is_render == false){
|
||||
interfaceSummaryStatistics();
|
||||
}
|
||||
|
||||
}
|
||||
,month: function(othis){
|
||||
$(".layui-breadcrumb-item").removeClass("layui-breadcrumb-active");
|
||||
$(othis).addClass("layui-breadcrumb-active");
|
||||
date_type = "month";
|
||||
usersummarystatistics();
|
||||
if(is_render == false){
|
||||
interfaceSummaryStatistics();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//折线图
|
||||
if($('#user_chart').length) {
|
||||
var user_chart = echarts.init(document.getElementById('user_chart'));
|
||||
}
|
||||
|
||||
//获取微信公众号用户分析统计数据(按日)
|
||||
function usersummarystatistics(){
|
||||
user_chart.showLoading();//加载视图
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "{:addon_url('wechat://shop/stat/usersummarystatistics')}",
|
||||
dataType: "JSON",
|
||||
data: {date_type : date_type},
|
||||
success: function (result) {
|
||||
var chart_data = result.data;
|
||||
var option = {
|
||||
legend: {
|
||||
data:['新关注人数','取消关注人数','净增关注人数','累积关注人数'],
|
||||
x: 'right',
|
||||
right: '20',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
grid: {
|
||||
left: '20',
|
||||
right: '20',
|
||||
bottom: '20',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: chart_data.date
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: chart_data.data.new_user_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "新关注人数"
|
||||
},
|
||||
{
|
||||
data: chart_data.data.cancel_user_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "取消关注人数"
|
||||
},
|
||||
{
|
||||
data: chart_data.data.net_growth_user_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "净增关注人数"
|
||||
},
|
||||
{
|
||||
data: chart_data.data.cumulate_user_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "累积关注人数"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
user_chart.setOption(option);
|
||||
user_chart.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//获取微信公众号接口调用统计数据(按日)
|
||||
function interfaceSummaryStatistics(){
|
||||
if(!$('#interface_chart').length) return;
|
||||
var interface_chart = echarts.init(document.getElementById('interface_chart'));
|
||||
interface_chart.showLoading();//加载视图
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "{:addon_url('wechat://shop/stat/interfaceSummaryStatistics')}",
|
||||
dataType: "JSON",
|
||||
data: {date_type : date_type},
|
||||
success: function (result) {
|
||||
var chart_data = result.data;
|
||||
var option = {
|
||||
legend: {
|
||||
data:['调用次数','失败率','平均耗时','最大耗时'],
|
||||
x: 'right',
|
||||
right: '20',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
grid: {
|
||||
left: '20',
|
||||
right: '20',
|
||||
bottom: '20',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: chart_data.date
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: chart_data.data.callback_count_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "调用次数"
|
||||
},
|
||||
{
|
||||
data: chart_data.data.fail_count_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "失败率"
|
||||
},
|
||||
{
|
||||
data: chart_data.data.average_time_cost_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "平均耗时"
|
||||
},
|
||||
{
|
||||
data: chart_data.data.max_time_cost_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "最大耗时"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
interface_chart.setOption(option);
|
||||
interface_chart.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
88
addon/wechat/shop/view/wechat/add_qrcode.html
Executable file
@@ -0,0 +1,88 @@
|
||||
<style>
|
||||
.table { display: flex; }
|
||||
.qrcode { width: 320px; height: 569px; background: #f5f5f5; position: relative; border: 1px solid #e1e1e1;margin-right: 10px;}
|
||||
.qrcode #imgLogo { max-width: 320px; max-height: 569px; }
|
||||
#header { width: 45px; height: 45px; position: absolute; left: 59px; top: 15px; cursor: move; }
|
||||
#logo { width: 43px; position: absolute; left: 60px; top: 210px; cursor: move; }
|
||||
#code{ width: 144px; height: 144px; position: absolute; left: 70px; top: 300px; cursor: move;}
|
||||
#name{ font-size: 14px; color: #000; position: absolute; left: 128px; top: 23px; cursor: move;}
|
||||
</style>
|
||||
|
||||
<div class="table">
|
||||
<div class="qrcode" id="divBlock">
|
||||
<img id="imgLogo">
|
||||
<img class="tdrag-header" id="header" src="WECHAT_IMG/icon-header.png">
|
||||
<img class="tdrag-logo" id="logo" src="__STATIC__/img/bitbug_favicon.ico">
|
||||
<img class="tdrag-code" id="code" src="WECHAT_IMG/template_qrcode.png">
|
||||
<span class="tdrag-name" id="name">昵称</span>
|
||||
</div>
|
||||
|
||||
<div class="layui-form form-wrap">
|
||||
<input type="hidden" name="nick_font_color" value="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">背景图片:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="upload-img-block">
|
||||
<!-- 用于存储图片路径 -->
|
||||
<div class="upload-img-box">
|
||||
<div class="upload-default" id="background">
|
||||
<div class="upload">
|
||||
<i class="iconfont iconshangchuan"></i>
|
||||
<p>点击上传</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="operation">
|
||||
<div>
|
||||
<i title="图片预览" class="iconfont iconreview js-preview" style="margin-right: 20px;"></i>
|
||||
<i title="删除图片" class="layui-icon layui-icon-delete js-delete"></i>
|
||||
</div>
|
||||
<div class="replace_img js-replace">点击替换</div>
|
||||
</div>
|
||||
<input type="hidden" name="background" />
|
||||
</div>
|
||||
<!-- <p id="background" class="no-replace">替换</p>
|
||||
|
||||
<i class="del">x</i> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="word-aux">背景图必须是640px*1134px的png图像;点击下方"保存"按钮后生效。</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">昵称文本颜色:</label>
|
||||
<div class="layui-input-inline">
|
||||
<div id="font_color"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">昵称字体大小:</label>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input id="font_size" min="8" max="50" name="nick_font_size" value="23" type="number" lay-verify="int" class="layui-input len-short">
|
||||
</div>
|
||||
<div class="layui-form-mid">px</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否显示logo:</label>
|
||||
<div class="layui-input-block" id="isOpen">
|
||||
<input type="checkbox" name="is_logo_show" checked lay-skin="switch" lay-filter="logo" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="backWechatQrcode()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var default_color = '#000000';
|
||||
var url = ns.url("wechat://shop/wechat/addQrcode");
|
||||
</script>
|
||||
<script src="STATIC_JS/Tdrag.min.js"></script>
|
||||
<script src="WECHAT_JS/wx_qrcode.js"></script>
|
||||
278
addon/wechat/shop/view/wechat/config.html
Executable file
@@ -0,0 +1,278 @@
|
||||
<style>
|
||||
.form-row{margin-top: 0;}
|
||||
</style>
|
||||
|
||||
<div class="layui-form">
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">微信公众号设置</span>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">公众号名称:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="wechat_name" autocomplete="off" value="{$config.value.wechat_name ?? ''}" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">原始ID:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="wechat_original" autocomplete="off" value="{$config.value.wechat_original ?? ''}" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">公众号二维码:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="upload-img-block square">
|
||||
<div class="upload-img-box {if condition="$config.value && $config.value.qrcode"}hover{/if}" >
|
||||
<div class="upload-default " id="img">
|
||||
{if condition="$config.value && $config.value.qrcode"}
|
||||
<div id="preview_img" class="preview_img">
|
||||
<img layer-src src="{:img($config.value.qrcode)}" class="img_prev"/>
|
||||
</div>
|
||||
{else/}
|
||||
<div class="upload">
|
||||
<i class="iconfont iconshangchuan"></i>
|
||||
<p>点击上传</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="operation">
|
||||
<div>
|
||||
<i title="图片预览" class="iconfont iconreview js-preview" style="margin-right: 20px;"></i>
|
||||
<i title="删除图片" class="layui-icon layui-icon-delete js-delete"></i>
|
||||
</div>
|
||||
|
||||
<div class="replace_img js-replace">点击替换</div>
|
||||
</div>
|
||||
<input type="hidden" class="layui-input" name="qrcode" value="{$config.value.qrcode ?? ''}"/>
|
||||
</div>
|
||||
<!-- <p id="img" class=" {if condition="$config.value && $config.value.qrcode"} replace {else/} no-replace{/if}">替换</p>
|
||||
<i class="del {if condition="$config.value && $config.value.qrcode"}show{/if}">x</i> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="layui-form-item">
|
||||
<label class="layui-form-label">重新授权:</label>
|
||||
<div class="layui-input-block">
|
||||
<a class="text-color " onclick="auth();">去授权</a>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">开发设置</span>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">APPID:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="appid" autocomplete="off" value="{$config.value.appid ?? ''}" class="layui-input len-long">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">APP密钥:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="appsecret" autocomplete="off" value="{$config.value.appsecret ?? ''}" class="layui-input len-long">
|
||||
</div>
|
||||
<div class="word-aux">AppID和Appsecret来自于您申请开发接口时提供的账号和密码,且公众号为已认证服务号</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">业务域名校验文件:</label>
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-primary" id="checkFile">上传文件</button>
|
||||
</div>
|
||||
<div class="word-aux">仅支持上传TXT格式的文件</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">公众平台通信</span>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">Token:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="token" autocomplete="off" id="empowerToken" class="layui-input len-long" value="{$config.value.token ?? ''}">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" onclick="ns.copy('empowerToken')">复制</button>
|
||||
<div class="word-aux">Token必须为英文或数字,长度为3-32字符。如不填写则默认为“TOKEN”。</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">URL:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" readonly autocomplete="off" id="call_back_url" class="layui-input len-long" value="{$call_back_url}">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" onclick="ns.copy('call_back_url')">复制</button>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">EncodingAESKey:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" name="encodingaeskey" id="EncodingAESKey" class="layui-input len-long" value="{$config.value.encodingaeskey ?? ''}">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" onclick="ns.copy('EncodingAESKey')">复制</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">配置说明</span>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">业务域名:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" readonly autocomplete="off" id="public_url" class="layui-input len-long" value="{$url}">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" onclick="ns.copy('public_url')">复制</button>
|
||||
<div class="word-aux">
|
||||
设置业务域名(设置业务域名,用户在相应域名上进行输入时不再出现防欺诈盗号等安全提示)<br/>
|
||||
<a href="https://mp.weixin.qq.com/" target="_blank">登录微信公众平台</a>点击公众号设置>功能设置>业务域名设置,一次填写:<br/>
|
||||
域名:{$url}<br/>
|
||||
<a href="https://mp.weixin.qq.com/" target="_blank">登录微信公众平台</a>点击公众号设置>开发者中心>网页授权获取用户基本信息>修改
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">授权域名:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" readonly autocomplete="off" id="auth_url" class="layui-input len-long" value="{$url}">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" onclick="ns.copy('auth_url')">复制</button>
|
||||
<div class="word-aux">
|
||||
填写授权回调页面域名业务域名设置完毕!
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common">
|
||||
<div class="layui-card-body">
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="backWechatSetting()">返回</button>
|
||||
<a id="imageQrcode"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var saveData = null;
|
||||
var totalUploadNum = 0;
|
||||
var completeUploadNum = 0;
|
||||
var upload;
|
||||
|
||||
layui.use(['form'], function () {
|
||||
var form = layui.form,
|
||||
repeat_flag = false; //防重复标识
|
||||
form.render();
|
||||
|
||||
form.on('submit(save)', function(data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
|
||||
saveData = data;
|
||||
var obj = $("img.img_prev[data-prev='1']");
|
||||
totalUploadNum = obj.length;
|
||||
if(totalUploadNum > 0){
|
||||
obj.each(function(){
|
||||
var actionId = $(this).attr('data-action-id');
|
||||
$(actionId).click();
|
||||
})
|
||||
}else{
|
||||
saveFunc();
|
||||
}
|
||||
});
|
||||
|
||||
upload = new Upload({
|
||||
elem: '#img',
|
||||
auto: false,
|
||||
bindAction:'#imageQrcode',
|
||||
callback: function(res) {
|
||||
uploadComplete('qrcode', res.data.pic_path);
|
||||
}
|
||||
});
|
||||
|
||||
var file_upload = new Upload({
|
||||
elem: '#checkFile',
|
||||
url: ns.url("shop/upload/checkfile"),
|
||||
accept: 'file',
|
||||
acceptMime: 'text/plain',
|
||||
exts: 'txt'
|
||||
});
|
||||
|
||||
function uploadComplete(field, pic_path) {
|
||||
saveData.field[field] = pic_path;
|
||||
completeUploadNum += 1;
|
||||
if(completeUploadNum == totalUploadNum){
|
||||
saveFunc();
|
||||
}
|
||||
}
|
||||
|
||||
function saveFunc(){
|
||||
var data = saveData;
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "{:addon_url('wechat://shop/wechat/config')}",
|
||||
dataType: "JSON",
|
||||
data: data.field,
|
||||
success: function(data) {
|
||||
repeat_flag = false;
|
||||
layer.msg(data.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function backWechatSetting() {
|
||||
location.hash = ns.hash('wechat://shop/wechat/setting');
|
||||
}
|
||||
|
||||
/**
|
||||
* 去授权
|
||||
*/
|
||||
function auth(){
|
||||
|
||||
window.open("{:href_url('wxoplatform://shop/oplatform/auth', ['auth_type' => 'wechat'])}");
|
||||
//询问框
|
||||
layer.confirm('请在新窗口中继续授权', {
|
||||
title:'提示',
|
||||
btn: ['重新授权','已完成授权'] //按钮
|
||||
}, function(){
|
||||
layer.closeAll();
|
||||
auth();
|
||||
}, function(){
|
||||
layer.closeAll();
|
||||
//验证是否授权
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "{:addon_url('wxoplatform://shop/oplatform/wechatsettled')}",
|
||||
dataType: "JSON",
|
||||
success: function(data) {
|
||||
if(data.code >= 0){
|
||||
location.hash = ns.hash('wechat://shop/wechat/setting');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
97
addon/wechat/shop/view/wechat/edit_qrcode.html
Executable file
@@ -0,0 +1,97 @@
|
||||
<style>
|
||||
.table { display: flex; }
|
||||
.qrcode { width: 320px; height: 569px; background: #f5f5f5; position: relative; border: 1px solid #e1e1e1;margin-right: 10px;}
|
||||
.qrcode #imgLogo { max-width: 320px; max-height: 569px; }
|
||||
#header { width: 45px; height: 45px; position: absolute; left: 59px; top: 15px; cursor: move; }
|
||||
#logo { width: 43px; position: absolute; left: 60px; top: 210px; cursor: move; }
|
||||
#code{ width: 144px; height: 144px; position: absolute; left: 70px; top: 300px; cursor: move;}
|
||||
#name{ font-size: 14px; color: #000; position: absolute; left: 128px; top: 23px; cursor: move;}
|
||||
</style>
|
||||
|
||||
<div class="table">
|
||||
<div class="qrcode" id="divBlock">
|
||||
{if $info['background']}
|
||||
<img id="imgLogo" src="{:img($info['background'])}">
|
||||
{else/ }
|
||||
<img id="imgLogo">
|
||||
{/if}
|
||||
<img class="tdrag-header" id="header" src="WECHAT_IMG/icon-header.png" style="left:{$info['header_left']};top:{$info['header_top']};">
|
||||
<img class="tdrag-logo" id="logo" src="__STATIC__/img/bitbug_favicon.ico" style="left:{$info['logo_left']};top:{$info['logo_top']};{if $info["is_logo_show"] == 0}display:none;{/if}">
|
||||
<img class="tdrag-code" id="code" src="WECHAT_IMG/template_qrcode.png" style="left:{$info['code_left']};top:{$info['code_top']};">
|
||||
<span class="tdrag-name" id="name" style="left:{$info['name_left']};top:{$info['name_top']};color:{$info['nick_font_color']};font-size:{$info['nick_font_size']}px;">昵称</span>
|
||||
</div>
|
||||
<div class="layui-form form-wrap">
|
||||
<input type="hidden" name="id" value="{$info['id']}">
|
||||
<input type="hidden" name="nick_font_color" value="{$info['nick_font_color']}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">背景图片:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="upload-img-block">
|
||||
<!-- 用于存储图片路径 -->
|
||||
<div class="upload-img-box {if $info['background']}hover{/if}">
|
||||
<div class="upload-default" id="background">
|
||||
{if $info['background']}
|
||||
<div id="preview_background" class="preview_img">
|
||||
<img layer-src src="{:img($info['background'])}" class="img_prev">
|
||||
</div>
|
||||
{else /}
|
||||
<div class="upload">
|
||||
<i class="iconfont iconshangchuan"></i>
|
||||
<p>点击上传</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="operation">
|
||||
<div>
|
||||
<i title="图片预览" class="iconfont iconreview js-preview" style="margin-right: 20px"></i>
|
||||
<i title="删除图片" class="layui-icon layui-icon-delete js-delete" ></i>
|
||||
</div>
|
||||
|
||||
<div class="replace_img js-replace">点击替换</div>
|
||||
</div>
|
||||
<input type="hidden" name="background" value="{$info['background']}" />
|
||||
</div>
|
||||
<!-- <p id="background" class=" {if condition="$info['background']"} replace {else/} no-replace{/if}">替换</p>
|
||||
<i class="del {if $info['background']}show{/if}">x</i> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="word-aux">背景图必须是640px*1134px的png图像;点击下方"保存"按钮后生效。</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">昵称文本颜色:</label>
|
||||
<div class="layui-input-inline">
|
||||
<div id="font_color"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">昵称字体大小:</label>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input id="font_size" min="8" max="50" name="nick_font_size" value="{$info['nick_font_size']}" type="number" lay-verify="int" class="layui-input len-short">
|
||||
</div>
|
||||
<div class="layui-form-mid">px</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否显示logo:</label>
|
||||
<div class="layui-input-block" id="isOpen">
|
||||
<input type="checkbox" name="is_logo_show" {if $info['is_logo_show']}checked{/if} lay-skin="switch" lay-filter="logo" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="backWechatQrcode()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var default_color = '{$info["nick_font_color"]}'?'{$info["nick_font_color"]}':'#000000';
|
||||
var url = ns.url("wechat://shop/wechat/editQrcode");
|
||||
</script>
|
||||
<script src="STATIC_JS/Tdrag.min.js"></script>
|
||||
<script src="WECHAT_JS/wx_qrcode.js"></script>
|
||||
390
addon/wechat/shop/view/wechat/fans.html
Executable file
@@ -0,0 +1,390 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_fans.css">
|
||||
|
||||
<div lay-filter="search_form">
|
||||
<button class="layui-btn layui-btn-xs" onclick="refresh()">同步粉丝信息</button>
|
||||
<div class="layui-form">
|
||||
<div class="layui-input-inline">
|
||||
<select name="is_subscribe">
|
||||
<option value="">全部</option>
|
||||
<option value="1">已关注</option>
|
||||
<option value="0">取消关注</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-inline" >
|
||||
<input type="text" name="nickname" placeholder="请输入粉丝名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
|
||||
<button class='layui-btn layui-btn-primary' lay-submit lay-filter="searchForm">筛选</button>
|
||||
</div>
|
||||
<!-- <div class="form-row sm">
|
||||
<button class='layui-btn' lay-submit lay-filter="searchForm">筛选</button>
|
||||
<button type="reset" class='reset' onclick="reset()">重置搜索条件</button>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="progress-layer">
|
||||
<h3>正在同步中,已完成...</h3>
|
||||
<div class="layui-progress layui-progress-big" lay-showPercent="true" lay-filter="progress">
|
||||
<div class="layui-progress-bar layui-bg-blue" lay-percent="0%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<table id="wechat_fans" lay-filter="wechat_fans" class="layui-table"></table>
|
||||
</div>
|
||||
<script type="text/html" id="nickname">
|
||||
<span>{{ d.nickname }}</span>
|
||||
<div class="tag-list">
|
||||
{{# if(d.tagid_list_arr != undefined) { }}
|
||||
{{# for(var i = 0;i < d.tagid_list_arr.length; i++){ }}
|
||||
<span class="bg-color">{{ d.tagid_list_arr[i].tag_name }}</span>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="headimgurl">
|
||||
<div class="headimg-box">
|
||||
<img src="{{d.headimgurl}}"/>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="address">
|
||||
<div>{{d.address}}</div>
|
||||
</script>
|
||||
<script type="text/html" id="is_subscribe">
|
||||
{{# if(d.is_subscribe==1){ }}
|
||||
<span>已关注</span>
|
||||
{{# } else { }}
|
||||
<span>已取消关注</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
<script type="text/html" id="subscribe_time">
|
||||
<div>{{ ns.time_to_date(d.subscribe_time)}}</div>
|
||||
</script>
|
||||
<script type="text/html" id="unsubscribe_time">
|
||||
<div>{{ ns.time_to_date(d.unsubscribe_time)}}</div>
|
||||
</script>
|
||||
<script type="text/html" id="operation">
|
||||
<a class="default" lay-event="tagging">打标签</a>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="batchOperation">
|
||||
<button class="layui-btn layui-btn-primary" lay-filter="sync" lay-submit>同步信息</button>
|
||||
<button class="layui-btn layui-btn-primary" lay-filter="tagging" lay-submit>打标签</button>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="selectTags">
|
||||
<div class="layui-form" lay-filter="selectTags">
|
||||
{notempty name="tag_list"}
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
{foreach name="tag_list" item="vo"}
|
||||
<input type="checkbox" name="tagId" value="{$vo.tag_id}" lay-skin="primary" title="{$vo.tag_name}" {{ $.inArray('{$vo.tag_id}', d.checkedIds) >= 0 ? 'checked disabled' : '' }}>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/notempty}
|
||||
<div class="layui-form-mid layui-word-aux">
|
||||
<a href="{:href_url('Wechat://shop/fans/fansTag')}" class="default">新建标签</a>
|
||||
</div>
|
||||
<div class="layui-form-item align-center">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="taggingSubmit">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="selectTagsAlone">
|
||||
<div class="layui-form" lay-filter="selectTagsAlone">
|
||||
{notempty name="tag_list"}
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline">
|
||||
{foreach name="tag_list" item="vo"}
|
||||
<input type="checkbox" name="tagId" value="{$vo.tag_id}" lay-skin="primary" title="{$vo.tag_name}" {{ $.inArray('{$vo.tag_id}', d.checkedIds) >= 0 ? 'checked' : '' }}>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/notempty}
|
||||
<input type="hidden" name="openid" value="{{d.openid}}">
|
||||
<input type="hidden" name="tagid_list" value="{{d.tagid_list}}">
|
||||
<div class="layui-form-mid layui-word-aux">
|
||||
<a href="{:href_url('Wechat://shop/fans/fansTag')}" class="default">新建标签</a>
|
||||
</div>
|
||||
<div class="layui-form-item align-center">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="taggingAloneSubmit">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var page_index = 0,
|
||||
page_count = 0,
|
||||
progress_element,
|
||||
form,
|
||||
laydate,
|
||||
laytpl;
|
||||
|
||||
var table = new Table({
|
||||
elem : '#wechat_fans',
|
||||
filter: "wechat_fans",
|
||||
url : "{:addon_url('Wechat://shop/fans/index')}",
|
||||
cols : [[
|
||||
{type : 'checkbox',width: '3%',unresize : 'true'},
|
||||
{field : 'headimgurl', title : '粉丝头像', templet : '#headimgurl', width: '9%', minWidth: '100px',unresize : 'true'},
|
||||
{field : 'nickname', title : '粉丝名称', templet: '#nickname', width: '20%', minWidth: '150px',unresize : 'true'},
|
||||
{field : 'address', title : '地址', templet: '#address', width: '20%', minWidth: '300px',unresize : 'true'},
|
||||
{field : 'is_subscribe', title : '关注状态', templet : '#is_subscribe', width: '9%', minWidth: '100px',unresize : 'true'},
|
||||
{field : 'subscribe_time', title : '关注时间', templet: '#subscribe_time', width: '15%', minWidth: '150px',unresize : 'true'},
|
||||
{field : 'unsubscribe_time', title : '取消关注时间', templet: '#unsubscribe_time', width: '15%', minWidth: '150px',unresize : 'true'},
|
||||
{title : '操作', toolbar : '#operation',unresize : 'true',align: 'right' }
|
||||
]],
|
||||
bottomToolbar : "#batchOperation"
|
||||
});
|
||||
|
||||
table.tool(function(obj){
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case 'tagging':
|
||||
var checkedIds = [];
|
||||
if (data.tagid_list != '') checkedIds = data.tagid_list.split(',');
|
||||
laytpl($("#selectTagsAlone").html()).render({checkedIds : checkedIds, openid : data.openid, tagid_list : data.tagid_list}, function(html){
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '选择标签',
|
||||
skin: 'layer-tips-class',
|
||||
area: ['550px','auto'],
|
||||
content: html
|
||||
});
|
||||
form.render();
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
layui.use([ 'form', 'laydate', 'laytpl'], function() {
|
||||
form = layui.form;
|
||||
laydate = layui.laydate;
|
||||
progress_element = layui.element;
|
||||
laytpl = layui.laytpl;
|
||||
form.render();
|
||||
|
||||
var daterange = '{:date("Y-m-d h:m:s", strtotime("-6 days"))} 至 {:date("Y-m-d h:m:s")}';
|
||||
//渲染时间
|
||||
laydate.render({
|
||||
elem: '#daterange'
|
||||
,type: 'datetime'
|
||||
,range: '至'
|
||||
,value: daterange
|
||||
});
|
||||
|
||||
form.on('submit(searchForm)', function(data){
|
||||
var strs = $("#daterange").val().split(" - ");
|
||||
var field = data.field;
|
||||
field.start_time = strs[0];
|
||||
field.end_time = strs[1];
|
||||
table.reload({
|
||||
where: field,
|
||||
page: {
|
||||
curr : 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
// 同步粉丝信息
|
||||
form.on('submit(sync)', function(data){
|
||||
var checkStatus = table.checkStatus();
|
||||
if (checkStatus.data.length > 0) {
|
||||
} else {
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
|
||||
// 给粉丝打标签
|
||||
form.on('submit(tagging)', function(data){
|
||||
var checkStatus = table.checkStatus();
|
||||
if (checkStatus.data.length > 0) {
|
||||
var checkedIds = [];
|
||||
$.each(checkStatus.data, function (index, el) {
|
||||
if(el.tagid_list != '') {
|
||||
checkedIds = concat(checkedIds, el.tagid_list.split(','));
|
||||
}
|
||||
});
|
||||
laytpl($("#selectTags").html()).render({checkedIds : checkedIds}, function(html){
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '选择标签',
|
||||
skin: 'layer-tips-class',
|
||||
area: ['550px','auto'],
|
||||
content: html
|
||||
});
|
||||
form.render();
|
||||
});
|
||||
} else {
|
||||
layer.msg('请选择要操作的数据');
|
||||
}
|
||||
});
|
||||
|
||||
// 批量为粉丝设置标签
|
||||
form.on('submit(taggingSubmit)', function(data){
|
||||
var tagidArr =[], openidArr = [];
|
||||
$('[lay-filter="selectTags"] [name="tagId"]:checked').each(function(index, el) {
|
||||
tagidArr.push($(el).val());
|
||||
});
|
||||
var checkStatus = table.checkStatus();
|
||||
if (checkStatus.data.length > 0) {
|
||||
$.each(checkStatus.data, function (index, el) {
|
||||
openidArr.push(el.openid);
|
||||
})
|
||||
}
|
||||
if (openidArr.length) {
|
||||
$.ajax({
|
||||
type : "post",
|
||||
async : false,
|
||||
url : '{:addon_url("Wechat://shop/fans/fansBatchTagging")}',
|
||||
dataType: 'json',
|
||||
data : {
|
||||
tag_id : tagidArr.toString(),
|
||||
openid : openidArr.toString()
|
||||
},
|
||||
success:function(res){
|
||||
back();
|
||||
layer.msg(res.message);
|
||||
if(res.code == 0){
|
||||
table.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
form.on('submit(taggingAloneSubmit)', function(data){
|
||||
var tagidArr = [], cancelTagidArr = [],
|
||||
original = data.field.tagid_list != '' ? data.field.tagid_list.split(',') : [];
|
||||
|
||||
$('[lay-filter="selectTagsAlone"] [name="tagId"]:checked').each(function(index, el) {
|
||||
tagidArr.push($(el).val());
|
||||
});
|
||||
|
||||
if (tagidArr.length != original.length) {
|
||||
if (tagidArr.length == 0) {
|
||||
cancelTagidArr = original;
|
||||
} else {
|
||||
original.forEach(function(val){
|
||||
if ($.inArray(val, tagidArr) < 0) {
|
||||
cancelTagidArr.push(val);
|
||||
}
|
||||
})
|
||||
}
|
||||
$.ajax({
|
||||
type : "post",
|
||||
async : false,
|
||||
url : '{:addon_url("Wechat://shop/fans/fansTagging")}',
|
||||
dataType: 'json',
|
||||
data : {
|
||||
tagid_list : tagidArr.toString(),
|
||||
cancel_tagid_list : cancelTagidArr.toString(),
|
||||
openid : data.field.openid
|
||||
},
|
||||
success:function(res){
|
||||
back();
|
||||
layer.msg(res.message);
|
||||
if(res.code == 0){
|
||||
table.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 更新粉丝列表
|
||||
var repeat_flag = false;//防重复标识
|
||||
function refresh() {
|
||||
if(repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type : "post",
|
||||
url : "{:addon_url('Wechat://shop/fans/updateWchatFansList')}",
|
||||
data : {
|
||||
"page" : page_index,
|
||||
},
|
||||
dataType : "JSON",
|
||||
beforeSend : function() {
|
||||
$(".progress-layer").fadeIn();
|
||||
},
|
||||
success : function(data) {
|
||||
repeat_flag = false;
|
||||
if (data.code != 0 && data.code != undefined) {
|
||||
layer.msg(data.message);
|
||||
$(".progress-layer").fadeOut();
|
||||
} else if (data.code == 0) {
|
||||
if (data.data == null) {
|
||||
$(".progress-layer").fadeOut();
|
||||
}
|
||||
if (page_index == 0) {
|
||||
page_count = data['data']["page_count"];
|
||||
}
|
||||
if (page_index <= page_count) {
|
||||
var speed_of_progress = (page_index / page_count * 100).toFixed(2);
|
||||
progress_element.progress('progress', speed_of_progress + '%');
|
||||
}
|
||||
if (page_index < page_count) {
|
||||
page_index = parseInt(page_index) + 1;
|
||||
refresh();
|
||||
} else {
|
||||
table.reload();
|
||||
}
|
||||
} else {
|
||||
layer.msg('更新失败');
|
||||
$(".progress-layer").fadeOut();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function datePick(date_num,event_obj){
|
||||
$(".date-picker-btn").removeClass("selected");
|
||||
$(event_obj).addClass('selected');
|
||||
Date.prototype.Format = function (fmt,date_num) {
|
||||
this.setDate(this.getDate()-date_num);
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
};
|
||||
var now_time = new Date().Format("yyyy-MM-dd HH:mm:ss",0);//当前日期
|
||||
var before_time = new Date().Format("yyyy-MM-dd HH:mm:ss",date_num-1);//前几天日期
|
||||
|
||||
var daterange = before_time +' - ' + now_time;
|
||||
$("#daterange").val(daterange);
|
||||
}
|
||||
|
||||
function reset() {
|
||||
form.render();
|
||||
laydate.render({
|
||||
elem: '#start_date',
|
||||
type: 'datetime'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#end_date',
|
||||
type: 'datetime'
|
||||
});
|
||||
}
|
||||
|
||||
function concat(arr1,arr2){
|
||||
var arr = arr1.concat();
|
||||
for(var i=0;i<arr2.length;i++){
|
||||
arr.indexOf(arr2[i]) === -1 ? arr.push(arr2[i]) : 0;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
</script>
|
||||
124
addon/wechat/shop/view/wechat/qrcode.html
Executable file
@@ -0,0 +1,124 @@
|
||||
<link rel="stylesheet" href="WECHAT_CSS/wx_qrcode.css">
|
||||
|
||||
<div class="single-filter-box">
|
||||
<button class="layui-btn" onclick="load_url()">添加自定义模板</button>
|
||||
</div>
|
||||
|
||||
<div class='qrcode-body'>
|
||||
|
||||
<div id="pictureIndex" class="ncsc-picture-folder">
|
||||
<div class="ncsc-album">
|
||||
<div style="clear:both;"></div>
|
||||
<ul id="albumList" >
|
||||
|
||||
{foreach name="template_list['list']" item="info"}
|
||||
<li onmouseover="checkShowThis(this);" onmouseout="checkHideThis(this);" >
|
||||
|
||||
{if condition="$info.is_default == 1 "}
|
||||
<div class="qrcode" id="divBlock" style="border:1px solid var(--base-color);">
|
||||
{else/}
|
||||
<div class="qrcode" id="divBlock" style="border:1px solid #e1e1e1;">
|
||||
{/if}
|
||||
{if condition="$info.background"}
|
||||
<img src="{:img($info.background)}" class="img-block" />
|
||||
{/if}
|
||||
<img class="tdrag-header" src="WECHAT_IMG/icon-header.png" style="left:{$info['header_left']};top:{$info['header_top']};">
|
||||
<img class="tdrag-logo" src="__STATIC__/img/bitbug_favicon.ico" style="left:{$info['logo_left']};top:{$info['logo_top']};{if $info["is_logo_show"] == 0}display:none;{/if}">
|
||||
<img class="tdrag-code" src="WECHAT_IMG/template_qrcode.png" style="left:{$info['code_left']};top:{$info['code_top']};">
|
||||
<span class="tdrag-name" style="left:{$info['name_left']};top:{$info['name_top']};color:{$info['nick_font_color']};font-size:{$info['nick_font_size']}px;">昵称</span>
|
||||
</div>
|
||||
|
||||
<div class="check" >
|
||||
{if condition="$info.is_default == 1 "}
|
||||
<div onclick="modifyWeixinQrcode({$info.id})" style="margin-top:60%;cursor:pointer;">
|
||||
<span>编辑</span>
|
||||
</div>
|
||||
{else /}
|
||||
<div style="margin-top:50%;cursor:pointer;" onclick="modifyWeixinQrcodeTemplateValid({$info.id})">
|
||||
<span >设为默认</span>
|
||||
</div>
|
||||
<div onclick="deleteWeixinQrcodeTemplateValid({$info.id})" style="cursor:pointer;">
|
||||
<span>删除</span>
|
||||
</div>
|
||||
<div onclick="modifyWeixinQrcode({$info.id})" style="cursor:pointer;">
|
||||
<span>编辑</span>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<input type="hidden" class="id" value="{$info.id}"/>
|
||||
<input type="hidden" class="background" value="{$info.background}"/>
|
||||
<input type="hidden" class="nick_font_color" value="{$info.nick_font_color}"/>
|
||||
<input type="hidden" class="nick_font_size" value="{$info.nick_font_size}"/>
|
||||
<input type="hidden" class="is_logo_show" value="{$info.is_logo_show}"/>
|
||||
<input type="hidden" class="header_left" value="{$info.header_left}"/>
|
||||
<input type="hidden" class="header_top" value="{$info.header_top}"/>
|
||||
<input type="hidden" class="name_left" value="{$info.name_left}"/>
|
||||
<input type="hidden" class="name_top" value="{$info.name_top}"/>
|
||||
<input type="hidden" class="logo_left" value="{$info.logo_left}"/>
|
||||
<input type="hidden" class="logo_top" value="{$info.logo_top}"/>
|
||||
<input type="hidden" class="code_left" value="{$info.code_left}"/>
|
||||
<input type="hidden" class="code_top" value="{$info.code_top}"/>
|
||||
<div>
|
||||
{if condition="$info.is_default == 1 "}
|
||||
<img src="WECHAT_IMG/check_qrcode1.png" class="qrcode_img" style="position:absolute;top:0px;left:1px;"/>
|
||||
{else /}
|
||||
<img src="WECHAT_IMG/check_qrcode1.png" class="qrcode_img" style="position:absolute;top:0px;leftt:1px;display:none;"/>
|
||||
{/if}
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function checkShowThis(event){
|
||||
$(".qrcode_button").hide();
|
||||
$(".check").hide();
|
||||
$(event).find(".qrcode_button").show();
|
||||
$(event).find(".check").show();
|
||||
}
|
||||
function checkHideThis(event){
|
||||
$(event).find(".qrcode_button").hide();
|
||||
$(event).find(".check").hide();
|
||||
}
|
||||
|
||||
//上传配置
|
||||
|
||||
//设置店铺的模板为默认
|
||||
function modifyWeixinQrcodeTemplateValid(id){
|
||||
$.ajax({
|
||||
type : "post",
|
||||
url : "{:addon_url('Wechat://shop/wechat/qrcodeDefault')}",
|
||||
data : { 'id' : id },
|
||||
dataType : "JSON",
|
||||
success : function(data) {
|
||||
layer.msg(data.message);
|
||||
location.hash = ns.hash("wechat://shop/wechat/qrcode");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function deleteWeixinQrcodeTemplateValid(id){
|
||||
$.ajax({
|
||||
type : "post",
|
||||
url : "{:addon_url('Wechat://shop/wechat/deleteQrcode')}",
|
||||
data : { 'id' : id },
|
||||
dataType : "JSON",
|
||||
success : function(data) {
|
||||
layer.msg(data.message);
|
||||
location.hash = ns.hash("wechat://shop/wechat/qrcode");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function load_url(){
|
||||
location.hash = ns.hash('wechat://shop/wechat/addqrcode');
|
||||
}
|
||||
|
||||
function modifyWeixinQrcode(id){
|
||||
location.hash = ns.hash('wechat://shop/wechat/editQrcode', {'id' : id});
|
||||
}
|
||||
</script>
|
||||
102
addon/wechat/shop/view/wechat/setting.html
Executable file
@@ -0,0 +1,102 @@
|
||||
<style>
|
||||
.progress-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
min-height: 120px;
|
||||
}
|
||||
|
||||
.progress-point {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.progress-point-pic {
|
||||
display: inline-block;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.progress-point-pic img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">微信公众号使用流程</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<ul class="progress-wrap">
|
||||
<li class="progress-point">
|
||||
<div class="progress-point-pic">
|
||||
<img src="WECHAT_IMG/flow/register.png" alt="">
|
||||
</div>
|
||||
<p class="progress-point-text">注册微信公众号</p>
|
||||
</li>
|
||||
<li class="progress-point-arrow">
|
||||
<img src="WECHAT_IMG/flow/arrow.png" alt="">
|
||||
</li>
|
||||
<li class="progress-point">
|
||||
<div class="progress-point-pic">
|
||||
<img src="WECHAT_IMG/config_info.png" alt="">
|
||||
</div>
|
||||
<p class="progress-point-text">配置微信链接</p>
|
||||
</li>
|
||||
<li class="progress-point-arrow">
|
||||
<img src="WECHAT_IMG/flow/arrow.png" alt="">
|
||||
</li>
|
||||
<li class="progress-point">
|
||||
<div class="progress-point-pic">
|
||||
<img src="WECHAT_IMG/flow/public_number.png" alt="">
|
||||
</div>
|
||||
<p class="progress-point-text">配置相关域名</p>
|
||||
</li>
|
||||
<li class="progress-point-arrow">
|
||||
<img src="WECHAT_IMG/flow/arrow.png" alt="">
|
||||
</li>
|
||||
<li class="progress-point">
|
||||
<div class="progress-point-pic">
|
||||
<img src="WECHAT_IMG/flow/edition.png" alt="">
|
||||
</div>
|
||||
<p class="progress-point-text">配置微信秘钥</p>
|
||||
</li>
|
||||
<li class="progress-point-arrow">
|
||||
<img src="WECHAT_IMG/flow/arrow.png" alt="">
|
||||
</li>
|
||||
<li class="progress-point">
|
||||
<div class="progress-point-pic">
|
||||
<img src="WECHAT_IMG/flow/complete.png" alt="">
|
||||
</div>
|
||||
<p class="progress-point-text">配置微信模板消息</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">微信公众号入口</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="site_list item-block-parent item-five">
|
||||
{foreach $setting_arr as $key => $val}
|
||||
<a class="item-block item-block-hover-a" href="{$val.url}">
|
||||
<div class="item-block-wrap">
|
||||
<div class="item-pic">
|
||||
<img src="WECHAT_IMG/{$val.img}">
|
||||
</div>
|
||||
<div class="item-con">
|
||||
<div class="item-content-title">{$val.title}</div>
|
||||
<p class="item-content-desc">{$val.content}</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
259
addon/wechat/shop/view/wechat/share.html
Executable file
@@ -0,0 +1,259 @@
|
||||
<style>
|
||||
.layui-form {overflow: hidden;}
|
||||
.card { display: inline-block; margin-right: 8px; width: 300px; height: 192px; border: 1px solid #EEEEEE; border-radius: 3px; vertical-align: top;padding: 0;}
|
||||
.layui-card-header { font-size: 14px;font-family: Microsoft YaHei;font-weight: 400;color: #606266;text-align: center; position: relative; height: 55px;display: flex;align-items: center;justify-content: space-between;border-bottom:1px solid #EEEEEE !important;}
|
||||
.layui-card-header .edit-btn, .layui-card-header .cancel-btn { position: absolute; right: 15px; }
|
||||
.cancel-btn { display: none; }
|
||||
.layui-card-body { color: rgba(0, 0, 0, .6); padding:18px 20px 20px;box-sizing: border-box;width: 100%;height: calc(100% - 55px);display: flex;flex-direction: column;justify-content: space-between;}
|
||||
.share-con { display: flex;}
|
||||
.share-img { flex-shrink: 0; width: 70px; height:70px;line-height: 70px; border: 1px solid #f1f1f1; background-color: #ececec; text-align: center; background-size: cover;background-repeat: no-repeat;background-position: 50% 50%;}
|
||||
.share-img span { color: #c0c0c0; font-weight: bold; }
|
||||
.share-font { padding-right: 10px; flex:1;color: #909399;}
|
||||
.btn-hide { display: none; }
|
||||
.layui-textarea{min-height:70px;}
|
||||
.share-title {overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
|
||||
.share-title span{font-size: 14px;font-family: Microsoft YaHei;font-weight: 400;color: #303133;}
|
||||
.share-title input{display: none;}
|
||||
.share-font textarea{display: none;}
|
||||
.layui-layer-page .layui-layer-content{padding: 25px 0px 40px!important;}
|
||||
.layui-form-item .layui-input-inline{width: 300px;}
|
||||
.layui-form-item .layui-input-inline .imgUrl{width: 100px;height: 100px;border: 1px solid #E6E6E6;cursor: pointer;}
|
||||
.layui-form-item .layui-input-inline .imgUrl img{width: 100%;height: 100%;}
|
||||
</style>
|
||||
|
||||
<div class="layui-form">
|
||||
{foreach $config_list as $key=>$config_item}
|
||||
<div class="layui-card card" data-key="{$config_item.config.config_key}" data-data='{:json_encode($config_item)}'>
|
||||
<div class="layui-card-header" >
|
||||
<span class="title">{$config_item.config.title}</span>
|
||||
<a href="javascript:void(0)" class="edit-btn text-color">编辑</a>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<p class="share-title" name = "title">
|
||||
<span title="{$config_item.value.title}">{$config_item.value.title}</span>
|
||||
</p>
|
||||
|
||||
<div class="share-con">
|
||||
<div class="share-font">
|
||||
<span class="span-show">{php}echo str_replace("\n", '<br/>', $config_item['value']['desc']);{/php}</span>
|
||||
</div>
|
||||
<div class="share-img" {if isset($config_item.value.imgUrl) && !empty($config_item.value.imgUrl)}style="background-image:url('{:img($config_item.value.imgUrl)}')"{/if}>
|
||||
{if !isset($config_item.value.imgUrl) || empty($config_item.value.imgUrl)}
|
||||
<span>分享图标</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="openContent">
|
||||
<div class="html-open layui-form">
|
||||
{{# if(d.variable && d.variable.length){ }}
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">变量替换:</label>
|
||||
<div class="layui-input-inline">
|
||||
{{# layui.each(d.variable,function(index,item){ }}
|
||||
<button type="button" class="layui-btn addBtn bg-color" data-tips="{{item.name}}">{{item.title}}</button>
|
||||
{{# }) }}
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分享标题:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="title" id="title" autocomplete="off" placeholder="请输入标题" value="{{d.value.title}}" class="layui-input addText" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分享描述:</label>
|
||||
<div class="layui-input-inline textarea">
|
||||
<textarea class="layui-textarea len-long" name="desc" id="desc" maxlength="100" lay-verify="introduction" placeholder="请输入备注,不能超过100个字符" >{{d.value.desc}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
{{# if(d.value.imgUrl != undefined){ }}
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分享图标:</label>
|
||||
<div class="layui-input-block img-upload">
|
||||
<div class="upload-img-block">
|
||||
<div class="upload-img-box {{# if(d.value.imgUrl){ }}hover{{# } }}">
|
||||
<div class="upload-default" id="logoUpload">
|
||||
{{# if(d.value.imgUrl){ }}
|
||||
<div id="preview_logoUpload" class="preview_img">
|
||||
<img layer-src judge = 'true' src="{{ ns.img(d.value.imgUrl) }}" class="img_prev"/>
|
||||
</div>
|
||||
{{#} else { }}
|
||||
<div class="upload">
|
||||
<i class="iconfont iconshangchuan"></i>
|
||||
<p>点击上传</p>
|
||||
</div>
|
||||
{{# } }}
|
||||
</div>
|
||||
<div class="operation">
|
||||
<div>
|
||||
<i title="图片预览" class="iconfont iconreview js-preview" style="margin-right: 20px;"></i>
|
||||
<i title="删除图片" class="layui-icon layui-icon-delete js-delete"></i>
|
||||
</div>
|
||||
<div class="replace_img js-replace">点击替换</div>
|
||||
</div>
|
||||
<input type="hidden" name="imgUrl" value="{{d.value.imgUrl}}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"></label>
|
||||
<div class="layui-input-inline">
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="formDemo">确认</button>
|
||||
<button type="button" id="closeOpen" class="layui-btn layui-btn-primary closeOpen">取消</button>
|
||||
<a id="save"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
var layer,laytpl,form,imgUrl,save_data = [], repeat_flag = false;
|
||||
layui.use(['layer','laytpl'], function(){
|
||||
layer = layui.layer;
|
||||
laytpl = layui.laytpl;
|
||||
form =layui.form;
|
||||
form.render();
|
||||
});
|
||||
$(document).ready(function () {
|
||||
var edit_num = 0;
|
||||
|
||||
$(".edit-btn").each(function(){
|
||||
$(this).click(function(){
|
||||
let data_key = $(this).parents('.card').attr('data-key');
|
||||
let data_data = JSON.parse($(this).parents('.card').attr('data-data'));
|
||||
let areaJudge = ['700px','440px'];
|
||||
if(data_data.value.imgUrl == undefined){
|
||||
areaJudge = ['700px','330px'];
|
||||
}
|
||||
let htmlOpenIndex = layer.open({
|
||||
type: 1,
|
||||
title:'分享设置',
|
||||
area:areaJudge,
|
||||
content:"<div id='openHtml'></div>",
|
||||
success:res=>{
|
||||
laytpl($('#openContent').html()).render(data_data,function(html){
|
||||
$('#openHtml').html(html);
|
||||
})
|
||||
|
||||
//添加标记、用于变量替换时确定节点
|
||||
$("input[name='title']").on("focus",function(){
|
||||
$(this).addClass('addText');
|
||||
$("textarea[name='desc']").removeClass('addText');
|
||||
})
|
||||
|
||||
$("textarea[name='desc']").on("focus",function(){
|
||||
$(this).addClass('addText');
|
||||
$("input[name='title']").removeClass('addText');
|
||||
})
|
||||
|
||||
// 变量数据追加
|
||||
$('.layui-input-inline .addBtn').on('click',function(){
|
||||
//向后追加所用模板数据
|
||||
let addText = $(this).attr('data-tips');
|
||||
// 获取需要修改的demo节点name
|
||||
let name = $('.addText').attr('name');
|
||||
switch(name){
|
||||
case 'title':
|
||||
var txtArea = $("input[name='title']")[0];
|
||||
var content = txtArea.value;//文本域内容
|
||||
var start = txtArea.selectionStart; //光标的初始位置,selectionStart:选区开始位置;selectionEnd:选区结束位置。
|
||||
txtArea.value = content.substring(0, txtArea.selectionStart) + addText + content.substring(txtArea.selectionEnd, content.length);
|
||||
var position = start + addText.length;
|
||||
$("input[name='title']").focus();
|
||||
txtArea.setSelectionRange(position+1, position);
|
||||
break;
|
||||
case 'desc':
|
||||
var txtArea = $("textarea[name='desc']")[0];
|
||||
var content = txtArea.value;//文本域内容
|
||||
var start = txtArea.selectionStart; //光标的初始位置,selectionStart:选区开始位置;selectionEnd:选区结束位置。
|
||||
txtArea.value = content.substring(0, txtArea.selectionStart) + addText + content.substring(txtArea.selectionEnd, content.length);
|
||||
var position = start + addText.length;
|
||||
$("textarea[name='desc']").focus();
|
||||
txtArea.setSelectionRange(position+1, position);
|
||||
break;
|
||||
}
|
||||
})
|
||||
|
||||
// 接口上传
|
||||
form.on('submit(formDemo)',function(data){
|
||||
let obj = data.field;
|
||||
obj.config_key = data_data.config.config_key;
|
||||
save_data = [];
|
||||
save_data.push(obj);
|
||||
if(data_data.value.imgUrl == undefined){
|
||||
save(save_data);
|
||||
}else{
|
||||
let judge = $('.preview_img .img_prev').attr('judge');
|
||||
if(!judge){
|
||||
let imgJudge = $('.upload-default .preview_img .img_prev');
|
||||
if(!imgJudge.length){
|
||||
save_data[0].imgUrl = '';
|
||||
save(save_data);
|
||||
}else{
|
||||
$('#save').click();
|
||||
}
|
||||
}else{
|
||||
save(save_data);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
//选择图片
|
||||
var upload = new Upload({
|
||||
elem: '#logoUpload',
|
||||
auto: false, //选择文件后不自动上传
|
||||
bindAction: '#save', //指向一个按钮触发上传
|
||||
callback: function (res) {
|
||||
if(res.code >= 0){
|
||||
save_data[0].imgUrl = res.data.pic_path;
|
||||
save(save_data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//点击取消弹窗关闭
|
||||
$('#closeOpen').on('click',function(){
|
||||
layer.close(htmlOpenIndex)
|
||||
})
|
||||
|
||||
form.render();
|
||||
|
||||
|
||||
},
|
||||
});
|
||||
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
function save(data){
|
||||
if(repeat_flag) return false;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ns.url("wechat://shop/wechat/share"),
|
||||
data: {
|
||||
data_json : JSON.stringify(data),
|
||||
},
|
||||
dataType: 'JSON',
|
||||
success: function (res) {
|
||||
repeat_flag = false;
|
||||
layer.msg(res.message);
|
||||
listenerHash(); // 刷新页面
|
||||
layer.closeAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||