From b65c0ec3695a9ddd6972e2671ae3059f8fd5de6d Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 30 May 2023 15:58:55 +0800
Subject: [PATCH] twoCoin项目修改

---
 src/main/resources/templates/febs/views/dapp/member.html |   78 ++++++++++++++++++++++++++++++++++----
 1 files changed, 69 insertions(+), 9 deletions(-)

diff --git a/src/main/resources/templates/febs/views/dapp/member.html b/src/main/resources/templates/febs/views/dapp/member.html
index 39cd18c..df4a873 100644
--- a/src/main/resources/templates/febs/views/dapp/member.html
+++ b/src/main/resources/templates/febs/views/dapp/member.html
@@ -121,6 +121,13 @@
 <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">
+    {{# } else { }}
+    <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchInsideWith">
+    {{# } }}
+</script>
 <script type="text/html" id="member-option">
     {{#
         var accountStatus = {
@@ -143,6 +150,11 @@
 <!--    <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 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 data-th-inline="none" type="text/javascript">
     layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () {
         var $ = layui.jquery,
@@ -231,6 +243,28 @@
                     }
                 });
             }
+
+            if (layEvent === 'agentLevel') {
+                alert(1);
+                // 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();
+                    }
+                });
+            }
         });
 
         table.on('sort(memberTable)', function (obj) {
@@ -254,25 +288,51 @@
             tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject});
         });
 
+        form.on('switch(switchInsideWith)', function (data) {
+            if (data.elem.checked) {
+                insideWithYes(data.value);
+            } else {
+                insideWithNo(data.value);
+            }
+        })
+        function insideWithYes(id) {
+            febs.get(ctx + 'member/insideWithYes/' + id, null, function () {
+                febs.alert.success('操作成功');
+                $query.click();
+            });
+        }
+        function insideWithNo(id) {
+            febs.get(ctx + 'member/insideWithNo/' + id, null, function () {
+                febs.alert.success('操作成功');
+                $query.click();
+            });
+        }
+
         function initTable() {
             tableIns = febs.table.init({
                 elem: $view.find('table'),
                 id: 'memberTable',
                 url: ctx + 'member/list',
+                // toolbar:"#tableMemberBar",
+                // defaultToolbar:[],
                 totalRow: true,
                 cols: [[
-                    {title: '代理级别',
-                        templet: function (d) {
-                            return '<span class="layui-btn layui-btn-normal layui-btn-xs">'+d.accountType+'</span>'
-                        },minWidth: 130,align:'center', totalRowText: '合计'},
-                    {field: 'address', title: '地址', minWidth: 400},
+                    // {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},
-                    {title: '购买节点数量',
+                    // {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" lay-event="memberNodeInfo" shiro:hasPermission="memberNodeInfo:view"><span>'+d.memberNodeCnt+'</span></button>'
+                            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: 'directProfit', title: '直推收益', minWidth: 100, totalRow: true},
                     {field: 'inviteId', title: '邀请码', minWidth: 100},
                     {field: 'refererId', title: '上级邀请码', minWidth: 100},
                     {field: 'createTime', title: '创建时间', minWidth: 180}

--
Gitblit v1.9.1