glhcp/server/app/admin/view/statistics/shop.html

153 lines
5.0 KiB
HTML

{layout name="layout1" /}
<div class="wrapper">
<div class="layui-form" lay-filter="">
<div class="layui-card" >
<div class="layui-card-body">
<div class="layui-inline">
<label class="layui-form-label">排序方式:</label>
<div class="layui-input-block">
<select name="search_key">
<option value="sales_price">按销售金额排序</option>
<option value="visited_num">按进店人数排序</option>
<option value="follow_num">按关注店铺人数排序</option>
</select>
</div>
</div>
<div class="layui-inline">
<button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
lay-filter="shop-search">查询
</button>
<button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
lay-filter="shop-clear-search">重置
</button>
</div>
</div>
</div>
<div class="layui-tab-item layui-show">
<div class="layui-card">
<div class="layui-card-body">
<table id="shop-lists" lay-filter="shop-lists"></table>
<!--商家信息-->
<script type="text/html" id="shop">
<div style="text-align: left;">
<img src="{{ d.logo }}" style="height:80px;width: 80px" class="image-show layui-col-md4">
<p>商家编号:{{d.id}}</p>
<p>商家名称:{{d.name}}</p>
<p>商家类型:{{d.type_desc}}</p>
</div>
</script>
</div>
</div>
</div>
</div>
</div>
<script>
layui.config({
version:"{$front_version}",
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index','table','like','echarts','form'], function(){
var $ = layui.$
, form = layui.form
, table = layui.table
, like = layui.like
, element = layui.element
, laydate = layui.laydate;
//日期时间范围
laydate.render({
elem: '#start_time'
, type: 'datetime'
});
laydate.render({
elem: '#end_time'
, type: 'datetime'
});
//监听搜索
form.on('submit(shop-search)', function (data) {
var field = data.field;
//执行重载
table.reload('shop-lists', {
where: field,
page: {
curr: 1
}
});
});
//清空查询
form.on('submit(shop-clear-search)', function () {
form.render('select');
//刷新列表
table.reload('shop-lists', {
where: [],
page: {
curr: 1
}
});
});
//获取列表
getList();
function getList() {
table.render({
elem: '#shop-lists'
,url:'{:url("statistics/shop")}'
, cols: [[
{field:'number',title: '排序',width:120,align: 'center'}
, {field: 'shop', title: '商家信息', align: 'center',templet:'#shop',width:300}
, {field: 'sales_price', title: '销售金额', align: 'center',width:120}
, {field: 'visited_num', title: '进店人数', align: 'center',width:120}
, {field: 'follow_num', title: '关注人数', align: 'center',width:120}
]]
, page: true
, limits: [10,20,30,40,50]
, text: {none: '暂无数据!'}
,response: {
statusCode: 1
}
, parseData: function (res) {
return {
"code": res.code,
"msg": res.msg,
"count": res.data.count,
"data": res.data.lists,
};
}
,done: function(res, curr, count){
// 解决操作栏因为内容过多换行问题
$(".layui-table-main tr").each(function (index, val) {
$($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
$($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
});
}
});
}
});
</script>
</body>
</html>