From 2f4dd0b0ba57cc66f2e2d0df7bbbf6cbfe9ba8c7 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Wed, 23 Aug 2023 14:06:23 +0800
Subject: [PATCH] 后台修改

---
 src/main/resources/templates/febs/views/dapp/member.html |  292 ++++++++++++++++++++--------------------------------------
 1 files changed, 102 insertions(+), 190 deletions(-)

diff --git a/src/main/resources/templates/febs/views/dapp/member.html b/src/main/resources/templates/febs/views/dapp/member.html
index a60406c..d556964 100644
--- a/src/main/resources/templates/febs/views/dapp/member.html
+++ b/src/main/resources/templates/febs/views/dapp/member.html
@@ -15,30 +15,14 @@
 <!--                                    <div class="layui-inline">-->
 <!--                                        <label class="layui-form-label layui-form-label-sm">状态</label>-->
 <!--                                        <div class="layui-input-inline">-->
-<!--                                            <select name="accountStatus">-->
+<!--                                            <select name="accountType">-->
 <!--                                                <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>-->
+<!--                                                <option value="MEMBER">MEMBER</option>-->
+<!--                                                <option value="NODE_1">NODE_1</option>-->
+<!--                                                <option value="NODE_2">NODE_2</option>-->
+<!--                                                <option value="NODE_3">NODE_3</option>-->
+<!--                                                <option value="NODE_4">NODE_4</option>-->
+<!--                                                <option value="NODE_5">NODE_5</option>-->
 <!--                                            </select>-->
 <!--                                        </div>-->
 <!--                                    </div>-->
@@ -74,90 +58,25 @@
     }}
     <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>-->
-<!--    {{# } else { }}-->
-<!--    <span>-</span>-->
-<!--    {{# } }}-->
-<!--</script>-->
-<script type="text/html" id="approve-list">
-    <a href="https://bscscan.com/address/{{d.address}}" target="_blank">{{d.address}}</a>
-</script>
-<script type="text/html" id="switchInsideWith">
-    {{# if(d.nodeType === 1) { }}
-    <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchInsideWith">
+<script type="text/html" id="switchActiveStatus">
+    {{# if(d.activeStatus === 1) { }}
+    <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchActiveStatus">
     {{# } else { }}
-    <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchInsideWith">
+    <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchActiveStatus">
     {{# } }}
 </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 type="text/html" id="tableMemberBar">
+    <div class="layui-btn-container">
+        <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="agentLevel:view" lay-event="coinAmount">拨付余额</button>
+        <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="agentLevel:view" lay-event="scoreAmount">拨付赠送积分</button>
+        <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="agentLevel:view" lay-event="balance">拨付资产包</button>
+        <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="agentLevel:view" lay-event="balanceSystem">资产强制卖出</button>
+    </div>
 </script>
-<!--<script type="text/html" id="tableMemberBar">-->
-<!--    <div class="layui-btn-container">-->
-<!--        <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="agentLevel:view" lay-event="agentLevel">设置代理等级</button>-->
-<!--    </div>-->
-<!--</script>-->
 
 <script type="text/html" id="mallmember-option">
-    <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="agentLevel:view" lay-event="agentLevel">设置代理等级</button>
+    <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="agentLevel:view" lay-event="agentLevel">设置会员级别</button>
+    <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="agentLevel:view" lay-event="memberFlow">个人流水</button>
 </script>
 <script data-th-inline="none" type="text/javascript">
     layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () {
@@ -182,15 +101,6 @@
             var data = obj.data,
                 layEvent = obj.event;
             if (layEvent === 'agentLevel') {
-                // var checkData = table.checkStatus('memberTable').data;
-                // if (checkData.length <= 0) {
-                //     febs.alert.warn('请选择需要的用户');
-                //     return;
-                // }
-                // if (checkData.length > 1) {
-                //     febs.alert.warn('请选择一个用户');
-                //     return;
-                // }
                 febs.modal.open('设置代理级别', 'dappView/agentLevel/' + data.id, {
                     btn: ['确认', '取消'],
                     yes: function (index, layero) {
@@ -201,69 +111,10 @@
                     }
                 });
             }
-            if (layEvent === 'teamInfo') {
-                febs.modal.open( '团队详情', 'dappView/teamInfo/' + data.id, {
+
+            if (layEvent === 'memberFlow') {
+                febs.modal.open( '订单流水', 'dappView/memberFlow/' + data.id, {
                     maxmin: true,
-                });
-            }
-
-            if (layEvent === 'memberNodeInfo') {
-                febs.modal.open( '购买记录', 'dappView/memberNodeInfo/' + data.id, {
-                    maxmin: true,
-                });
-            }
-            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('刷新成功');
-                        }
-                    }
                 });
             }
         });
@@ -289,7 +140,7 @@
             tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject});
         });
 
-        form.on('switch(switchInsideWith)', function (data) {
+        form.on('switch(switchActiveStatus)', function (data) {
             if (data.elem.checked) {
                 insideWithYes(data.value);
             } else {
@@ -311,41 +162,102 @@
 
         function initTable() {
             tableIns = febs.table.init({
+
                 elem: $view.find('table'),
                 id: 'memberTable',
                 url: ctx + 'member/list',
-                // toolbar:"#tableMemberBar",
-                // defaultToolbar:[],
-                totalRow: true,
+                toolbar:"#tableMemberBar",
+                totalRow: true ,// 开启合计行
                 cols: [[
-                    // {type: 'checkbox'},
+                    {type: 'checkbox'},
                     // {title: '代理级别',
                     //     templet: function (d) {
                     //         return '<span class="layui-btn layui-btn-normal layui-btn-xs">'+d.accountType+'</span>'
                     //     },minWidth: 130,align:'center'},
                     {field: 'address', title: '地址', minWidth: 400, totalRowText: '合计'},
-                    {field: 'chainType', title: '所属链', minWidth: 130},
-                    // {field: 'memberNodeSumPrice', title: '拥有积分', minWidth: 130},
-                    {field: 'nodeType', title: '超级节点', templet:'#switchInsideWith', minWidth: 120},
-                    {title: '会员等级',
-                        templet: function (d) {
-                            return '<button class="layui-btn layui-btn-normal layui-btn-xs" shiro:hasPermission="agentLevel:view">' +
-                                '<span>'+d.accountType+'</span>' +
-                                '</button>'
-                        },minWidth: 130,align:'center'},
-                    // {field: 'directProfit', title: '直推收益', minWidth: 100, totalRow: true},
-                    {field: 'inviteId', title: '邀请码', minWidth: 100},
                     {field: 'refererId', title: '上级邀请码', minWidth: 100},
+                    {field: 'inviteId', title: '邀请码', minWidth: 100},
+                    {field: 'coinAmount', title: '余额', minWidth: 130},
+                    {field: 'scoreAmount', title: '赠送积分', minWidth: 130},
+                    {field: 'balance', title: '资产包', minWidth: 130},
+                    {field: 'myTeamAchieve', title: '团队业绩', minWidth: 130},
+                    {field: 'myShareAchieve', title: '共享业绩', minWidth: 130},
+                    {field: 'activeStatus', title: '是否激活', templet:'#switchActiveStatus', minWidth: 120},
+                    {field: 'accountType', title: '会员级别', minWidth: 130},
+                    // {field: 'directProfit', title: '直推收益', minWidth: 100, totalRow: true},
+                    {field: 'chainType', title: '所属链', minWidth: 130},
                     {field: 'createTime', title: '创建时间', minWidth: 180},
-                    {title: '操作', minWidth: 200 ,toolbar: '#mallmember-option',align:'left', fixed:'right'}
+                    {title: '操作', minWidth: 300 ,toolbar: '#mallmember-option',align:'left', fixed:'right'}
                 ]]
+            });
+        }
+        table.on('toolbar(memberTable)', function(obj){
+            var data = obj.data,
+                layEvent = obj.event;
+
+            if (layEvent === 'coinAmount') {
+                var checkData = table.checkStatus('memberTable').data;
+                if (checkData.length <= 0) {
+                    febs.alert.warn('请选择需要的用户');
+                    return;
+                }
+                if (checkData.length > 1) {
+                    febs.alert.warn('请选择一个用户');
+                    return;
+                }
+                systemPay("余额", checkData[0].id, 1);
+            }
+
+            if (layEvent === 'scoreAmount') {
+                var checkData = table.checkStatus('memberTable').data;
+                if (checkData.length <= 0) {
+                    febs.alert.warn('请选择需要的用户');
+                    return;
+                }
+                if (checkData.length > 1) {
+                    febs.alert.warn('请选择一个用户');
+                    return;
+                }
+                systemPay("赠送积分", checkData[0].id, 2);
+            }
+
+            if (layEvent === 'balance') {
+                var checkData = table.checkStatus('memberTable').data;
+                if (checkData.length <= 0) {
+                    febs.alert.warn('请选择需要的用户');
+                    return;
+                }
+                if (checkData.length > 1) {
+                    febs.alert.warn('请选择一个用户');
+                    return;
+                }
+                systemPay("资产包", checkData[0].id, 3);
+            }
+
+            if (layEvent === 'balanceSystem') {
+                febs.get(ctx + 'member/balanceSystem/', null, function () {
+                    febs.alert.success('操作成功');
+                    $query.click();
+                });
+            }
+        });
+
+        function systemPay(text, id, type) {
+            febs.modal.open(text, 'dappView/mallSystemPay/' + type +'/'+ id, {
+                btn: ['确认', '取消'],
+                yes: function (index, layero) {
+                    $('#systemPay-update').find('#submit').trigger('click');
+                },
+                btn2: function () {
+                    layer.closeAll();
+                }
             });
         }
 
         function getQueryParams() {
             return {
                 inviteId: $searchForm.find('input[name="inviteId"]').val().trim(),
-                accountStatus: $searchForm.find("select[name='accountStatus']").val(),
+                accountType: $searchForm.find("select[name='accountType']").val(),
                 withdrawAble: $searchForm.find("select[name='withdrawAble']").val(),
                 invalidate_ie_cache: new Date()
             };

--
Gitblit v1.9.1