|  |  |  | 
|---|
|  |  |  | <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 === 'close') { | 
|---|
|  |  |  | febs.modal.confirm('禁用', '确认禁用该账号?', function () { | 
|---|
|  |  |  | closeAccount(data.id); | 
|---|
|  |  |  | 
|---|
|  |  |  | {field: 'bindPhone', title: '手机号', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | // {field: 'email', title: '邮箱', minWidth: 150,align:'left'}, | 
|---|
|  |  |  | {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: 'referrerId', title: '推荐人邀请码', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'referrerName', title: '推荐人', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'accountType', title: '账号类型', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.accountType === 2) { | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 === 2) { | 
|---|
|  |  |  | return '<span style="color:red;">禁用</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="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="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>' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | form.on('switch(switchStatus)', function (data) { | 
|---|
|  |  |  | if (data.elem.checked) { | 
|---|
|  |  |  | openAccount(data.value); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | closeAccount(data.value); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | </script> | 
|---|