From 77afee148e77d429e74408ede5905b16cf803256 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 11 Aug 2023 11:09:21 +0800
Subject: [PATCH] 数据修改

---
 src/main/resources/templates/febs/views/dapp/member.html |  285 ++++++++++++++++++++++++--------------------------------
 1 files changed, 124 insertions(+), 161 deletions(-)

diff --git a/src/main/resources/templates/febs/views/dapp/member.html b/src/main/resources/templates/febs/views/dapp/member.html
index 8d059a4..6490e50 100644
--- a/src/main/resources/templates/febs/views/dapp/member.html
+++ b/src/main/resources/templates/febs/views/dapp/member.html
@@ -26,26 +26,6 @@
                                             </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>
                             </div>
                             <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
@@ -111,54 +91,24 @@
     <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="mallSystemPay:update" lay-event="coinAmount">拨付余额</button>
+        <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="mallSystemPay:update" lay-event="scoreAmount">拨付赠送积分</button>
+        <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="agentLevelSet:update" lay-event="balance">拨付资产包</button>
+        <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="agentLevelSet:update" lay-event="agentLevel">设置代理等级</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>
@@ -182,95 +132,21 @@
 
         initTable();
 
-        table.on('tool(memberTable)', function (obj) {
-            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) {
-                        $('#agent-level-set').find('#submit').trigger('click');
-                    },
-                    btn2: function () {
-                        layer.closeAll();
-                    }
-                });
-            }
-            if (layEvent === 'teamInfo') {
-                febs.modal.open( '团队详情', 'dappView/teamInfo/' + 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('刷新成功');
-                        }
-                    }
-                });
-            }
-        });
+        // table.on('tool(memberTable)', function (obj) {
+        //     var data = obj.data,
+        //         layEvent = obj.event;
+        //     if (layEvent === 'agentLevel') {
+        //         febs.modal.open('设置代理级别', 'dappView/agentLevel/' + data.id, {
+        //             btn: ['确认', '取消'],
+        //             yes: function (index, layero) {
+        //                 $('#agent-level-set').find('#submit').trigger('click');
+        //             },
+        //             btn2: function () {
+        //                 layer.closeAll();
+        //             }
+        //         });
+        //     }
+        // });
 
         table.on('sort(memberTable)', function (obj) {
             sortObject = obj;
@@ -293,7 +169,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 {
@@ -319,24 +195,22 @@
                 id: 'memberTable',
                 url: ctx + 'member/list',
                 // toolbar:"#tableMemberBar",
-                // defaultToolbar:[],
+                toolbar:"#tableMemberBar",
+                defaultToolbar:[],
                 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: 'coinAmount', title: '余额', minWidth: 130},
+                    {field: 'scoreAmount', title: '赠送积分', minWidth: 130},
+                    {field: 'balance', title: '资产包', minWidth: 130},
+                    {field: 'activeStatus', title: '是否激活', templet:'#switchActiveStatus', minWidth: 120},
+                    {field: 'accountType', title: '会员级别', minWidth: 130},
                     // {field: 'directProfit', title: '直推收益', minWidth: 100, totalRow: true},
                     {field: 'inviteId', title: '邀请码', minWidth: 100},
                     {field: 'refererId', title: '上级邀请码', minWidth: 100},
@@ -345,6 +219,95 @@
                 ]]
             });
         }
+        table.on('toolbar(memberTable)', function(obj){
+            var data = obj.data,
+                layEvent = obj.event;
+
+            if (layEvent === 'balance') {
+                var checkData = table.checkStatus('userTable').data;
+                if (checkData.length <= 0) {
+                    febs.alert.warn('请选择需要的用户');
+                    return;
+                }
+                if (checkData.length > 1) {
+                    febs.alert.warn('请选择一个用户');
+                    return;
+                }
+                systemPay("修改余额", checkData[0].id, 1);
+            }
+
+            if (layEvent === 'voucherUpdate') {
+                var checkData = table.checkStatus('userTable').data;
+                if (checkData.length <= 0) {
+                    febs.alert.warn('请选择需要的用户');
+                    return;
+                }
+                if (checkData.length > 1) {
+                    febs.alert.warn('请选择一个用户');
+                    return;
+                }
+                voucherUpdate("拨付绿色凭证", checkData[0].id, 1);
+            }
+
+            if (layEvent === 'score') {
+                var checkData = table.checkStatus('userTable').data;
+                if (checkData.length <= 0) {
+                    febs.alert.warn('请选择需要的用户');
+                    return;
+                }
+                if (checkData.length > 1) {
+                    febs.alert.warn('请选择一个用户');
+                    return;
+                }
+                systemPay("修改赠送积分", checkData[0].id, 2);
+            }
+
+            if (layEvent === 'prizeScore') {
+                var checkData = table.checkStatus('userTable').data;
+                if (checkData.length <= 0) {
+                    febs.alert.warn('请选择需要的用户');
+                    return;
+                }
+                if (checkData.length > 1) {
+                    febs.alert.warn('请选择一个用户');
+                    return;
+                }
+                systemPay("修改竞猜积分", checkData[0].id, 3);
+            }
+
+            if (layEvent === 'agentLevel') {
+                var checkData = table.checkStatus('userTable').data;
+                if (checkData.length <= 0) {
+                    febs.alert.warn('请选择需要的用户');
+                    return;
+                }
+                if (checkData.length > 1) {
+                    febs.alert.warn('请选择一个用户');
+                    return;
+                }
+                febs.modal.open('设置代理级别', 'modules/mallMember/agentLevelSet/' + checkData[0].id, {
+                    btn: ['确认', '取消'],
+                    yes: function (index, layero) {
+                        $('#agent-level-set').find('#submit').trigger('click');
+                    },
+                    btn2: function () {
+                        layer.closeAll();
+                    }
+                });
+            }
+        });
+
+        function systemPay(text, id, type) {
+            febs.modal.open('text', 'modules/mallMember/mallSystemPay/' + type +'/'+ id, {
+                btn: ['提交', '取消'],
+                yes: function (index, layero) {
+                    $('#systemPay-update').find('#submit').trigger('click');
+                },
+                btn2: function () {
+                    layer.closeAll();
+                }
+            });
+        }
 
         function getQueryParams() {
             return {

--
Gitblit v1.9.1