| | |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body febs-table-full"> |
| | | <form class="layui-form layui-table-form" lay-filter="user-table-form"> |
| | | <form class="layui-form layui-table-form" lay-filter="user-perk-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | |
| | | <input type="text" placeholder="邀请码(获取团队下的所有成员)" name="inviteId" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">用户类型:</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="isRobot"> |
| | | <option value="">请选择</option> |
| | | <option value="0">用户</option> |
| | | <option value="1">机器人</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label">用户类型:</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select name="isRobot">--> |
| | | <!-- <option value="">请选择</option>--> |
| | | <!-- <option value="0">用户</option>--> |
| | | <!-- <option value="1">机器人</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table lay-filter="userChatTable" lay-data="{id: 'userChatTable'}"></table> |
| | | <table lay-filter="userPerkTable" lay-data="{id: 'userPerkTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | phone: $searchForm.find('input[name="phone"]').val().trim(), |
| | | // nickName: $searchForm.find('input[name="nickName"]').val().trim(), |
| | | inviteId: $searchForm.find('input[name="inviteId"]').val().trim(), |
| | | isRobot: $searchForm.find("select[name='isRobot']").val() |
| | | // isRobot: $searchForm.find("select[name='isRobot']").val() |
| | | }; |
| | | } |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'userChatTable', |
| | | id: 'userPerkTable', |
| | | url: ctx + 'admin/chat/getUserPerkList', |
| | | toolbar:"#toolbar", |
| | | defaultToolbar:[], |
| | | // toolbar:"#toolbar", |
| | | // defaultToolbar:[], |
| | | totalRow: true ,// 开启合计行 |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | // {type: 'checkbox'}, |
| | | {field: 'userId', title: '标识', minWidth: 40,align:'center'}, |
| | | {field: 'phone', title: '电话号码', minWidth: 120,align:'center', totalRowText: '合计:'}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 100,align:'center',}, |
| | |
| | | {field: 'avaAmount', title: '账户余额', minWidth: 80,align:'center',totalRow: '{{= parseInt(d.avaAmount) }}'}, |
| | | {field: 'groupRedBagNum', title: '群红包数', minWidth: 80,align:'center'}, |
| | | {field: 'redBagTotalAmount', title: '发红包总额', minWidth: 100,align:'center'}, |
| | | {field: 'redBagAvaAmount', title: '未领取总额', minWidth: 100,align:'center'}, |
| | | {field: 'getRedbagAmount', title: '领红包金额', minWidth: 100,align:'center'}, |
| | | {field: 'boomToAmount', title: '中雷返回金额', minWidth: 120,align:'center'}, |
| | | {field: 'teamPerkAmount', title: '等级收益金额', minWidth: 120,align:'center'}, |
| | | {field: 'redBagAvaAmount', title: '未被领取总额', minWidth: 120,align:'center'}, |
| | | {field: 'getRedbagAmount', title: '领取红包总额', minWidth: 120,align:'center'}, |
| | | {field: 'boomToAmount', title: '中雷扣除', minWidth: 120,align:'center'}, |
| | | {field: 'teamPerkAmount', title: '中雷补偿团队奖励', minWidth: 160,align:'center'}, |
| | | {field: 'getBoom', title: '中雷', templet: '#switchGetBoom', minWidth: 80,align:'center'}, |
| | | {field: 'createTime', title: '注册时间', minWidth: 160,align:'center'}, |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | table.on('toolbar(userChatTable)', function(obj){ |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | |
| | | // if (layEvent === 'registerMember') { |
| | | // febs.get(ctx + 'admin/chat/registerMember/', null, function () { |
| | | // febs.alert.success('操作成功'); |
| | | // $query.click(); |
| | | // }); |
| | | // } |
| | | |
| | | if (layEvent === 'registerMember') { |
| | | var checkData = table.checkStatus('userChatTable').data; |
| | | if (checkData.length <= 0) { |
| | | febs.alert.warn('请选择需要的用户'); |
| | | return; |
| | | } |
| | | if (checkData.length > 1) { |
| | | febs.alert.warn('请选择一个用户'); |
| | | return; |
| | | } |
| | | registerMember("添加会员", checkData[0].inviteId, 1); |
| | | } |
| | | |
| | | if (layEvent === 'balance') { |
| | | var checkData = table.checkStatus('userChatTable').data; |
| | | if (checkData.length <= 0) { |
| | | febs.alert.warn('请选择需要的用户'); |
| | | return; |
| | | } |
| | | if (checkData.length > 1) { |
| | | febs.alert.warn('请选择一个用户'); |
| | | return; |
| | | } |
| | | systemPay("修改余额", checkData[0].userId, 1); |
| | | } |
| | | }); |
| | | // table.on('toolbar(userPerkTable)', function(obj){ |
| | | // var data = obj.data, |
| | | // layEvent = obj.event; |
| | | // |
| | | // // if (layEvent === 'registerMember') { |
| | | // // febs.get(ctx + 'admin/chat/registerMember/', null, function () { |
| | | // // febs.alert.success('操作成功'); |
| | | // // $query.click(); |
| | | // // }); |
| | | // // } |
| | | // |
| | | // if (layEvent === 'registerMember') { |
| | | // var checkData = table.checkStatus('userPerkTable').data; |
| | | // if (checkData.length <= 0) { |
| | | // febs.alert.warn('请选择需要的用户'); |
| | | // return; |
| | | // } |
| | | // if (checkData.length > 1) { |
| | | // febs.alert.warn('请选择一个用户'); |
| | | // return; |
| | | // } |
| | | // registerMember("添加会员", checkData[0].inviteId, 1); |
| | | // } |
| | | // |
| | | // if (layEvent === 'balance') { |
| | | // var checkData = table.checkStatus('userPerkTable').data; |
| | | // if (checkData.length <= 0) { |
| | | // febs.alert.warn('请选择需要的用户'); |
| | | // return; |
| | | // } |
| | | // if (checkData.length > 1) { |
| | | // febs.alert.warn('请选择一个用户'); |
| | | // return; |
| | | // } |
| | | // systemPay("修改余额", checkData[0].userId, 1); |
| | | // } |
| | | // }); |
| | | |
| | | function registerMember(text, inviteId, type) { |
| | | febs.modal.open(text, 'modules/chat/mallRegisterMember/'+ inviteId, { |