78 lines
2.3 KiB
HTML
Executable File
78 lines
2.3 KiB
HTML
Executable File
<!-- 列表 -->
|
|
<table id="good_list" lay-filter="good_list"></table>
|
|
|
|
<!-- 商品 -->
|
|
<script type="text/html" id="goodIntro">
|
|
<div class="table-title">
|
|
<div class="title-pic">
|
|
{{# if(d.sku_image){ }}
|
|
<img layer-src src="{{ns.img(d.sku_image.split(',')[0],'small')}}"/>
|
|
{{# } }}
|
|
</div>
|
|
<div class="title-content">
|
|
<a href="javascript:;" class="multi-line-hiding text-color">{{d.sku_name}}</a>
|
|
</div>
|
|
</div>
|
|
</script>
|
|
|
|
<script>
|
|
var form, table, laytpl;
|
|
|
|
layui.use(['form', 'laytpl'], function() {
|
|
form = layui.form;
|
|
laytpl = layui.laytpl;
|
|
form.render();
|
|
|
|
table = new Table({
|
|
elem: '#good_list',
|
|
url: '{:addon_url("shop/goods/goodsbrowse")}',
|
|
async : false,
|
|
where: {'goods_id': "{$goods_id}"},
|
|
parseData: function(res) {
|
|
return {
|
|
"code": res.code,
|
|
"msg": res.message,
|
|
"count": res.data.count,
|
|
"data": res.data.list,
|
|
};
|
|
},
|
|
cols: [
|
|
[{
|
|
title: '商品',
|
|
unresize: 'false',
|
|
width: '30%',
|
|
templet: '#goodIntro'
|
|
},{
|
|
title: '会员',
|
|
unresize: 'false',
|
|
width: '30%',
|
|
align: 'left',
|
|
templet: function(data) {
|
|
return data.nickname;
|
|
}
|
|
}, {
|
|
title: '浏览时间',
|
|
unresize: 'false',
|
|
width: '20%',
|
|
align: 'left',
|
|
templet: function(data){
|
|
return ns.time_to_date(data.browse_time);
|
|
}
|
|
}]
|
|
]
|
|
});
|
|
|
|
/**
|
|
* 搜索功能
|
|
*/
|
|
form.on('submit(search)', function(data) {
|
|
table.reload({
|
|
page: {
|
|
curr: 1
|
|
},
|
|
where: data.field
|
|
});
|
|
});
|
|
});
|
|
</script>
|