87 lines
3.2 KiB
HTML
87 lines
3.2 KiB
HTML
{extend name="app/shop/view/base.html"/}
|
|
{block name="resources"}
|
|
<style>
|
|
#selectMemberContent {
|
|
padding: 0 30px;
|
|
}
|
|
</style>
|
|
{/block}
|
|
|
|
{block name="body"}
|
|
<div id="selectMemberContent">
|
|
<!-- 搜索框 -->
|
|
<div class="single-filter-box top">
|
|
<div class="layui-form" style="width: 100%!important;">
|
|
<div class="layui-input-inline" style="width: 100%!important;margin: 0!important;">
|
|
<input type="text" name="member_search" placeholder="请输入用户昵称|手机号" autocomplete="off" class="layui-input">
|
|
<button id="searchButton" type="button" class="layui-btn layui-btn-primary" lay-filter="search" lay-submit>
|
|
<i class="layui-icon"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- 列表 -->
|
|
<table id="memberList" lay-filter="memberList"></table>
|
|
<!--子窗体保存值的临时控件-->
|
|
<input type="hidden" id="memberInfo" value="" />
|
|
<!-- 操作 -->
|
|
<script type="text/html" id="operation">
|
|
<div class="table-btn">
|
|
<a class="layui-btn" lay-event="selected">确认选中</a>
|
|
</div>
|
|
</script>
|
|
</div>
|
|
{/block}
|
|
|
|
{block name="script"}
|
|
<script>
|
|
var form, table,select_type = "{$select_type}";
|
|
layui.use(['form'], function() {
|
|
// 基本参数
|
|
_thisIndex = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
|
form = layui.form;
|
|
form.render();
|
|
table = new Table({
|
|
elem: '#memberList',
|
|
url: ns.url("shop/member/selectmember", { select_type:select_type }),
|
|
cols: [[
|
|
{
|
|
title: '用户信息', width: '35%', unresize: 'false', align: 'left', templet: function (data) {
|
|
var html = '';
|
|
html += `
|
|
<div>
|
|
<img style="width:40px; height:40px; margin-right:20px;" layer-src src="${ns.img(data.headimg)}" onerror="this.src = '{:img('public/static/img/default_img/head.png')}' ">
|
|
<span>${data.nickname}</span>
|
|
</div>
|
|
`;
|
|
return html;
|
|
}
|
|
},
|
|
{field: 'mobile', title: '手机号', unresize: 'false', width: '20%', align: 'center'},
|
|
{field: 'balance', title: '余额', unresize: 'false', width: '20%', align: 'center'},
|
|
// {field: 'point', title: '积分', unresize: 'false', width: '15%'},
|
|
{title: '操作', toolbar: '#operation', unresize: 'false', align: 'right'}
|
|
]]
|
|
});
|
|
//监听工具栏操作
|
|
table.tool(function(obj) {
|
|
var data = obj.data;
|
|
if(obj.event === 'selected'){
|
|
$("#memberInfo").val(JSON.stringify(data));
|
|
}
|
|
|
|
// 关闭弹框
|
|
parent.layer.close(_thisIndex); //再执行关闭
|
|
});
|
|
//搜索功能
|
|
form.on('submit(search)', function(data) {
|
|
table.reload({
|
|
page: {
|
|
curr: 1
|
|
},
|
|
where: data.field
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
{/block} |