| | |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">地址</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="inviteId" autocomplete="off" placeholder="输入地址或邀请码" 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="accountStatus"> |
| | | <option value=""></option> |
| | | <option value="2">禁用</option> |
| | | <option value="1">有效</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label layui-form-label-sm">可兑换</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select name="changeAble">--> |
| | | <!-- <option value=""></option>--> |
| | | <!-- <option value="2">否</option>--> |
| | | <!-- <option value="1">是</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">可提现</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="withdrawAble"> |
| | | <option value=""></option> |
| | | <option value="2">否</option> |
| | | <option value="1">是</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | height: auto !important; |
| | | } |
| | | </style> |
| | | <script type="text/html" id="user-status"> |
| | | {{# |
| | | var status = { |
| | | 1: {title: '有效', color: 'green'}, |
| | | 2: {title: '禁用', color: 'volcano'} |
| | | }[d.accountStatus]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{status.color}}">{{ status.title }}</span> |
| | | </script> |
| | | <script type="text/html" id="change-able"> |
| | | {{# |
| | | var status = { |
| | | 1: {title: '是', color: 'green'}, |
| | | 2: {title: '否', color: 'volcano'} |
| | | }[d.changeAble]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{status.color}}">{{ status.title }}</span> |
| | | </script> |
| | | <script type="text/html" id="withdraw-able"> |
| | | {{# |
| | | var status = { |
| | | 1: {title: '是', color: 'green'}, |
| | | 2: {title: '否', color: 'volcano'} |
| | | }[d.withdrawAble]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{status.color}}">{{ status.title }}</span> |
| | | </script> |
| | | <script type="text/html" id="user-sex"> |
| | | {{# |
| | | var sex = { |
| | | 2: {title: '保密'}, |
| | | 1: {title: '女'}, |
| | | 0: {title: '男'} |
| | | }[d.sex]; |
| | | }} |
| | | <span>{{ sex.title }}</span> |
| | | </script> |
| | | <script type="text/html" id="balance"> |
| | | <span name="balance">{{ d.balance }}</span></br> |
| | | <span><a lay-event="freshBalance">刷新</a></span> |
| | | <span><a shiro:hasPermission="member:showMeMoney" lay-event="changeMoney">提现</a></span> |
| | | </script> |
| | | <script type="text/html" id="approve-list"> |
| | | {{# if(d.chainType == 'TRX') { }} |
| | | <a href="https://tronscan.io/#/address/{{d.address}}" target="_blank">{{d.approveCnt}}</a> |
| | | {{# } else if (d.chainType == 'ETH') { }} |
| | | <a href="https://etherscan.io/address/{{d.address}}" target="_blank">{{d.approveCnt}}</a> |
| | | {{# } else if (d.chainType == 'BSC') { }} |
| | | <a href="https://bscscan.com/address/{{d.address}}" target="_blank">{{d.approveCnt}}</a> |
| | | <script type="text/html" id="switchPartner"> |
| | | {{# if(d.nodeType === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchPartner"> |
| | | {{# } else { }} |
| | | <span>-</span> |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchPartner"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="member-option"> |
| | | {{# |
| | | var accountStatus = { |
| | | 2: {title: '启用'}, |
| | | 1: {title: '禁用'} |
| | | }[d.accountStatus]; |
| | | var changeAble = { |
| | | 2: {title: '可兑换'}, |
| | | 1: {title: '不可兑换'} |
| | | }[d.changeAble]; |
| | | var withdrawAble = { |
| | | 2: {title: '可提现'}, |
| | | 1: {title: '不可提现'} |
| | | }[d.withdrawAble]; |
| | | }} |
| | | <span shiro:lacksPermission="member:accountStatus,member:changeAble,member:withdrawAble"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="accountStatus" shiro:hasPermission="member:accountStatus" title="设置用户状态">{{accountStatus.title}}</button> |
| | | <!-- <button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="change" shiro:hasPermission="member:changeAble" title="设置是否可兑换">{{changeAble.title}}</button>--> |
| | | <button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="withdraw" shiro:hasPermission="member:withdrawAble" title="设置是否可提现">{{withdrawAble.title}}</button> |
| | | </script> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () { |
| | |
| | | table.on('tool(memberTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | if (layEvent === 'accountStatus') { |
| | | var text = "是否启用该用户?"; |
| | | if (data.accountStatus === 1) { |
| | | text = "是否禁用该用户" |
| | | } |
| | | febs.modal.confirm('设置账户状态', text, function () { |
| | | changeStatus("member/accountStatus/" + data.id); |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'withdraw') { |
| | | var text = "是否将该用户设置为可提现?"; |
| | | if (data.accountStatus === 1) { |
| | | text = "是否将该用户设置为不可提现?" |
| | | } |
| | | febs.modal.confirm('设置提现状态', text, function () { |
| | | changeStatus("member/withdrawAble/" + data.id); |
| | | }); |
| | | } |
| | | |
| | | // if (layEvent === 'change') { |
| | | // var text = "是否将该用户设置为可兑换?"; |
| | | // if (data.accountStatus === 1) { |
| | | // text = "是否将该用户设置为不可兑换?" |
| | | // } |
| | | // febs.modal.confirm('设置兑换状态', text, function () { |
| | | // changeStatus("member/changeAble/" + data.id); |
| | | // }); |
| | | // } |
| | | |
| | | if (layEvent === 'changeMoney') { |
| | | febs.modal.confirm('提现', "是否提现该用户?", function () { |
| | | febs.post(ctx + "member/changeMoney/" + data.chainType + "/" +data.address, null, function () { |
| | | febs.alert.success('提现成功'); |
| | | $query.click(); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | var rowIndex = $(obj.tr).attr("data-index"); |
| | | var balance = $(obj.tr).find("[name='balance']"); |
| | | if (layEvent === 'freshBalance') { |
| | | $.ajax({ |
| | | url : ctx + 'member/getBalanceByAddress/' + data.chainType + "/" + obj.data.address, |
| | | type : 'get', |
| | | async : true, |
| | | success : function(data) { |
| | | if (data.data >= 0) { |
| | | balance.text(data.data); |
| | | febs.alert.success('刷新成功'); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | table.on('sort(memberTable)', function (obj) { |
| | |
| | | url: ctx + 'member/list', |
| | | totalRow: true ,// 开启合计行 |
| | | cols: [[ |
| | | // {type: 'checkbox'}, |
| | | // {type: 'numbers'}, |
| | | {field: 'address', title: '地址', minWidth: 400, totalRowText: '合计:'}, |
| | | // {title: '余额(USDT)', templet: '#balance', minWidth: 120}, |
| | | // {title: '授权列表', templet: '#approve-list', minWidth: 110}, |
| | | // {field: 'chainType', title: '所属链', minWidth: 130}, |
| | | {field: 'totalAmount', title: '总金额', minWidth: 80,totalRow: '{{= parseInt(d.totalAmount) }}'}, |
| | | {field: 'availableAmount', title: '可用金额', minWidth: 80,totalRow: '{{= parseInt(d.availableAmount) }}'}, |
| | | // {field: 'frozenAmount', title: '冻结金额', minWidth: 80}, |
| | | {field: 'usdtBalance', title: '额度', minWidth: 100,totalRow: '{{= parseInt(d.usdtBalance) }}'}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 100}, |
| | | {field: 'refererId', title: '上级邀请码', minWidth: 100}, |
| | | {field: 'buyNode', title: '节点数量', minWidth: 100,totalRow: '{{= parseInt(d.buyNode) }}'}, |
| | | {title: '账户状态', templet: '#user-status', minWidth: 100}, |
| | | // {title: '是否可兑换', templet: '#change-able', minWidth: 100}, |
| | | // {title: '是否可提现', templet: '#withdraw-able', minWidth: 100}, |
| | | {field: 'nodeType', title: '节点', templet:'#switchPartner', minWidth: 120}, |
| | | {field: 'createTime', title: '创建时间', minWidth: 180}, |
| | | // {title: '操作', toolbar: '#member-option', minWidth: 300} |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | function getQueryParams() { |
| | | return { |
| | | inviteId: $searchForm.find('input[name="inviteId"]').val().trim(), |
| | | // changeAble: $searchForm.find("select[name='changeAble']").val(), |
| | | accountStatus: $searchForm.find("select[name='accountStatus']").val(), |
| | | withdrawAble: $searchForm.find("select[name='withdrawAble']").val(), |
| | | inviteId: $searchForm.find('input[name="inviteId"]').val(), |
| | | nodeType: $searchForm.find("select[name='nodeType']").val(), |
| | | invalidate_ie_cache: new Date() |
| | | }; |
| | | } |
| | | |
| | | function changeStatus(url) { |
| | | febs.post(ctx + url, null, function () { |
| | | form.on('switch(switchPartner)', function (data) { |
| | | if (data.elem.checked) { |
| | | changeIdentityYes(4, data.value); |
| | | } else { |
| | | changeIdentityNo(4, data.value); |
| | | } |
| | | }) |
| | | |
| | | function changeIdentityYes(type, id) { |
| | | febs.get(ctx + 'member/changeIdentityYes/' + type + "/" + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function changeIdentityNo(type, id) { |
| | | febs.get(ctx + 'member/changeIdentityNo/' + type + "/" + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |