|  |  | 
 |  |  | <div class="layui-fluid layui-anim febs-anim" id="febs-user" lay-title="会员列表">
 | 
 |  |  | <div class="layui-fluid layui-anim febs-anim" id="febs-user" lay-title="会员充值USDT">
 | 
 |  |  |     <div class="layui-row febs-container">
 | 
 |  |  |         <div class="layui-col-md12">
 | 
 |  |  |             <div class="layui-card">
 | 
 |  |  | 
 |  |  |                                         </div>
 | 
 |  |  |                                     </div>
 | 
 |  |  |                                     <div class="layui-inline">
 | 
 |  |  |                                         <label class="layui-form-label layui-form-label-sm">创建时间</label>
 | 
 |  |  |                                         <div class="layui-input-inline">
 | 
 |  |  |                                             <input type="text" name="createTime" id="user-createTime" class="layui-input">
 | 
 |  |  |                                         </div>
 | 
 |  |  |                                     </div>
 | 
 |  |  |                                     <div class="layui-inline">
 | 
 |  |  |                                         <label class="layui-form-label layui-form-label-sm">订单状态</label>
 | 
 |  |  |                                         <div class="layui-input-inline">
 | 
 |  |  |                                             <select name="orderStatus">
 | 
 |  |  |                                                 <option value=""></option>
 | 
 |  |  |                                                 <option value="0"></option>
 | 
 |  |  |                                                 <option value="1">新建</option>
 | 
 |  |  |                                                 <option value="2">已付款</option>
 | 
 |  |  |                                                 <option value="3">已审核</option>
 | 
 |  |  | 
 |  |  |     </div>
 | 
 |  |  | </div>
 | 
 |  |  | <!-- 表格字段状态格式化 start -->
 | 
 |  |  | <script type="text/html" id="certify-status">
 | 
 |  |  |     {{#
 | 
 |  |  |     var certifyStatus = {
 | 
 |  |  |     0: {title: '未通过', color: 'red'},
 | 
 |  |  |     1: {title: '审核中', color: 'blue'},
 | 
 |  |  |     2: {title: '审核通过', color: 'green'},
 | 
 |  |  |     3: {title: '未实名', color: 'cyan'}
 | 
 |  |  |     }[d.certifyStatus];
 | 
 |  |  |     }}
 | 
 |  |  |     <span class="layui-badge febs-tag-{{certifyStatus.color}}">{{ certifyStatus.title }}</span>
 | 
 |  |  | </script>
 | 
 |  |  | <script type="text/html" id="order-Status">
 | 
 |  |  |     {{#
 | 
 |  |  |     var orderStatus = {
 | 
 |  |  |     1: {title: '新建' , color: 'green'},
 | 
 |  |  |     2: {title: '已付款' , color: 'red'}
 | 
 |  |  |     3: {title: '已审核' , color: 'green'},
 | 
 |  |  |     4: {title: '撤单' , color: 'red'}
 | 
 |  |  |     5: {title: '系统取消' , color: 'red'}
 | 
 |  |  |     }[d.orderStatus];
 | 
 |  |  |     }}
 | 
 |  |  |     <span class="layui-badge febs-tag-{{orderStatus.color}}">{{ orderStatus.title }}</span>
 | 
 |  |  | </script>
 | 
 |  |  | <script type="text/html" id="account-status">
 | 
 |  |  |     {{#
 | 
 |  |  |     var accountStatus = {
 | 
 |  |  |     1: {title: '正常', color : 'blue'},
 | 
 |  |  |     0: {title: '禁用', color : 'red'}
 | 
 |  |  |     }[d.accountStatus];
 | 
 |  |  |     }}
 | 
 |  |  |     <span class="layui-badge febs-bg-{{accountStatus.color}}">{{ accountStatus.title }}</span>
 | 
 |  |  | </script>
 | 
 |  |  | <!-- 表格字段状态格式化 start -->
 | 
 |  |  | 
 | 
 |  |  | <!-- 表格操作栏 start -->
 | 
 |  |  | <script type="text/html" id="user-option">
 | 
 |  |  |     <span shiro:lacksPermission="user:view,user:update,user:delete">
 | 
 |  |  |         <span class="layui-badge-dot febs-bg-orange"></span> 无权限
 | 
 |  |  |     </span>
 | 
 |  |  |     <a lay-event="detail" shiro:hasPermission="user:view"><i
 | 
 |  |  |             class="layui-icon febs-edit-area febs-green"></i></a>
 | 
 |  |  |     <a lay-event="edit" shiro:hasPermission="user:update"><i
 | 
 |  |  |             class="layui-icon febs-edit-area febs-blue"></i></a>
 | 
 |  |  |     <a lay-event="del" shiro:hasPermission="user:delete"><i class="layui-icon febs-edit-area febs-red"></i></a>
 | 
 |  |  |    <a lay-event="confirm" shiro:hasPermission="user:delete">确认</a>
 | 
 |  |  |    <i class="layui-icon febs-edit-area febs-blue"></i>
 | 
 |  |  |    <a lay-event="cancel" shiro:hasPermission="user:delete">系统撤单</a>
 | 
 |  |  | </script>
 | 
 |  |  | <!-- 表格操作栏 end -->
 | 
 |  |  | <script data-th-inline="none" type="text/javascript">
 | 
 |  |  | 
 |  |  |             $reset = $view.find('#reset'),
 | 
 |  |  |             $searchForm = $view.find('form'),
 | 
 |  |  |             sortObject = {field: 'createTime', type: null},
 | 
 |  |  |             tableIns,
 | 
 |  |  |             createTimeFrom,
 | 
 |  |  |             createTimeTo;
 | 
 |  |  |             tableIns;
 | 
 |  |  | 
 | 
 |  |  |         form.render();
 | 
 |  |  | 
 | 
 |  |  |         // 表格初始化
 | 
 |  |  |         initTable();
 | 
 |  |  | 
 | 
 |  |  |         // 时间组件
 | 
 |  |  |         laydate.render({
 | 
 |  |  |             elem: '#user-createTime',
 | 
 |  |  |             range: true,
 | 
 |  |  |             trigger: 'click'
 | 
 |  |  |         });
 | 
 |  |  | 
 | 
 |  |  |         // 新增下拉组件
 | 
 |  |  |         /**
 | 
 |  |  |         | 
 |  |  |         dropdown.render({
 | 
 |  |  |             elem: $view.find('.action-more'),
 | 
 |  |  |             click: function (name, elem, event) {
 | 
 |  |  |                 var checkStatus = table.checkStatus('userTable');
 | 
 |  |  |                 if (name === 'add') {
 | 
 |  |  |                     febs.modal.open('新增用户', 'system/user/add', {
 | 
 |  |  |                         btn: ['提交', '重置'],
 | 
 |  |  |                         area: $(window).width() <= 750 ? '95%' : '50%',
 | 
 |  |  |                         offset: '30px',
 | 
 |  |  |                         yes: function (index, layero) {
 | 
 |  |  |                             $('#user-add').find('#submit').trigger('click');
 | 
 |  |  |                         },
 | 
 |  |  |                         btn2: function () {
 | 
 |  |  |                             $('#user-add').find('#reset').trigger('click');
 | 
 |  |  |                             return false;
 | 
 |  |  |                         }
 | 
 |  |  |                     });
 | 
 |  |  |                 }
 | 
 |  |  |                 if (name === 'delete') {
 | 
 |  |  |                     if (!checkStatus.data.length) {
 | 
 |  |  |                         febs.alert.warn('请选择需要删除的用户');
 | 
 |  |  |                     } else {
 | 
 |  |  |                         febs.modal.confirm('删除用户', '确定删除该用户?', function () {
 | 
 |  |  |                             var userIds = [];
 | 
 |  |  |                             layui.each(checkStatus.data, function (key, item) {
 | 
 |  |  |                                 userIds.push(item.userId)
 | 
 |  |  |                             });
 | 
 |  |  |                             deleteUsers(userIds.join(','));
 | 
 |  |  |                         });
 | 
 |  |  |                     }
 | 
 |  |  |                 }
 | 
 |  |  |                 if (name === 'reset') {
 | 
 |  |  |                     if (!checkStatus.data.length) {
 | 
 |  |  |                         febs.alert.warn('请选择需要重置密码的用户');
 | 
 |  |  |                     } else {
 | 
 |  |  |                         var usernames = [];
 | 
 |  |  |                         layui.each(checkStatus.data, function (key, item) {
 | 
 |  |  |                             usernames.push(item.username)
 | 
 |  |  |                         });
 | 
 |  |  |                         febs.post(ctx + 'user/password/reset/' + usernames.join(','), null, function () {
 | 
 |  |  |                             febs.alert.success('所选用户密码已重置为1234qwer');
 | 
 |  |  |                         });
 | 
 |  |  |                     }
 | 
 |  |  |                 }
 | 
 |  |  |                 if (name === 'export') {
 | 
 |  |  |                     var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type});
 | 
 |  |  |                     params.pageSize = $view.find(".layui-laypage-limits option:selected").val();
 | 
 |  |  |                     params.pageNum = $view.find(".layui-laypage-em").next().html();
 | 
 |  |  |                     febs.download(ctx + 'user/excel', params, '用户信息表.xlsx');
 | 
 |  |  |                 }
 | 
 |  |  |             },
 | 
 |  |  |             options: [{
 | 
 |  |  |                 name: 'add',
 | 
 |  |  |                 title: '新增用户',
 | 
 |  |  |                 perms: 'user:add'
 | 
 |  |  |             }, {
 | 
 |  |  |                 name: 'delete',
 | 
 |  |  |                 title: '删除用户',
 | 
 |  |  |                 perms: 'user:delete'
 | 
 |  |  |             }, {
 | 
 |  |  |                 name: 'reset',
 | 
 |  |  |                 title: '密码重置',
 | 
 |  |  |                 perms: 'user:password:reset'
 | 
 |  |  |             }, {
 | 
 |  |  |                 name: 'export',
 | 
 |  |  |                 title: '导出Excel',
 | 
 |  |  |                 perms: 'user:export'
 | 
 |  |  |             }]
 | 
 |  |  |         });
 | 
 |  |  |          */
 | 
 |  |  | 
 | 
 |  |  |         // 下拉框选择器
 | 
 |  |  |         treeSelect.render({
 | 
 |  |  | 
 |  |  |         table.on('tool(userTable)', function (obj) {
 | 
 |  |  |             var data = obj.data,
 | 
 |  |  |                 layEvent = obj.event;
 | 
 |  |  |             if (layEvent === 'detail') {
 | 
 |  |  |                 febs.modal.view('用户信息', 'system/user/detail/' + data.username, {
 | 
 |  |  |                     area: $(window).width() <= 750 ? '95%' : '660px'
 | 
 |  |  |             if (layEvent === 'confirm') {
 | 
 |  |  |                 febs.modal.confirm('询问', '您是否确认收款,确认拨币USDT到该会员吗?', function () {
 | 
 |  |  |                    confirmUsers(data.id);
 | 
 |  |  |                 });
 | 
 |  |  |             }
 | 
 |  |  |             if (layEvent === 'del') {
 | 
 |  |  |                 febs.modal.confirm('删除用户', '确定删除该用户?', function () {
 | 
 |  |  |                     deleteUsers(data.userId);
 | 
 |  |  |                 });
 | 
 |  |  |             }
 | 
 |  |  |             if (layEvent === 'edit') {
 | 
 |  |  |                 febs.modal.open('修改用户', 'system/user/update/' + data.username, {
 | 
 |  |  |                     area: $(window).width() <= 750 ? '90%' : '50%',
 | 
 |  |  |                     offset: '30px',
 | 
 |  |  |                     btn: ['提交', '取消'],
 | 
 |  |  |                     yes: function (index, layero) {
 | 
 |  |  |                         $('#user-update').find('#submit').trigger('click');
 | 
 |  |  |                     },
 | 
 |  |  |                     btn2: function () {
 | 
 |  |  |                         layer.closeAll();
 | 
 |  |  |                     }
 | 
 |  |  |             if (layEvent === 'cancel') {
 | 
 |  |  |                 febs.modal.confirm('系统撤单', '您是否后台撤销该记录吗?', function () {
 | 
 |  |  |                    cancelUsers(data.id);
 | 
 |  |  |                 });
 | 
 |  |  |             }
 | 
 |  |  |         });
 | 
 |  |  |          | 
 |  |  |         function confirmUsers(id) {
 | 
 |  |  |             febs.get(ctx + 'member/memberChargeUsdtConfirm/' + id, null, function () {
 | 
 |  |  |                febs.alert.success('划转成功');
 | 
 |  |  |                 $query.click();
 | 
 |  |  |             });
 | 
 |  |  |         }
 | 
 |  |  |         function cancelUsers(id) {
 | 
 |  |  |             febs.get(ctx + 'member/memberChargeUsdtCancel/' + id, null, function () {
 | 
 |  |  |                febs.alert.success('设置为系统取消');
 | 
 |  |  |                 $query.click();
 | 
 |  |  |             });
 | 
 |  |  |         }
 | 
 |  |  | 
 | 
 |  |  |         // 查询按钮
 | 
 |  |  |         $query.on('click', function () {
 | 
 |  |  | 
 |  |  |             $searchForm[0].reset();
 | 
 |  |  |             treeSelect.revokeNode('dept');
 | 
 |  |  |             sortObject.type = 'null';
 | 
 |  |  |             createTimeTo = null;
 | 
 |  |  |             createTimeFrom = null;
 | 
 |  |  |             tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject});
 | 
 |  |  |         });
 | 
 |  |  | 
 | 
 |  |  | 
 |  |  |                 elem: $view.find('table'),
 | 
 |  |  |                 id: 'userTable',
 | 
 |  |  |                 url: ctx + 'member/memberChargeUsdt',
 | 
 |  |  |                 totalRow: true,
 | 
 |  |  |                 cols: [[
 | 
 |  |  |                     {type: 'checkbox'},
 | 
 |  |  |                     {field: 'memberId', title: '邀请码UID'},
 | 
 |  |  |                     {title: '订单状态', templet: '#order-Status'},
 | 
 |  |  |                     {field: 'createTime', title: '下单时间', minWidth: 180},
 | 
 |  |  |                     {title: '操作', toolbar: '#user-option', minWidth: 140, fixed : 'right'}
 | 
 |  |  |                     {field: 'phone', title: '手机号码', minWidth: 120,align:'left',totalRowText: '合计'},
 | 
 |  |  |                     {field: 'email', title: '邮箱', minWidth: 200,align:'left'},
 | 
 |  |  |                     {field: 'inviteId', title: '邀请码UID', minWidth: 120,align:'center'},
 | 
 |  |  |                     {field: 'amountCny', title: '人民币金额', minWidth: 120,align:'center',totalRow: true},
 | 
 |  |  |                     {field: 'amountUsdt', title: 'USDT金额', minWidth: 120,align:'center',totalRow: true},
 | 
 |  |  |                     {field: 'unitPrice', title: '单价', minWidth: 80,align:'center'},
 | 
 |  |  |                     {field: 'orderStatus', title: '付款状态',
 | 
 |  |  |                        templet: function (d) {
 | 
 |  |  |                             if (d.orderStatus === 1) {
 | 
 |  |  |                                 return '<span style="color:gray;">新建</span>'
 | 
 |  |  |                             } else if(d.orderStatus === 2){
 | 
 |  |  |                                 return '<span style="color:red;">已付款</span>'
 | 
 |  |  |                             } else if(d.orderStatus === 3){
 | 
 |  |  |                                 return '<span style="color:green;">已审核</span>'
 | 
 |  |  |                            } else if(d.orderStatus === 4){
 | 
 |  |  |                                return '<span style="color:gray;">撤单</span>'
 | 
 |  |  |                             } else if(d.orderStatus === 5){
 | 
 |  |  |                                 return '<span style="color:blue;">系统取消</span>'
 | 
 |  |  |                             }else{
 | 
 |  |  |                                 return ''
 | 
 |  |  |                             }
 | 
 |  |  |                         }, minWidth: 120,align:'center'},
 | 
 |  |  |                     {field: 'paymentName', title: '收款人', minWidth: 150,align:'center'},
 | 
 |  |  |                     {field: 'paymentAccount', title: '收款账号', minWidth: 150,align:'center'},
 | 
 |  |  |                     {field: 'paymentType', title: '收款方式',
 | 
 |  |  |                        templet: function (d) {
 | 
 |  |  |                             if (d.status === 1) {
 | 
 |  |  |                                 return '<span>支付宝</span>'
 | 
 |  |  |                             } else if(d.status === 2){
 | 
 |  |  |                                 return '<span>微信</span>'
 | 
 |  |  |                             } else if(d.status === 3){
 | 
 |  |  |                                 return '<span>银行卡</span>'
 | 
 |  |  |                             }else{
 | 
 |  |  |                                 return '<span style="color:red;">无</span>'
 | 
 |  |  |                             }
 | 
 |  |  |                         }, minWidth: 150,align:'center'},
 | 
 |  |  |                     {title: '操作',  | 
 |  |  |                        templet: function (d) {
 | 
 |  |  |                             if (d.orderStatus === 2) {
 | 
 |  |  |                                return '<a lay-event="confirm" shiro:hasPermission="user:delete">确认</a>'
 | 
 |  |  |                                +'<i class="layui-icon febs-edit-area febs-blue"></i>'
 | 
 |  |  |                                +'<a lay-event="cancel" shiro:hasPermission="user:delete">系统撤单</a>'
 | 
 |  |  |                             }else {
 | 
 |  |  |                                 return ''
 | 
 |  |  |                             }
 | 
 |  |  |                         },minWidth: 200,align:'center'},
 | 
 |  |  |                     {field: 'orderNo', title: '订单编号', minWidth: 150,align:'center'},
 | 
 |  |  |                     {field: 'createTime', title: '充值时间', minWidth: 180,align:'center'}
 | 
 |  |  |                 ]]
 | 
 |  |  |             });
 | 
 |  |  |         }
 | 
 |  |  | 
 | 
 |  |  |         // 获取查询参数
 | 
 |  |  |         function getQueryParams() {
 | 
 |  |  |             var createTime = $searchForm.find('input[name="createTime"]').val();
 | 
 |  |  |             if (createTime) {
 | 
 |  |  |                 createTimeFrom = createTime.split(' - ')[0];
 | 
 |  |  |             }
 | 
 |  |  |             return {
 | 
 |  |  |                 startTime: createTimeFrom,
 | 
 |  |  |                 account: $searchForm.find('input[name="account"]').val().trim(),
 | 
 |  |  |                account: $searchForm.find('input[name="account"]').val().trim(),
 | 
 |  |  |                 orderStatus: $searchForm.find("select[name='orderStatus']").val(),
 | 
 |  |  |             };
 | 
 |  |  |         }
 | 
 |  |  | 
 | 
 |  |  |         function deleteUsers(userIds) {
 | 
 |  |  |             var currentUserId = currentUser.userId + '';
 | 
 |  |  |             if (('' + userIds).split(',').indexOf(currentUserId) !== -1) {
 | 
 |  |  |                 febs.alert.warn('所选用户包含当前登录用户,无法删除');
 | 
 |  |  |                 return;
 | 
 |  |  |             }
 | 
 |  |  |             febs.get(ctx + 'user/delete/' + userIds, null, function () {
 | 
 |  |  |                 febs.alert.success('删除用户成功');
 | 
 |  |  |                 $query.click();
 | 
 |  |  |             });
 | 
 |  |  |         }
 | 
 |  |  |          | 
 |  |  |     })
 | 
 |  |  | </script> |