From 97bb5d54315b91b851d6934fb2bb98b80b7dc4f1 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Sat, 15 May 2021 16:20:04 +0800
Subject: [PATCH] 20210514 云顶

---
 src/main/resources/templates/febs/views/modules/member/member.html |  155 ++++++++++++++++++++++++++++++++-------------------
 1 files changed, 98 insertions(+), 57 deletions(-)

diff --git a/src/main/resources/templates/febs/views/modules/member/member.html b/src/main/resources/templates/febs/views/modules/member/member.html
index b99c9db..9aeb17c 100644
--- a/src/main/resources/templates/febs/views/modules/member/member.html
+++ b/src/main/resources/templates/febs/views/modules/member/member.html
@@ -12,7 +12,7 @@
                                             <input type="text" placeholder="手机号/邮箱/邀请码" name="account" autocomplete="off" class="layui-input">
                                         </div>
                                     </div>
-                                    <div class="layui-inline">
+                                    <!--<div class="layui-inline">
                                         <label class="layui-form-label layui-form-label-sm">审核状态</label>
                                         <div class="layui-input-inline">
                                             <select name="certifyStatus">
@@ -22,7 +22,7 @@
                                                 <option value="3">未实名</option>
                                             </select>
                                         </div>
-                                    </div>
+                                    </div>-->
                                 </div>
                             </div>
                             <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
@@ -52,13 +52,11 @@
 <!-- 表格操作栏 end -->
 <script data-th-inline="none" type="text/javascript">
     // 引入组件并初始化
