初始上传
219
addon/weapp/shop/view/message/config.html
Executable file
@@ -0,0 +1,219 @@
|
||||
<style>
|
||||
.layui-elem-quote{color: #999;}
|
||||
.table-btn{justify-content: center;}
|
||||
.layui-card-header{border: 1px solid #f6f6f6;}
|
||||
.layui-card-header .card-title{font-size: 14px;}
|
||||
.template-content{white-space:pre;line-height: 1.5;text-align: left}
|
||||
</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>小程序最多支持50个消息模板获取时请注意小程序剩余模板数量是否充足</li>
|
||||
</ul>
|
||||
</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="toolOperation">
|
||||
<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.weapp_is_open == 0){ }}
|
||||
<a class="layui-btn" lay-event="open">开启</a>
|
||||
{{# }else{ }}
|
||||
<a class="layui-btn" lay-event="close">关闭</a>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d.weapp_template_id != undefined && d.weapp_template_id != ''){ }}
|
||||
<a class="layui-btn" lay-event="getTemplateNo">重新获取</a>
|
||||
{{# } }}
|
||||
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="message_type">
|
||||
<div class="template-content">{{ d.message_info.content }}</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="template_no">
|
||||
{{ d.weapp_template_id ? d.weapp_template_id : '' }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="weapp_is_open">
|
||||
{{ d.weapp_is_open == 1 ? '已启用' : '已关闭' }}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var form,table;
|
||||
layui.use(['form'], function(){
|
||||
form = layui.form;
|
||||
var repeat_flag = false;//防重复标识
|
||||
|
||||
table = new Table({
|
||||
elem: '#template_list',
|
||||
url: ns.url("weapp://shop/message/config"),
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
width: "3%",
|
||||
type: 'checkbox',
|
||||
unresize: 'false'
|
||||
},
|
||||
{
|
||||
field: 'title',
|
||||
title: '类型',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
width: "25%",
|
||||
field: 'message_type',
|
||||
title: '回复内容',
|
||||
templet: '#message_type',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
field: 'weapp_is_open',
|
||||
title: '是否启用',
|
||||
templet: '#weapp_is_open',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
width: "35%",
|
||||
field: 'wechat_template_id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
templet: '#template_no'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
toolbar: '#operation',
|
||||
align:'right'
|
||||
}
|
||||
]
|
||||
],
|
||||
toolbar: '#toolOperation',
|
||||
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.toolbar(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("weapp://shop/message/setWeappStatus")}',
|
||||
data : {
|
||||
"weapp_is_open":status,
|
||||
'keywords' : keywords
|
||||
},
|
||||
dataType : "JSON",
|
||||
success : function(res) {
|
||||
repeat_flag = false;
|
||||
layer.msg(res.message);
|
||||
table.reload('template_list');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getTemplate(keywords) {
|
||||
var loadLayer;
|
||||
layer.confirm('已存在的模板再次获取会导致模板重复存在,是否继续?', function (index) {
|
||||
$.ajax({
|
||||
type : "post",
|
||||
url : '{:addon_url("weapp://shop/message/getWeappTemplateNo")}',
|
||||
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);
|
||||
table.reload('template_list');
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
77
addon/weapp/shop/view/message/edit.html
Executable file
@@ -0,0 +1,77 @@
|
||||
<div class="layui-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否开启:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="weapp_is_open" value="1" {if $weapp_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">模板编号:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" value="{if $info}{$info.tid}{/if}" placeholder="模板编号" autocomplete="off" class="layui-input len-long" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">模板内容:</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("weapp://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/weapp/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;}
|
||||
BIN
addon/weapp/shop/view/public/img/administration.png
Executable file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
addon/weapp/shop/view/public/img/arrow.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/weapp/shop/view/public/img/audit.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
addon/weapp/shop/view/public/img/complete.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/weapp/shop/view/public/img/download.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
addon/weapp/shop/view/public/img/edition.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
addon/weapp/shop/view/public/img/loading.gif
Executable file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
addon/weapp/shop/view/public/img/menu_icon/wechat_app.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/weapp/shop/view/public/img/menu_icon/wechat_app_new.png
Executable file
|
After Width: | Height: | Size: 746 B |
BIN
addon/weapp/shop/view/public/img/menu_icon/wechat_app_select.png
Executable file
|
After Width: | Height: | Size: 655 B |
BIN
addon/weapp/shop/view/public/img/message.png
Executable file
|
After Width: | Height: | Size: 943 B |
BIN
addon/weapp/shop/view/public/img/public_number.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
addon/weapp/shop/view/public/img/record.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
addon/weapp/shop/view/public/img/register.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
addon/weapp/shop/view/public/img/set_up.png
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
addon/weapp/shop/view/public/img/share.png
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
addon/weapp/shop/view/public/img/testuser.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
228
addon/weapp/shop/view/stat/stat.html
Executable file
@@ -0,0 +1,228 @@
|
||||
<link rel="stylesheet" href="WEAPP_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" id="session_cnt">0</p>
|
||||
</li>
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>访问次数/人数</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content" id="visit_pv_visit_uv">0/0</p>
|
||||
</li>
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>新访问用户数</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content" id="visit_uv_new">0</p>
|
||||
</li>
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>人均/次均停留时长(秒)</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content" id="stay_time_uv_stay_time_session">0/0</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" id="month_session_cnt">0</p>
|
||||
</li>
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>访问次数/人数</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content" id="month_visit_pv_visit_uv">0/0</p>
|
||||
</li>
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>新访问用户数</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content" id="month_visit_uv_new">0</p>
|
||||
</li>
|
||||
<li class="access-api-item">
|
||||
<div class="access-api-item-title">
|
||||
<h3>人均/次均停留时长(秒)</h3>
|
||||
</div>
|
||||
<p class="access-api-itme-content" id="month_stay_time_uv_stay_time_session">0/0</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-body access-statistics">
|
||||
<div class="layui-tab-content-time">
|
||||
<span>时间</span>
|
||||
<div class="layui-input-inline daterange-input-wrap">
|
||||
<input type="text" class="layui-input daterange-input" id="daterange" placeholder=" - ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-img">
|
||||
<div id="main" style="width: 100%;height:400px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
var daterange = '{:date("Y-m-d", strtotime("-6 days"))} 至 {:date("Y-m-d")}';
|
||||
layui.use('laydate', function(){
|
||||
var laydate = layui.laydate;
|
||||
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#daterange'
|
||||
,format: 'yyyy-MM-dd'
|
||||
,range: '至'
|
||||
,value:daterange //必须遵循format参数设定的格式
|
||||
,done: function(value, date, endDate){
|
||||
daterange = value;
|
||||
visitStatistics();
|
||||
}
|
||||
});
|
||||
visitData("yesterday");
|
||||
visitData("month");
|
||||
visitStatistics();
|
||||
|
||||
});
|
||||
|
||||
//折线图
|
||||
if($('#main').length) {
|
||||
var chart = echarts.init(document.getElementById('main'));
|
||||
}
|
||||
|
||||
//获取微信小程序访问统计数据(按日)
|
||||
function visitStatistics(){
|
||||
chart.showLoading();//加载视图
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "{:addon_url('weapp://shop/stat/visitStatistics')}",
|
||||
dataType: "JSON",
|
||||
data: {daterange : daterange},
|
||||
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.session_cnt_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "打开次数"
|
||||
},
|
||||
{
|
||||
data: chart_data.data.visit_pv_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "访问次数"
|
||||
},
|
||||
{
|
||||
data: chart_data.data.visit_uv_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "访问人数"
|
||||
},
|
||||
{
|
||||
data: chart_data.data.visit_uv_new_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "新用户数"
|
||||
},
|
||||
{
|
||||
data: chart_data.data.stay_time_uv_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
stack: '秒',
|
||||
name: "人均停留时长"
|
||||
},
|
||||
{
|
||||
data: chart_data.data.stay_time_session_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
stack: '秒',
|
||||
name: "次均停留时长"
|
||||
},
|
||||
{
|
||||
data: chart_data.data.visit_depth_data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: "平均访问深度"
|
||||
},
|
||||
]
|
||||
};
|
||||
|
||||
chart.setOption(option);
|
||||
chart.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
*统计数据
|
||||
*/
|
||||
function visitData(date_type){
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "{:addon_url('weapp://shop/stat/visitdata')}",
|
||||
dataType: "JSON",
|
||||
data: {date_type : date_type},
|
||||
success: function (res) {
|
||||
var data = res.data;
|
||||
if(data.length > 0){
|
||||
if(date_type == "month"){
|
||||
$("#month_session_cnt").text(data.data.session_cnt);
|
||||
$("#month_visit_pv_visit_uv").text(data.data.visit_pv +"/"+data.data.visit_uv);
|
||||
$("#month_visit_uv_new").text(data.data.visit_uv_new);
|
||||
$("#month_stay_time_uv_stay_time_session").text(data.data.stay_time_uv +"/"+data.data.stay_time_session);
|
||||
}else{
|
||||
$("#session_cnt").text(data.data.session_cnt);
|
||||
$("#visit_pv_visit_uv").text(data.data.visit_pv +"/"+data.data.visit_uv);
|
||||
$("#visit_uv_new").text(data.data.visit_uv_new);
|
||||
$("#stay_time_uv_stay_time_session").text(data.data.stay_time_uv +"/"+data.data.stay_time_session);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
235
addon/weapp/shop/view/weapp/config.html
Executable file
@@ -0,0 +1,235 @@
|
||||
<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-inline">
|
||||
<input type="text" name="weapp_name" autocomplete="off" class="layui-input len-long" value="{$config_info.weapp_name ?? ''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">小程序原始ID:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="weapp_original" autocomplete="off" class="layui-input len-long" value="{$config_info.weapp_original ?? ''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">小程序二维码:</label>
|
||||
<div class="layui-input-inline img-upload">
|
||||
<div class="upload-img-block">
|
||||
<div class='upload-img-box {if condition="$config_info && $config_info.qrcode"}hover{/if}'>
|
||||
<div class="upload-default" id="img">
|
||||
{if condition="$config_info && $config_info.qrcode"}
|
||||
<div id="preview_img" class="preview_img">
|
||||
<img layer-src src="{:img($config_info.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_info.qrcode ?? ''}"/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <p id="img" class=" {if condition="$config_info && $config_info.qrcode"} replace {else/} no-replace{/if}">替换</p>
|
||||
<input type="hidden" class="layui-input" name="qrcode" value="{$config_info.qrcode ?? ''}"/>
|
||||
<i class="del {if condition="$config_info && $config_info.qrcode"}show{/if}">x</i> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">开发者ID设置</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">APPID:</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" name="appid" autocomplete="off" class="layui-input len-long" value="{$config_info.appid ?? ''}">
|
||||
</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" class="layui-input len-long" value="{$config_info.appsecret ?? ''}">
|
||||
</div>
|
||||
<div class="word-aux">AppID(小程序ID)和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">request合法域名:</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" autocomplete="off" readonly id="url_request" class="layui-input len-long" value="https://{$url}">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" onclick="ns.copy('url_request')">复制</button>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">socket合法域名:</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" autocomplete="off" readonly id="url_socket" class="layui-input len-long" value="wss://{$url}">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" onclick="ns.copy('url_socket')">复制</button>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">uploadFile合法域名:</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" autocomplete="off" readonly id="url_upload" class="layui-input len-long" value="https://{$url}">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" onclick="ns.copy('url_upload')">复制</button>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">downloadFile合法域:</label>
|
||||
<div class="layui-input-inline ">
|
||||
<input type="text" autocomplete="off" id="url_download" readonly class="layui-input len-long" value="https://{$url}">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" onclick="ns.copy('url_download')">复制</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">URL(服务器地址):</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="token" readonly id="callback_url" autocomplete="off" class="layui-input len-long" value="{$call_back_url}">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" onclick="ns.copy('callback_url')">复制</button>
|
||||
</div>
|
||||
<div class="word-aux">必须以http://或https://开头,分别支持80端口和443端口。</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">Token(令牌)</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="token" autocomplete="off" id="empowerToken" class="layui-input len-long" value="{$config_info.token ?? ''}">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" onclick="ns.copy('empowerToken')">复制</button>
|
||||
</div>
|
||||
<div class="word-aux">Token必须为英文或数字,长度为3-32字符。如不填写则默认为“TOKEN”。</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">EncodingAESKey:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline len-long">
|
||||
<input class="layui-input" type="text" name="encodingaeskey" id="encodingaeskey" autocomplete="off" value="{$config_info.encodingaeskey ?? ''}">
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary" onclick="ns.copy('encodingaeskey')">复制</button>
|
||||
</div>
|
||||
<div class="word-aux">消息加密密钥由43位字符组成,字符范围为A-Z,a-z,0-9</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary" onclick="backWeappSetting()">返回</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);
|
||||
}
|
||||
});
|
||||
|
||||
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('weapp://shop/weapp/config')}",
|
||||
dataType: "JSON",
|
||||
data: data.field,
|
||||
success: function (data) {
|
||||
repeat_flag = false;
|
||||
layer.msg(data.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var file_upload = new Upload({
|
||||
elem: '#checkFile',
|
||||
url: ns.url("shop/upload/checkfile"),
|
||||
accept: 'file',
|
||||
acceptMime: 'text/plain',
|
||||
exts: 'txt'
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function backWeappSetting() {
|
||||
location.hash = ns.hash('weapp://shop/weapp/setting');
|
||||
}
|
||||
|
||||
</script>
|
||||
125
addon/weapp/shop/view/weapp/package.html
Executable file
@@ -0,0 +1,125 @@
|
||||
<style type="text/css">
|
||||
.package-wrap {margin-top:50px;display:flex;}
|
||||
.package-wrap .wrap {flex:1;border:1px solid #f1f1f1;}
|
||||
.package-wrap .wrap:nth-child(2) {margin-left:30px;}
|
||||
.package-wrap .wrap .card-common {margin-top:0;}
|
||||
.package-wrap .wrap .layui-card-header {padding:5px 20px;}
|
||||
.weapp-info {text-align:center;font-size: 12px}
|
||||
.weapp-info .qrcode {width:130px;height:130px;margin:30px auto;}
|
||||
.weapp-info dl {display:flex;line-height:30px}
|
||||
.weapp-info dl dt,.weapp-info dl dd {flex:1;}
|
||||
.weapp-info dl dt {width:100px;text-align:right;color:#999;}
|
||||
.weapp-info dl dd {text-align:left;padding-left:30px;}
|
||||
.wrap .step-wrap .layui-timeline {padding-left:40px!important;}
|
||||
.wrap .step-wrap .layui-timeline-title {font-size:12px;margin-bottom:5px;}
|
||||
.step-wrap .layui-timeline-content p {font-size:12px;}
|
||||
.step-wrap .layui-timeline-item{padding-bottom: 40px;}
|
||||
.step-wrap .layui-timeline-item:before {left:4px;background-color:unset;border-left:1px dashed #ccc;}
|
||||
.edition-wrap {margin-top:20px;}
|
||||
.edition-wrap .header {font-size:14px;}
|
||||
.edition-list .edition-item {display:inline-block;width:auto;border:1px solid #ddd;padding:8px 30px;line-height:1;margin:15px 15px 0 0;border-radius:5px;cursor:pointer;}
|
||||
.edition-list .edition-item .name {color:#333;}
|
||||
.edition-list .edition-item:hover,.edition-list .edition-item.active {border-color:var(--base-color);}
|
||||
.edition-list .edition-item:hover .name,.edition-list .edition-item.active .name {color:var(--base-color);}
|
||||
.edition-list .edition-item .version {margin-top:8px;font-size:12px;color:#999;}
|
||||
.operation {margin-top:20px;display:flex;}
|
||||
.operation .layui-btn {flex:1;}
|
||||
.loading-layer .loading-img {margin:10px auto;display:block;}
|
||||
.preview-layer .qrcode {width:100px;height:100px;margin:10px auto;display:block;}
|
||||
.new-version-tips{margin-top: 10px;border:1px dashed;padding: 5px 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>下载之后需使用微信开发者工具上传代码,微信开发者工具下载地址: <a href="https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html" target="_blank">https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html</a></li>
|
||||
<li>上传之后登录<a href="https://mp.weixin.qq.com" target="_blank">微信公众平台</a>,在版本管理中选择刚上传的版本提交审核,审核通过之后即可发布小程序。</li>
|
||||
<li>UNIAPP源码包授权后可下载,可很好的进行二次开发,可通过<a href="https://www.dcloud.io/hbuilderx.html" target="_blank">HBuilder X</a>编译为H5、微信小程序、支付宝小程序、头条小程序等</li>
|
||||
<li>小程序代码包是由UNIAPP源码包编译出来的微信小程序版下载后可直接通过微信开发者工具上传使用,但是无法进行二次开发。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="package-wrap">
|
||||
<div class="wrap">
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">小程序信息</span>
|
||||
</div>
|
||||
<div class="layui-card-body layui-field-box weapp-info">
|
||||
<img src="{:img($config.qrcode)}" class="qrcode">
|
||||
<dl>
|
||||
<dt>小程序名称</dt>
|
||||
<dd>{$config.weapp_name}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>小程序ID</dt>
|
||||
<dd>{$config.appid}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>小程序原始ID</dt>
|
||||
<dd>{$config.weapp_original}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrap">
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">源码下载</span>
|
||||
</div>
|
||||
<div class="layui-card-body layui-field-box">
|
||||
<div class="step-wrap">
|
||||
<ul class="layui-timeline">
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis text-color"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h3 class="layui-timeline-title">下载小程序代码包</h3>
|
||||
<div style="margin-top: 10px;">
|
||||
<a class="layui-btn layui-btn-primary" href="{:addon_url('weapp://shop/weapp/download',[ 'request_mode' => 'download' ])}" target="_blank">下载小程序代码包</a>
|
||||
{if $is_auth}
|
||||
<a class="layui-btn layui-btn-primary" href="{:addon_url('weapp://shop/weapp/downloaduniapp',[ 'request_mode' => 'download' ])}" target="_blank">下载UNIAPP源码包</a>
|
||||
{else/}
|
||||
<a class="layui-btn layui-btn-primary" href="javascript:;" onclick="authLayer()">下载UNIAPP源码包</a>
|
||||
{/if}
|
||||
</div>
|
||||
{if $is_new_version}
|
||||
<div class="new-version-tips text-color bg-color-light-9 border-color">
|
||||
<p>小程序已更新,为了不影响您的使用请尽快下载小程序上传更新。</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</li>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis text-color"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h3 class="layui-timeline-title">上传代码</h3>
|
||||
<p>下载完成之后,使用微信开发工具进行上传</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis text-color"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h3 class="layui-timeline-title">发布小程序</h3>
|
||||
<p>上传之后提交审核,审核通过发布小程序</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function authLayer(){
|
||||
layer.confirm('当前为免费版,授权后才可以下载UNIAPP源码包!是否立即授权?', {
|
||||
btn: ['立即授权','暂不需要'] //按钮
|
||||
}, function(){
|
||||
window.open('https://www.niushop.com');
|
||||
}, function(){
|
||||
layer.closeAll();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
86
addon/weapp/shop/view/weapp/release.html
Executable file
@@ -0,0 +1,86 @@
|
||||
<style>
|
||||
.applet-item {
|
||||
padding:10px;
|
||||
margin:0 10px 10px 0;
|
||||
display:inline-block;
|
||||
width:280px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.applet-item .applet-img {
|
||||
width:100%;
|
||||
padding:50% 0;
|
||||
position:relative;
|
||||
overflow:hidden;
|
||||
}
|
||||
.applet-item .applet-img img {
|
||||
position:absolute;
|
||||
width:100%;
|
||||
height:auto;
|
||||
max-height:100%;
|
||||
left:50%;
|
||||
top:50%;
|
||||
transform:translate(-50%,-50%);
|
||||
}
|
||||
.applet-item .applet-name {
|
||||
font-size:14px;
|
||||
line-height:1;
|
||||
background:none;
|
||||
padding:0;
|
||||
margin-top:10px
|
||||
}
|
||||
.applet-item .applet-desc {
|
||||
line-height:1.5;
|
||||
font-size:12px;
|
||||
color:#666;
|
||||
margin:10px 0;
|
||||
height:38px;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
}
|
||||
.empty {
|
||||
text-align:center;
|
||||
height:150px;
|
||||
line-height:150px;
|
||||
}
|
||||
</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>已购买的小程序会出现在下方,购买可前往<a href="https://www.niushop.com" target="_blank">Niushop官网</a>进行购买</li>
|
||||
<li>下载之后需使用HBuilderX编译成微信小程序,然后进行发布,HBuilderX下载地址: <a href="https://www.dcloud.io/hbuilderx.html" target="_blank">https://www.dcloud.io/hbuilderx.html</a></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 layui-field-box">
|
||||
<div class="applet-list">
|
||||
{notempty name="list"}
|
||||
{foreach name="list" item="item"}
|
||||
<div class="applet-item">
|
||||
<div class="applet-img">
|
||||
<img src="{$item.product_info.image}" alt="">
|
||||
</div>
|
||||
<h4 class="applet-name">{$item.product_info.module_name}</h4>
|
||||
<p class="applet-desc">{$item.product_info.summary}</p>
|
||||
<div>
|
||||
<a href="{:href_url('weapp://shop/weapp/package?mark='. $item['module_mark'] )}">
|
||||
<button class="layui-btn">下载小程序源码包</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{else/}
|
||||
<div class="empty">
|
||||
您还未购买过小程序,<a href="https://www.niushop.com" target="_blank">前去购买</a>
|
||||
</div>
|
||||
{/notempty}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
163
addon/weapp/shop/view/weapp/setting.html
Executable file
@@ -0,0 +1,163 @@
|
||||
<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%;
|
||||
}
|
||||
|
||||
.item-block-wrap .new-tips{
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background: #f00;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
}
|
||||
.item-content-desc{
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</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="WEAPP_IMG/register.png" alt="">
|
||||
</div>
|
||||
<p class="progress-point-text">注册微信小程序应用</p>
|
||||
</li>
|
||||
<li class="progress-point-arrow">
|
||||
<img src="WEAPP_IMG/arrow.png" alt="">
|
||||
</li>
|
||||
<li class="progress-point">
|
||||
<div class="progress-point-pic">
|
||||
<img src="WEAPP_IMG/set_up.png" alt="">
|
||||
</div>
|
||||
<p class="progress-point-text">信息完善</p>
|
||||
</li>
|
||||
<li class="progress-point-arrow">
|
||||
<img src="WEAPP_IMG/arrow.png" alt="">
|
||||
</li>
|
||||
<li class="progress-point">
|
||||
<div class="progress-point-pic">
|
||||
<img src="WEAPP_IMG/public_number.png" alt="">
|
||||
</div>
|
||||
<p class="progress-point-text">开发</p>
|
||||
</li>
|
||||
<li class="progress-point-arrow">
|
||||
<img src="WEAPP_IMG/arrow.png" alt="">
|
||||
</li>
|
||||
<li class="progress-point">
|
||||
<div class="progress-point-pic">
|
||||
<img src="WEAPP_IMG/edition.png" alt="">
|
||||
</div>
|
||||
<p class="progress-point-text">提交审核</p>
|
||||
</li>
|
||||
<li class="progress-point-arrow">
|
||||
<img src="WEAPP_IMG/arrow.png" alt="">
|
||||
</li>
|
||||
<li class="progress-point">
|
||||
<div class="progress-point-pic">
|
||||
<img src="WEAPP_IMG/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">
|
||||
<a class="item-block item-block-hover-a" href="{:href_url('weapp://shop/weapp/config')}">
|
||||
<div class="item-block-wrap">
|
||||
<div class="item-pic">
|
||||
<img src="WEAPP_IMG/administration.png">
|
||||
</div>
|
||||
<div class="item-con">
|
||||
<div class="item-content-title">小程序管理</div>
|
||||
<p class="item-content-desc">小程序管理</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<!-- <a class="item-block item-block-hover-a" href="{:href_url('weapp://shop/weapp/package')}">-->
|
||||
<!-- <div class="item-block-wrap">-->
|
||||
<!-- <div class="item-pic">-->
|
||||
<!-- <img src="WEAPP_IMG/download.png">-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="item-con">-->
|
||||
<!-- <div class="item-content-title">小程序发布</div>-->
|
||||
<!-- <p class="item-content-desc">小程序发布</p>-->
|
||||
<!-- </div>-->
|
||||
<!-- {if $is_new_version}<span class="new-tips"></span>{/if}-->
|
||||
<!-- </div>-->
|
||||
<!-- </a>-->
|
||||
<a class="item-block item-block-hover-a" href="{:href_url('weapp://shop/message/config')}">
|
||||
<div class="item-block-wrap">
|
||||
<div class="item-pic">
|
||||
<img src="WEAPP_IMG/message.png">
|
||||
</div>
|
||||
<div class="item-con">
|
||||
<div class="item-content-title">订阅消息</div>
|
||||
<p class="item-content-desc">给用户提供更好的服务闭环体验</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<a class="item-block item-block-hover-a" href="{:href_url('weapp://shop/weapp/share')}">
|
||||
<div class="item-block-wrap">
|
||||
<div class="item-pic">
|
||||
<img src="WEAPP_IMG/share.png">
|
||||
</div>
|
||||
<div class="item-con">
|
||||
<div class="item-content-title">分享设置</div>
|
||||
<p class="item-content-desc">小程序分享设置</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{notempty name="$weapp_menu"}
|
||||
{foreach name="$weapp_menu" item="vo"}
|
||||
<a class="item-block item-block-hover-a" href="{:href_url($vo.url)}">
|
||||
<div class="item-block-wrap">
|
||||
<div class="item-pic">
|
||||
<img src="{:img($vo.icon)}">
|
||||
</div>
|
||||
<div class="item-con">
|
||||
<div class="item-content-title">{$vo.title}</div>
|
||||
<p class="item-content-desc">{$vo.description}</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{/foreach}
|
||||
{/notempty}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
253
addon/weapp/shop/view/weapp/share.html
Executable file
@@ -0,0 +1,253 @@
|
||||
<style>
|
||||
.share-box{display: flex;align-items: center;flex-wrap: wrap;}
|
||||
.share-box .share-item{margin:0 20px 20px 0;width: 300px;height: 340px;border: 1px solid #EEEEEE;border-radius: 3px;}
|
||||
.share-box .share-item .share-title{width: 100%;height: 55px;display: flex;align-items: center;justify-content: space-between; padding: 0 20px;box-sizing: border-box;border-bottom: 1px solid #EEEEEE;}
|
||||
.share-box .share-item .share-title{font-size: 14px;font-family: Microsoft YaHei;font-weight: 400;color: #606266;}
|
||||
.share-box .share-item .share-title .edit{color: var(--base-color);cursor: pointer;}
|
||||
.share-box .share-item .content-box{width: 100%;height: calc(100% - 55px);padding: 20px;box-sizing: border-box;display: flex;flex-direction: column;justify-content: space-between;}
|
||||
.share-box .share-item .content-box .title{font-size: 16px;font-family: Microsoft YaHei;font-weight: 400;color: #303133;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
|
||||
.share-box .share-item .content-box .img{width: 260px;height: 208px;background: #ececec;font-size: 24px;text-align: center;line-height: 208px;color: #c0c0c0;overflow: hidden;}
|
||||
.share-box .share-item .content-box .img .imgover1{width: 260px;}
|
||||
.share-box .share-item .content-box .img .imgover2{height: 208px;}
|
||||
.layui-form-item .layui-input-inline .layui-input{width: 248px;}
|
||||
.layui-form-item .layui-input-inline .text-tips{line-height: 1;}
|
||||
.layui-form-label1{height: 1px;}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function judgeImageSize(that){
|
||||
let w = $(that).width();
|
||||
let h = $(that).height();
|
||||
let i = $(that).attr('key');
|
||||
let name = 'img-box' + i;
|
||||
if(w > h){
|
||||
$(`div[name=${name}]`).children().addClass('imgover2')
|
||||
}else{
|
||||
$(`div[name=${name}]`).children().addClass('imgover1')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="share-box">
|
||||
{foreach $config_list as $key=>$config_item}
|
||||
<div class="share-item">
|
||||
<div class="share-title" data-key="{$config_item.config.config_key}" data-data='{:json_encode($config_item)}'>
|
||||
<span class="title">{$config_item.config.title}</span>
|
||||
<a href="javascript:void(0)" class="edit-btn text-color">编辑</a>
|
||||
</div>
|
||||
<div class="content-box">
|
||||
<div class="title" title="{$config_item.value.title}">{$config_item.value.title}</div>
|
||||
<div class="img" name="img-box{$key}">
|
||||
{if isset($config_item.value.imageUrl) && !empty($config_item.value.imageUrl)}
|
||||
<img loading="eager" onload="judgeImageSize(this)" key="{$key}" src="{:img($config_item.value.imageUrl)}" >
|
||||
{else /}
|
||||
<span>分享页面截图</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="openContent">
|
||||
<div class="html-open layui-form">
|
||||
{{# if(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>
|
||||
{{# if(d.value.imageUrl != 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.imageUrl){ }}hover{{# } }}">
|
||||
<div class="upload-default" id="logoUpload">
|
||||
{{# if(d.value.imageUrl){ }}
|
||||
<div id="preview_logoUpload" class="preview_img">
|
||||
<img layer-src judge = 'true' src="{{ ns.img(d.value.imageUrl) }}" 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="imageUrl" value="{{d.value.imageUrl}}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label layui-form-label1"></label>
|
||||
<div class="layui-input-inline">
|
||||
<div class="text-color text-tips">建议上传图片宽:高 = 5:4,不上传则使用页面截图</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,imageUrl,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('.share-title').attr('data-key');
|
||||
let data_data = JSON.parse($(this).parents('.share-title').attr('data-data'));
|
||||
let areaJudge = ['700px','380px'];
|
||||
if(data_data.variable.length == 0){
|
||||
areaJudge = ['700px','335px'];
|
||||
}
|
||||
let htmlOpenIndex = layer.open({
|
||||
type: 1,
|
||||
title:'分享设置',
|
||||
area:areaJudge,
|
||||
content:"<div id='openHtml'></div>" ,//这里content是一个普通的String
|
||||
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.imageUrl == 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].imageUrl = '';
|
||||
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].imageUrl = 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("weapp://shop/weapp/share"),
|
||||
data: {
|
||||
data_json : JSON.stringify(data),
|
||||
},
|
||||
dataType: 'JSON',
|
||||
success: function (res) {
|
||||
repeat_flag = false;
|
||||
layer.msg(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
268
addon/weapp/shop/view/weapp/share_back.html
Executable file
@@ -0,0 +1,268 @@
|
||||
<style>
|
||||
.word-aux{
|
||||
display: flex;
|
||||
}
|
||||
.mini-program{
|
||||
width: 42px;
|
||||
height: 15px;
|
||||
font-size: 14px;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
.share {
|
||||
margin-top: 10px;
|
||||
padding:20px;
|
||||
border: 1px solid #e5e5e5;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.layui-input-block, .word-aux {
|
||||
margin:20px auto 0;
|
||||
}
|
||||
|
||||
textarea {
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
.picture-introduce{
|
||||
width: 293px;
|
||||
height: 13px;
|
||||
font-size: 12px;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #B3B3B3;
|
||||
margin-top: 13px;
|
||||
}
|
||||
|
||||
.top-text{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.top-text .logo{
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
color: #fff;
|
||||
background-color: #e5e5e5;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
margin-right: 10px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.company-titles{
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.bottom{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.replace_img js-replace{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 24px;
|
||||
color: #fff;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
::-webkit-input-placeholder{
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
}
|
||||
.member-detail-list{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.member-detail-list .detail-item{
|
||||
width: 350px;
|
||||
margin-right: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.member-detail-list .main-header{
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
text-overflow: ellipsis;
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.member-detail-list .share-desc{
|
||||
margin-top: 20px;
|
||||
}
|
||||
.member-detail-list .img-upload{
|
||||
margin-top: 18px;
|
||||
}
|
||||
.member-detail-list .upload-img-block{
|
||||
border-style: solid;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.member-detail-list .bottom{
|
||||
display: flex;
|
||||
align-content: center;
|
||||
margin-top: 18px;
|
||||
}
|
||||
.member-detail-list .bottom .iconfont{
|
||||
color: #08BA06;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.member-detail-list .upload-img-block{
|
||||
width: 310px;
|
||||
height:248px;
|
||||
padding: 0;
|
||||
}
|
||||
.member-detail-list .upload-img-block .operation i{
|
||||
line-height: 246px;
|
||||
}
|
||||
</style>
|
||||
|
||||
{notempty name="$scene"}
|
||||
<div class="member-detail-list">
|
||||
{foreach $scene as $scene_item}
|
||||
<div class="detail-item" data-key="{$scene_item['key']}">
|
||||
<div class="word-aux main-header">{$scene_item['title']}</div>
|
||||
<div class="share">
|
||||
<div class="top-text">
|
||||
<span class="logo">Logo</span>
|
||||
<div class="company-titles">小程序名称</div>
|
||||
</div>
|
||||
<form action="" class="layui-form" lay-filter="example">
|
||||
<input type="text" name="share-title" class="layui-input share-desc" placeholder="小程序分享描述" value="{$config[$scene_item['key']]['title'] ?? ''}" maxlength="50">
|
||||
<div class="layui-input-block img-upload">
|
||||
<div class="upload-img-block">
|
||||
<div class="upload-img-box {if !empty($config[$scene_item['key']]['path'])}hover{/if}" style="position: relative;">
|
||||
<div class="upload-default" id="shareUpload_{$scene_item['key']}">
|
||||
{if empty($config[$scene_item['key']]['path'])}
|
||||
<div class="upload">
|
||||
<i class="iconfont iconshangchuan"></i>
|
||||
<p>点击上传</p>
|
||||
</div>
|
||||
{else /}
|
||||
<div id="preview_watermark_source" class="preview_img">
|
||||
<img layer-src src="{:img($config[$scene_item['key']]['path'])}" class="img_prev" />
|
||||
</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="shareImg_{$scene_item['key']}" lay-verify="required" value="{$config[$scene_item['key']]['path'] ?? ''}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="picture-introduce">支持PNG及JPG。图片长宽比是5:4,不传使用默认截图</div>
|
||||
<div class="bottom">
|
||||
<i class="iconfont iconweixinxiaochengxu"></i>
|
||||
<div class="mini-program">小程序</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
{else/}
|
||||
<div class="no-data">暂无数据</div>
|
||||
{/notempty}
|
||||
|
||||
<script>
|
||||
let shareParam = {},
|
||||
scene = '{:json_encode($scene)}',
|
||||
config = '{:json_encode($config)}';
|
||||
|
||||
initData(); //初始化数据
|
||||
function initData(){
|
||||
scene = JSON.parse(scene);
|
||||
config = JSON.parse(config);
|
||||
scene.forEach((item,index) => {
|
||||
|
||||
var path = config.length != 0 && config[item.key].path ? config[item.key].path : '',
|
||||
title = config.length != 0 && config[item.key].title ? config[item.key].title : item.title;
|
||||
|
||||
shareParam[item.key] = {
|
||||
'key': item.key,
|
||||
'path': path,
|
||||
'title': title
|
||||
};
|
||||
//实例化图片上传
|
||||
uploadImg(item.key);
|
||||
});
|
||||
}
|
||||
|
||||
function uploadImg(key){
|
||||
new Upload({
|
||||
elem: '#shareUpload_'+key,
|
||||
callback: function(res) {
|
||||
let key = this.elem.split('_')[1];
|
||||
|
||||
if(res.code > 0){
|
||||
shareParam[key].path = res.data.pic_path;
|
||||
$("input[name='shareImg_"+ key +"']").val(shareParam[key].path);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: ns.url("weapp://shop/weapp/share"),
|
||||
data: shareParam[key],
|
||||
dataType: 'JSON',
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
},
|
||||
});
|
||||
}else{
|
||||
layer.msg(res.message);
|
||||
}
|
||||
},
|
||||
deleteCallback: function(res){
|
||||
let key = this.elem.split('_')[1];
|
||||
|
||||
shareParam[key].path = '';
|
||||
$("input[name='shareImg_"+ key +"']").val(shareParam[key].path);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: ns.url("weapp://shop/weapp/share"),
|
||||
data: shareParam[key],
|
||||
dataType: 'JSON',
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('[name="share-title"]').change(function(){
|
||||
var key = $(this).parents('.detail-item').attr("data-key");
|
||||
shareParam[key].title = $(this).val();
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: ns.url("weapp://shop/weapp/share"),
|
||||
data: shareParam[key],
|
||||
dataType: 'JSON',
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
125
addon/weapp/shop/view/weapp/stat.html
Executable file
@@ -0,0 +1,125 @@
|
||||
<link rel="stylesheet" href="WEAPP_CSS/wx_access_statistics.css">
|
||||
<script src="SHOP_JS/echarts.min.js"></script>
|
||||
|
||||
<div class="access-statistics">
|
||||
<div>
|
||||
<blockquote class="layui-quote-nm layui-elem-quote">用户分析/昨日</blockquote>
|
||||
<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>
|
||||
<blockquote class="layui-quote-nm layui-elem-quote">接口分析/昨日</blockquote>
|
||||
<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>
|
||||
<blockquote class="layui-quote-nm layui-elem-quote">趋势图</blockquote>
|
||||
|
||||
<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;
|
||||
|
||||
element.on('tab(chart_tab)', function(){
|
||||
if(this.getAttribute('lay-id') == "interface" && is_render){
|
||||
is_render = false;
|
||||
getInterfaceStatistics();
|
||||
}
|
||||
});
|
||||
|
||||
//按钮事件
|
||||
util.event('lay-util', {
|
||||
week: function(othis){
|
||||
$(".layui-breadcrumb-item").removeClass("layui-breadcrumb-active");
|
||||
$(othis).addClass("layui-breadcrumb-active");
|
||||
date_type = "week";
|
||||
if(is_render == false){
|
||||
getInterfaceStatistics();
|
||||
}
|
||||
|
||||
}
|
||||
,month: function(othis){
|
||||
$(".layui-breadcrumb-item").removeClass("layui-breadcrumb-active");
|
||||
$(othis).addClass("layui-breadcrumb-active");
|
||||
date_type = "month";
|
||||
if(is_render == false){
|
||||
getInterfaceStatistics();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||