|  |  |  | 
|---|
|  |  |  | <div class="layui-form-item"> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input type="text" placeholder="用户名" name="name" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input type="text" placeholder="手机号/邮箱/邀请码" name="account" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">审核状态</label> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">账户状态</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <select name="certifyStatus"> | 
|---|
|  |  |  | <select name="accountStatus"> | 
|---|
|  |  |  | <option value="">请选择</option> | 
|---|
|  |  |  | <option value="1">待审核</option> | 
|---|
|  |  |  | <option value="2">审核通过</option> | 
|---|
|  |  |  | <option value="3">未实名</option> | 
|---|
|  |  |  | <option value="1">正常</option> | 
|---|
|  |  |  | <option value="2">禁用</option> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | <a lay-event="edit" shiro:hasPermission="user:update"><i | 
|---|
|  |  |  | class="layui-icon febs-edit-area febs-blue"></i></a> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <script type="text/html" id="switchStatus"> | 
|---|
|  |  |  | {{# if(d.accountStatus === 1) { }} | 
|---|
|  |  |  | <input type="checkbox" value={{d.id}} lay-text="正常|禁用" checked lay-skin="switch" lay-filter="switchStatus"> | 
|---|
|  |  |  | {{# } else { }} | 
|---|
|  |  |  | <input type="checkbox" value={{d.id}} lay-text="正常|禁用" lay-skin="switch" lay-filter="switchStatus"> | 
|---|
|  |  |  | {{# } }} | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | .layui-form-onswitch { | 
|---|
|  |  |  | background-color: #5FB878 !important; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | <!-- 表格操作栏 end --> | 
|---|
|  |  |  | <script data-th-inline="none" type="text/javascript"> | 
|---|
|  |  |  | // 引入组件并初始化 | 
|---|
|  |  |  | 
|---|
|  |  |  | table.on('tool(userTable)', function (obj) { | 
|---|
|  |  |  | var data = obj.data, | 
|---|
|  |  |  | layEvent = obj.event; | 
|---|
|  |  |  | if (layEvent === 'disagree') { | 
|---|
|  |  |  | febs.modal.confirm('禁止', '确认禁止平仓功能?', function () { | 
|---|
|  |  |  | disagree(data.id); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (layEvent === 'close') { | 
|---|
|  |  |  | febs.modal.confirm('禁用', '确认禁用该账号?', function () { | 
|---|
|  |  |  | closeAccount(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'agree') { | 
|---|
|  |  |  | febs.modal.confirm('开启', '确认开启平仓功能?', function () { | 
|---|
|  |  |  | agree(data.id); | 
|---|
|  |  |  | if (layEvent === 'open') { | 
|---|
|  |  |  | febs.modal.confirm('开启', '确认开启该账号?', function () { | 
|---|
|  |  |  | openAccount(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (layEvent === 'edit') { | 
|---|
|  |  |  | febs.modal.open('身份认证', 'modules/member/memberDetail/' + data.id, { | 
|---|
|  |  |  | btn: ['提交', '取消'], | 
|---|
|  |  |  | yes: function (index, layero) { | 
|---|
|  |  |  | $('#user-update').find('#submit').trigger('click'); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | btn2: function () { | 
|---|
|  |  |  | layer.closeAll(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'reset') { | 
|---|
|  |  |  | febs.modal.confirm('重置密码', '是否重置该账号密码?', function () { | 
|---|
|  |  |  | resetPwd(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (layEvent === 'see') { | 
|---|
|  |  |  | febs.modal.open( '身份认证', 'modules/member/memberDetail/' + data.id, { | 
|---|
|  |  |  | febs.modal.open( '个人信息', 'modules/mallMember/detail/' + data.id, { | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'addCoin') { | 
|---|
|  |  |  | febs.modal.open( '拨币', 'modules/member/addCoin/' + data.id, { | 
|---|
|  |  |  | if (layEvent === 'moneyFlow') { | 
|---|
|  |  |  | febs.modal.open( '用户资金流水', 'modules/mallMember/moneyFlow/' + data.id, { | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'systemPay') { | 
|---|
|  |  |  | febs.modal.open('系统拨付', 'modules/mallMember/mallSystemPay/' + data.id, { | 
|---|
|  |  |  | btn: ['提交', '取消'], | 
|---|
|  |  |  | yes: function (index, layero) { | 
|---|
|  |  |  | $('#user-update').find('#submit').trigger('click'); | 
|---|
|  |  |  | $('#systemPay-update').find('#submit').trigger('click'); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | btn2: function () { | 
|---|
|  |  |  | layer.closeAll(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'examine') { | 
|---|
|  |  |  | febs.modal.open( '个人数据详情', 'modules/member/memberDetailInfo/' + data.inviteId, { | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | function disagree(id) { | 
|---|
|  |  |  | febs.get(ctx + 'tradeManage/disagreePositionSetting/' + id, null, function () { | 
|---|
|  |  |  | febs.alert.success('禁止成功'); | 
|---|
|  |  |  | function closeAccount(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/mallMember/closeAccount/' + id, null, function () { | 
|---|
|  |  |  | febs.alert.success('禁用成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | function agree(id) { | 
|---|
|  |  |  | febs.get(ctx + 'tradeManage/agreePositionSetting/' + id, null, function () { | 
|---|
|  |  |  | function openAccount(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/mallMember/openAccount/' + id, null, function () { | 
|---|
|  |  |  | febs.alert.success('开启成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function resetPwd(id) { | 
|---|
|  |  |  | febs.post(ctx + 'admin/mallMember/resetPwd/' + id, null, function () { | 
|---|
|  |  |  | febs.alert.success('重置成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | id: 'userTable', | 
|---|
|  |  |  | url: ctx + 'admin/mallMember/getMallMemberList', | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {field: 'phone', title: '手机号', minWidth: 150,align:'left'} | 
|---|
|  |  |  | {field: 'phone', title: '账号', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | {field: 'bindPhone', title: '手机号', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | // {field: 'email', title: '邮箱', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | // {field: 'realName', title: '姓名', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | // {field: 'inviteId', title: '邀请码UID', | 
|---|
|  |  |  | //     templet: function (d) { | 
|---|
|  |  |  | //         return '<a lay-event="examine" shiro:hasPermission="user:update">'+d.inviteId+'</a>' | 
|---|
|  |  |  | //     }, minWidth: 80,align:'center'}, | 
|---|
|  |  |  | // {field: 'refererId', title: '上级邀请码UID', minWidth: 80,align:'center'}, | 
|---|
|  |  |  | // {field: 'accountType', title: '账号类型', | 
|---|
|  |  |  | //     templet: function (d) { | 
|---|
|  |  |  | //         if (d.accountType === 2) { | 
|---|
|  |  |  | //             return '<span style="color:green;">测试账号</span>' | 
|---|
|  |  |  | //         } else if (d.accountType === 1) { | 
|---|
|  |  |  | //             return '<span style="color:red;">正常账号</span>' | 
|---|
|  |  |  | //         }else{ | 
|---|
|  |  |  | //             return '' | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     }, minWidth: 80,align:'center'}, | 
|---|
|  |  |  | // {field: 'accountStatus', title: '账号状态', | 
|---|
|  |  |  | //     templet: function (d) { | 
|---|
|  |  |  | //         if (d.accountStatus === 1) { | 
|---|
|  |  |  | //             return '<span style="color:green;">正常</span>' | 
|---|
|  |  |  | //         } else if (d.accountStatus === 0) { | 
|---|
|  |  |  | //             return '<span style="color:red;">禁用</span>' | 
|---|
|  |  |  | //         }else{ | 
|---|
|  |  |  | //             return '' | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     }, minWidth: 80,align:'center'}, | 
|---|
|  |  |  | // {field: 'certifyStatus', title: '审核状态', | 
|---|
|  |  |  | //     templet: function (d) { | 
|---|
|  |  |  | //         if (d.certifyStatus === 0) { | 
|---|
|  |  |  | //             return '<span style="color:red;">未通过</span>' | 
|---|
|  |  |  | //         } else if (d.certifyStatus === 1) { | 
|---|
|  |  |  | //             return '<span style="color:blue;">待审核</span>' | 
|---|
|  |  |  | //         } else if (d.certifyStatus === 2) { | 
|---|
|  |  |  | //             return '<span style="color:green;">审核通过</span>' | 
|---|
|  |  |  | //         } else if (d.certifyStatus === 3) { | 
|---|
|  |  |  | //             return '<span>未实名</span>' | 
|---|
|  |  |  | //         }else{ | 
|---|
|  |  |  | //             return '' | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     }, minWidth: 80,align:'center'}, | 
|---|
|  |  |  | // {field: 'pcState', title: '是否可平仓', | 
|---|
|  |  |  | //     templet: function (d) { | 
|---|
|  |  |  | //         if (d.pcState === 1) { | 
|---|
|  |  |  | //             return '<span style="color:#ff0000;">否</span>' | 
|---|
|  |  |  | //         } else { | 
|---|
|  |  |  | //             return '<span style="color:green;">是</span>' | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     },minWidth: 100,align:'center'}, | 
|---|
|  |  |  | // {field: 'createTime', title: '注册时间', minWidth: 180,align:'center'}, | 
|---|
|  |  |  | // {title: '操作', | 
|---|
|  |  |  | //     templet: function (d) { | 
|---|
|  |  |  | //         if (d.certifyStatus === 1) { | 
|---|
|  |  |  | //             if(d.pcState === 1){ | 
|---|
|  |  |  | //                 return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" shiro:hasPermission="user:update">审核认证</button>' | 
|---|
|  |  |  | //                     +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="addCoin" shiro:hasPermission="user:update">拨币</button>' | 
|---|
|  |  |  | //                     +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agree" shiro:hasPermission="user:update">开启</button>' | 
|---|
|  |  |  | //             }else{ | 
|---|
|  |  |  | //                 return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" shiro:hasPermission="user:update">审核认证</button>' | 
|---|
|  |  |  | //                     +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="addCoin" shiro:hasPermission="user:update">拨币</button>' | 
|---|
|  |  |  | //                     +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="disagree" shiro:hasPermission="user:update">禁止</button>' | 
|---|
|  |  |  | //             } | 
|---|
|  |  |  | //         }else if(d.certifyStatus === 2){ | 
|---|
|  |  |  | //             if(d.pcState === 1){ | 
|---|
|  |  |  | //                 return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="see" shiro:hasPermission="user:update">查看</button>' | 
|---|
|  |  |  | //                     +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="addCoin" shiro:hasPermission="user:update">拨币</button>' | 
|---|
|  |  |  | //                     +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agree" shiro:hasPermission="user:update">开启</button>' | 
|---|
|  |  |  | //             }else{ | 
|---|
|  |  |  | //                 return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="see" shiro:hasPermission="user:update">查看</button>' | 
|---|
|  |  |  | //                     +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="addCoin" shiro:hasPermission="user:update">拨币</button>' | 
|---|
|  |  |  | //                     +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="disagree" shiro:hasPermission="user:update">禁止</button>' | 
|---|
|  |  |  | //             } | 
|---|
|  |  |  | //         }else { | 
|---|
|  |  |  | //             if(d.pcState === 1){ | 
|---|
|  |  |  | //                 return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="addCoin" shiro:hasPermission="user:update">拨币</button>' | 
|---|
|  |  |  | //                     +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agree" shiro:hasPermission="user:update">开启</button>' | 
|---|
|  |  |  | //             }else{ | 
|---|
|  |  |  | //                 return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="addCoin" shiro:hasPermission="user:update">拨币</button>' | 
|---|
|  |  |  | //                     +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="disagree" shiro:hasPermission="user:update">禁止</button>' | 
|---|
|  |  |  | //             } | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     },minWidth: 300,align:'center'} | 
|---|
|  |  |  | {field: 'name', title: '名称', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'balance', title: '积分余额', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'inviteId', title: '邀请码', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | // {field: 'referrerId', title: '推荐人邀请码', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'referrerName', title: '推荐人', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'accountType', title: '账号类型', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.accountType === 2) { | 
|---|
|  |  |  | return '<span style="color:red;">测试账号</span>' | 
|---|
|  |  |  | } else if (d.accountType === 1) { | 
|---|
|  |  |  | return '<span style="color:green;">正常账号</span>' | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, minWidth: 80,align:'center'}, | 
|---|
|  |  |  | {field: 'accountStatus', title: '账号状态', templet: '#switchStatus', minWidth: 80,align:'center'}, | 
|---|
|  |  |  | {field: 'createdTime', title: '注册时间', minWidth: 180,align:'center'}, | 
|---|
|  |  |  | {title: '操作', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.accountStatus === 1) { | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="see" shiro:hasPermission="user:update">详情</button>' | 
|---|
|  |  |  | // +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="close" shiro:hasPermission="user:update">禁用</button>' | 
|---|
|  |  |  | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="reset" shiro:hasPermission="user:update">重置密码</button>' | 
|---|
|  |  |  | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="systemPay" shiro:hasPermission="user:update">积分拨付</button>' | 
|---|
|  |  |  | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="moneyFlow" shiro:hasPermission="user:update">资金流水</button>' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="see" shiro:hasPermission="user:update">详情</button>' | 
|---|
|  |  |  | // +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="open" shiro:hasPermission="user:update">启用</button>' | 
|---|
|  |  |  | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="reset" shiro:hasPermission="user:update">重置密码</button>' | 
|---|
|  |  |  | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="moneyFlow" shiro:hasPermission="user:update">资金流水</button>' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | },minWidth: 300,align:'center'} | 
|---|
|  |  |  | ]] | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | // 获取查询参数 | 
|---|
|  |  |  | function getQueryParams() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | name: $searchForm.find('input[name="name"]').val().trim(), | 
|---|
|  |  |  | account: $searchForm.find('input[name="account"]').val().trim(), | 
|---|
|  |  |  | certifyStatus: $searchForm.find("select[name='certifyStatus']").val(), | 
|---|
|  |  |  | accountStatus: $searchForm.find("select[name='accountStatus']").val(), | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | form.on('switch(switchStatus)', function (data) { | 
|---|
|  |  |  | if (data.elem.checked) { | 
|---|
|  |  |  | openAccount(data.value); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | closeAccount(data.value); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | </script> | 
|---|