-    layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () {
+    layui.use([ 'jquery', 'form', 'table', 'febs'], function () {
         var $ = layui.jquery,
-            laydate = layui.laydate,
             febs = layui.febs,
             form = layui.form,
             table = layui.table,
-            dropdown = layui.dropdown,
             $view = $('#febs-user'),
             $query = $view.find('#query'),
             $reset = $view.find('#reset'),
@@ -75,6 +73,16 @@
         table.on('tool(userTable)', function (obj) {
             var data = obj.data,
                 layEvent = obj.event;
+            if (layEvent === 'disagree') {
+                febs.modal.confirm('禁止', '确认禁止平仓功能?', function () {
+                    disagree(data.id);
+                });
+            }
+            if (layEvent === 'agree') {
+                febs.modal.confirm('开启', '确认开启平仓功能?', function () {
+                    agree(data.id);
+                });
+            }
             
             if (layEvent === 'edit') {
                 febs.modal.open('身份认证', 'modules/member/memberDetail/' + data.id, {
@@ -108,7 +116,41 @@
   			    	maxmin: true,
                   });
               }
+            if (layEvent === 'addIsTrader') {
+                febs.modal.confirm('设置合伙人', '设置成为合伙人?', function () {
+                    addIsTraderOn(data.id);
+                });
+            }
+            if (layEvent === 'delIsTrader') {
+                febs.modal.confirm('设置合伙人', '取消合伙人资格?', function () {
+                    delIsTraderOn(data.id);
+                });
+            }
         });
+        function addIsTraderOn(id) {
+            febs.get(ctx + 'yd/addIsTraderOn/' + id, null, function () {
+                febs.alert.success('操作成功');
+                $query.click();
+            });
+        }
+        function delIsTraderOn(id) {
+            febs.get(ctx + 'yd/delIsTraderOn/' + id, null, function () {
+                febs.alert.success('操作成功');
+                $query.click();
+            });
+        }
+        function disagree(id) {
+            febs.get(ctx + 'tradeManage/disagreePositionSetting/' + id, null, function () {
+                febs.alert.success('禁止成功');
+                $query.click();
+            });
+        }
+        function agree(id) {
+            febs.get(ctx + 'tradeManage/agreePositionSetting/' + id, null, function () {
+                febs.alert.success('开启成功');
+                $query.click();
+            });
+        }
         
 
         // 查询按钮
@@ -130,64 +172,63 @@
                 id: 'userTable',
                 url: ctx + 'member/getList',
                 cols: [[
-                    {field: 'phone', title: '手机号', minWidth: 100,align:'left'},
-                    {field: 'email', title: '邮箱', minWidth: 200,align:'left'},
-                    {field: 'realName', title: '姓名', minWidth: 200,align:'left'},
-                    {field: 'inviteId', title: '邀请码UID',
-                    	templet: function (d) {
-                                return '<a lay-event="examine" shiro:hasPermission="user:update">'+d.inviteId+'</a>'
-                            }
-                        }, minWidth: 80,align:'center'},
+                    {field: 'phone', title: '手机号', minWidth: 150,align:'left'},
+                    {field: 'email', title: '邮箱', minWidth: 150,align:'left'},
+                    //{field: 'realName', title: '姓名', minWidth: 100,align:'left'},
+                    {field: 'inviteId', title: '邀请码UID', minWidth: 80,align:'center'},
                     {field: 'refererId', title: '上级邀请码UID', minWidth: 80,align:'center'},
-                    {field: 'accountType', title: '账号类型',
+                    {field: 'isTrader', title: '状态',
                     	templet: function (d) {
-                            if (d.accountType === 2) {
-                                return '<span style="color:green;">测试账号</span>'
-                            } else if (d.accountType === 1) {
-                                return '<span style="color:red;">正常账号</span>'
-                            }else{
+                            if (d.isTrader === 1) {
+                                return '<span style="color:green;">合伙人</span>'
+                            } else{
                                 return ''
                             }
                         }, minWidth: 80,align:'center'},
-                    {field: 'refererId', title: '账号状态',
-                        	templet: function (d) {
-                                if (d.accountStatus === 1) {
-                                    return '<span style="color:green;">正常</span>'
-                                } else if (d.accountStatus === 0) {
-                                    return '<span style="color:red;">禁用</span>'
-                                }else{
-                                    return ''
-                                }
-                            }, minWidth: 80,align:'center'},
-                    {field: 'refererId', title: '审核状态',
-                            	templet: function (d) {
-                                    if (d.certifyStatus === 0) {
-                                        return '<span style="color:red;">未通过</span>'
-                                    } else if (d.certifyStatus === 1) {
-                                        return '<span style="color:blue;">待审核</span>'
-                                    } else if (d.certifyStatus === 2) {
-                                        return '<span style="color:green;">审核通过</span>'
-                                    } else if (d.certifyStatus === 3) {
-                                        return '<span>未实名</span>'
-                                    }else{
-                                        return ''
-                                    }
-                                }, minWidth: 80,align:'center'},
+                    // {field: 'accountStatus', title: '账号状态',
+                    //     	templet: function (d) {
+                    //             if (d.accountStatus === 1) {
+                    //                 return '<span style="color:green;">正常</span>'
+                    //             } else if (d.accountStatus === 0) {
+                    //                 return '<span style="color:red;">禁用</span>'
+                    //             }else{
+                    //                 return ''
+                    //             }
+                    //         }, minWidth: 80,align:'center'},
+                    // {field: 'certifyStatus', title: '审核状态',
+                    //         	templet: function (d) {
+                    //                 if (d.certifyStatus === 0) {
+                    //                     return '<span style="color:red;">未通过</span>'
+                    //                 } else if (d.certifyStatus === 1) {
+                    //                     return '<span style="color:blue;">待审核</span>'
+                    //                 } else if (d.certifyStatus === 2) {
+                    //                     return '<span style="color:green;">审核通过</span>'
+                    //                 } else if (d.certifyStatus === 3) {
+                    //                     return '<span>未实名</span>'
+                    //                 }else{
+                    //                     return ''
+                    //                 }
+                    //             }, minWidth: 80,align:'center'},
+                    // {field: 'pcState', title: '是否可平仓',
+                    //     templet: function (d) {
+                    //         if (d.pcState === 1) {
+                    //             return '<span style="color:#ff0000;">否</span>'
+                    //         } else {
+                    //             return '<span style="color:green;">是</span>'
+                    //         }
+                    //     },minWidth: 100,align:'center'},
                     {field: 'createTime', title: '注册时间', minWidth: 180,align:'center'},
-                    {title: '操作', 
-                    	templet: function (d) {
-                            if (d.certifyStatus === 1) {
-                            	return '<a lay-event="edit" shiro:hasPermission="user:update">审核认证</a>'
-                            	+'<i class="layui-icon febs-edit-area febs-blue">&#xe7a4;</i>'
-                            	+'<a lay-event="addCoin" shiro:hasPermission="user:update">拨币</a>'
-                            }else if(d.certifyStatus === 2){
-                            	return '<a lay-event="see" shiro:hasPermission="user:update">'
-                            	+'<i class="layui-icon febs-edit-area febs-blue">&#xe7a5;</i></a>'
-                            	+'<a lay-event="addCoin" shiro:hasPermission="user:update">拨币</a>'
-                            }else {
-                                return '<a lay-event="addCoin" shiro:hasPermission="user:update">拨币</a>'
-                            }
-                        },minWidth: 200,align:'center'}
+                    {title: '操作', templet: function (d) {
+                        if(d.isTrader === 2){
+                            return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="addCoin" shiro:hasPermission="user:update">拨币</button>'
+                                        +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="addIsTrader" shiro:hasPermission="user:update">成为合伙人</button>'
+                        }else if(d.isTrader === 1){
+                            return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="addCoin" shiro:hasPermission="user:update">拨币</button>'
+                                +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="delIsTrader" shiro:hasPermission="user:update">取消合伙人</button>'
+                        }else{
+                            return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="addCoin" shiro:hasPermission="user:update">拨币</button>'
+                        }
+                    },minWidth: 300,align:'center'}
                 ]]
             });
         }

--
Gitblit v1.9.1