1 files added
10 files modified
New file |
| | |
| | | package cc.mrbird.febs.dapp.controller; |
| | | |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.dapp.entity.DappWalletCoinEntity; |
| | | import cc.mrbird.febs.dapp.entity.DappWalletMineEntity; |
| | | import cc.mrbird.febs.dapp.service.DappWalletService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2022-03-22 |
| | | **/ |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping(value = "wallet") |
| | | public class MemberWalletController extends BaseController { |
| | | |
| | | private final DappWalletService dappWalletService; |
| | | |
| | | @RequestMapping(value = "/walletCoin") |
| | | public FebsResponse walletCoin(DappWalletCoinEntity walletCoin, QueryRequest request) { |
| | | return new FebsResponse().success().data(getDataTable(dappWalletService.walletCoinInPage(walletCoin, request))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/walletMine") |
| | | public FebsResponse walletMine(DappWalletMineEntity walletMine, QueryRequest request) { |
| | | return new FebsResponse().success().data(getDataTable(dappWalletService.walletMineInPage(walletMine, request))); |
| | | } |
| | | } |
| | |
| | | package cc.mrbird.febs.dapp.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | |
| | | private BigDecimal frozenAmount; |
| | | |
| | | private BigDecimal availableAmount; |
| | | |
| | | @TableField(exist = false) |
| | | private String address; |
| | | } |
| | |
| | | package cc.mrbird.febs.dapp.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | |
| | | private BigDecimal frozenAmount; |
| | | |
| | | private BigDecimal availableAmount; |
| | | |
| | | @TableField(exist = false) |
| | | private String address; |
| | | } |
| | |
| | | |
| | | import cc.mrbird.febs.dapp.entity.DappWalletCoinEntity; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface DappWalletCoinDao extends BaseMapper<DappWalletCoinEntity> { |
| | | |
| | | DappWalletCoinEntity selectByMemberId(@Param("memberId") Long memberId); |
| | | |
| | | IPage<DappWalletCoinEntity> selectInPage(@Param("record") DappWalletCoinEntity walletCoin, Page<DappWalletCoinEntity> page); |
| | | } |
| | |
| | | |
| | | import cc.mrbird.febs.dapp.entity.DappWalletMineEntity; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface DappWalletMineDao extends BaseMapper<DappWalletMineEntity> { |
| | | |
| | | DappWalletMineEntity selectByMemberId(@Param("memberId") Long memberId); |
| | | |
| | | IPage<DappWalletMineEntity> selectInPage(@Param("record") DappWalletMineEntity walletMine, Page<DappWalletMineEntity> page); |
| | | } |
| | |
| | | import cc.mrbird.febs.dapp.dto.WalletOperateDto; |
| | | import cc.mrbird.febs.dapp.entity.DappFundFlowEntity; |
| | | import cc.mrbird.febs.dapp.entity.DappWalletCoinEntity; |
| | | import cc.mrbird.febs.dapp.entity.DappWalletMineEntity; |
| | | import cc.mrbird.febs.dapp.vo.WalletInfoVo; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | |
| | | IPage<DappFundFlowEntity> fundFlowInPage(DappFundFlowEntity dappFundFlowEntity, QueryRequest request); |
| | | |
| | | void withdrawAgreeOrNot(Long id, int type); |
| | | |
| | | IPage<DappWalletCoinEntity> walletCoinInPage(DappWalletCoinEntity walletCoin, QueryRequest request); |
| | | IPage<DappWalletMineEntity> walletMineInPage(DappWalletMineEntity walletMine, QueryRequest request); |
| | | } |
| | |
| | | |
| | | dappFundFlowDao.updateById(fundFlow); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<DappWalletCoinEntity> walletCoinInPage(DappWalletCoinEntity walletCoin, QueryRequest request) { |
| | | Page<DappWalletCoinEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return dappWalletCoinDao.selectInPage(walletCoin, page); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<DappWalletMineEntity> walletMineInPage(DappWalletMineEntity walletMine, QueryRequest request) { |
| | | Page<DappWalletMineEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return dappWalletMineDao.selectInPage(walletMine, page); |
| | | } |
| | | } |
| | |
| | | <select id="selectByMemberId" resultType="cc.mrbird.febs.dapp.entity.DappWalletCoinEntity"> |
| | | select * from dapp_wallet_coin where member_id=#{memberId} |
| | | </select> |
| | | |
| | | <select id="selectInPage" resultType="cc.mrbird.febs.dapp.entity.DappWalletCoinEntity"> |
| | | select a.*, b.address address from dapp_wallet_coin a |
| | | inner join dapp_member b on a.member_id=b.id |
| | | <where> |
| | | <if test="record.address != '' and record.address != null"> |
| | | and b.address = #{record.address} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="selectByMemberId" resultType="cc.mrbird.febs.dapp.entity.DappWalletMineEntity"> |
| | | select * from dapp_wallet_mine where member_id=#{memberId} |
| | | </select> |
| | | |
| | | <select id="selectInPage" resultType="cc.mrbird.febs.dapp.entity.DappWalletMineEntity"> |
| | | select * from dapp_wallet_mine a |
| | | inner join dapp_member b on a.member_id=b.id |
| | | <where> |
| | | <if test="record.address != '' and record.address != null"> |
| | | and b.address = #{record.address} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-member" lay-title="USDT钱包"> |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-walletCoin" lay-title="USDT钱包"> |
| | | <div class="layui-row febs-container"> |
| | | <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="coin-table-form"> |
| | | <div class="layui-row"> |
| | | <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" 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> |
| | | <input type="text" name="address" autocomplete="off" placeholder="输入地址" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table lay-filter="memberTable" lay-data="{id: 'memberTable'}"></table> |
| | | <table lay-filter="walletCoinTable" lay-data="{id: 'walletCoinTable'}"></table> |
| | | </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> |
| | | <p><a lay-event="freshBalance">刷新</a></p> |
| | | </script> |
| | | <script type="text/html" id="approve-list"> |
| | | <a href="https://tronscan.io/#/address/{{d.address}}" target="_blank">1</a> |
| | | </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="user:view,user:update,user:delete"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <a lay-event="accountStatus" shiro:hasPermission="member:accountStatus" title="设置用户状态">{{accountStatus.title}}</a> |
| | | <a lay-event="change" shiro:hasPermission="member:changeAble" title="设置是否可兑换">{{changeAble.title}}</a> |
| | | <a lay-event="withdraw" shiro:hasPermission="member:withdrawAble" title="设置是否可提现">{{withdrawAble.title}}</a> |
| | | </script> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () { |
| | | var $ = layui.jquery, |
| | |
| | | form = layui.form, |
| | | table = layui.table, |
| | | dropdown = layui.dropdown, |
| | | $view = $('#febs-member'), |
| | | $view = $('#febs-walletCoin'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | |
| | | |
| | | initTable(); |
| | | |
| | | table.on('tool(memberTable)', function (obj) { |
| | | table.on('tool(walletCoinTable)', 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); |
| | | }); |
| | | } |
| | | |
| | | var rowIndex = $(obj.tr).attr("data-index"); |
| | | var balance = $(obj.tr).find("[name='balance']"); |
| | | if (layEvent === 'freshBalance') { |
| | | $.ajax({ |
| | | url : ctx + 'member/getBalanceByAddress/' + obj.data.address, |
| | | type : 'get', |
| | | async : true, |
| | | success : function(data) { |
| | | if (data.data) { |
| | | balance.text(123); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | table.on('sort(memberTable)', function (obj) { |
| | | table.on('sort(walletCoinTable)', function (obj) { |
| | | sortObject = obj; |
| | | tableIns.reload({ |
| | | initSort: obj, |
| | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'memberTable', |
| | | url: ctx + 'member/list', |
| | | id: 'walletCoinTable', |
| | | url: ctx + 'wallet/walletCoin', |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | {type: 'numbers'}, |
| | | {field: 'address', title: '地址', minWidth: 130}, |
| | | {title: '余额', templet: '#balance'}, |
| | | {title: '授权列表', templet: '#approve-list', minWidth: 110}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 130}, |
| | | {field: 'refererId', title: '上级邀请码', minWidth: 130}, |
| | | {title: '账户状态', templet: '#user-status'}, |
| | | {title: '是否可兑换', templet: '#change-able', minWidth: 130}, |
| | | {title: '是否可提现', templet: '#withdraw-able', minWidth: 130}, |
| | | {field: 'createTime', title: '创建时间', minWidth: 180}, |
| | | {title: '操作', toolbar: '#member-option', minWidth: 200} |
| | | {field: 'availableAmount', title: '可用金额', minWidth: 130}, |
| | | {field: 'frozenAmount', title: '冻结金额', minWidth: 130}, |
| | | {field: 'totalAmount', title: '创建时间', minWidth: 180} |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | 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("input[name='withdrawAble']").val(), |
| | | address: $searchForm.find('input[name="address"]').val().trim(), |
| | | invalidate_ie_cache: new Date() |
| | | }; |
| | | } |
| | | |
| | | function changeStatus(url) { |
| | | febs.post(ctx + url, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | }) |
| | | </script> |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-member" lay-title="ETH钱包"> |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-walletMine" lay-title="ETH钱包"> |
| | | <div class="layui-row febs-container"> |
| | | <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="mine-table-form"> |
| | | <div class="layui-row"> |
| | | <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" 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> |
| | | <input type="text" name="address" autocomplete="off" placeholder="输入地址" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table lay-filter="memberTable" lay-data="{id: 'memberTable'}"></table> |
| | | <table lay-filter="walletMineTable" lay-data="{id: 'walletMineTable'}"></table> |
| | | </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> |
| | | <p><a lay-event="freshBalance">刷新</a></p> |
| | | </script> |
| | | <script type="text/html" id="approve-list"> |
| | | <a href="https://tronscan.io/#/address/{{d.address}}" target="_blank">1</a> |
| | | </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="user:view,user:update,user:delete"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <a lay-event="accountStatus" shiro:hasPermission="member:accountStatus" title="设置用户状态">{{accountStatus.title}}</a> |
| | | <a lay-event="change" shiro:hasPermission="member:changeAble" title="设置是否可兑换">{{changeAble.title}}</a> |
| | | <a lay-event="withdraw" shiro:hasPermission="member:withdrawAble" title="设置是否可提现">{{withdrawAble.title}}</a> |
| | | </script> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () { |
| | | var $ = layui.jquery, |
| | |
| | | form = layui.form, |
| | | table = layui.table, |
| | | dropdown = layui.dropdown, |
| | | $view = $('#febs-member'), |
| | | $view = $('#febs-walletMine'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | |
| | | |
| | | initTable(); |
| | | |
| | | table.on('tool(memberTable)', function (obj) { |
| | | table.on('tool(walletMineTable)', 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); |
| | | }); |
| | | } |
| | | |
| | | var rowIndex = $(obj.tr).attr("data-index"); |
| | | var balance = $(obj.tr).find("[name='balance']"); |
| | | if (layEvent === 'freshBalance') { |
| | | $.ajax({ |
| | | url : ctx + 'member/getBalanceByAddress/' + obj.data.address, |
| | | type : 'get', |
| | | async : true, |
| | | success : function(data) { |
| | | if (data.data) { |
| | | balance.text(123); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | table.on('sort(memberTable)', function (obj) { |
| | | table.on('sort(walletMineTable)', function (obj) { |
| | | sortObject = obj; |
| | | tableIns.reload({ |
| | | initSort: obj, |
| | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'memberTable', |
| | | url: ctx + 'member/list', |
| | | id: 'walletMineTable', |
| | | url: ctx + 'wallet/walletMine', |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | {type: 'numbers'}, |
| | | {field: 'address', title: '地址', minWidth: 130}, |
| | | {title: '余额', templet: '#balance'}, |
| | | {title: '授权列表', templet: '#approve-list', minWidth: 110}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 130}, |
| | | {field: 'refererId', title: '上级邀请码', minWidth: 130}, |
| | | {title: '账户状态', templet: '#user-status'}, |
| | | {title: '是否可兑换', templet: '#change-able', minWidth: 130}, |
| | | {title: '是否可提现', templet: '#withdraw-able', minWidth: 130}, |
| | | {field: 'createTime', title: '创建时间', minWidth: 180}, |
| | | {title: '操作', toolbar: '#member-option', minWidth: 200} |
| | | {field: 'availableAmount', title: '可用金额', minWidth: 130}, |
| | | {field: 'frozenAmount', title: '冻结金额', minWidth: 130}, |
| | | {field: 'totalAmount', title: '创建时间', minWidth: 180} |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | 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("input[name='withdrawAble']").val(), |
| | | address: $searchForm.find('input[name="address"]').val().trim(), |
| | | invalidate_ie_cache: new Date() |
| | | }; |
| | | } |
| | | |
| | | function changeStatus(url) { |
| | | febs.post(ctx + url, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | }) |
| | | </script> |