From c2a2a7f123eb1ac950d51da5033ddc3d23567765 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 09 Sep 2022 11:52:26 +0800
Subject: [PATCH] 20220902

---
 src/main/resources/templates/febs/views/modules/leader/leaderList.html |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/templates/febs/views/modules/leader/leaderList.html b/src/main/resources/templates/febs/views/modules/leader/leaderList.html
index 30a504a..2bdac6c 100644
--- a/src/main/resources/templates/febs/views/modules/leader/leaderList.html
+++ b/src/main/resources/templates/febs/views/modules/leader/leaderList.html
@@ -62,6 +62,13 @@
     <a lay-event="edit" shiro:hasPermission="user:update"><i
             class="layui-icon febs-edit-area febs-blue">&#xe7a5;</i></a>
 </script>
+<script type="text/html" id="upOrDownSwitch">
+    {{# if(d.profitSwitch === 1) { }}
+    <input type="checkbox" value={{d.id}} lay-text="开启|关闭" checked lay-skin="switch" lay-filter="upOrDownSwitch">
+    {{# } else { }}
+    <input type="checkbox" value={{d.id}} lay-text="开启|关闭" lay-skin="switch" lay-filter="upOrDownSwitch">
+    {{# } }}
+</script>
 <!-- 表格操作栏 end -->
 <script data-th-inline="none" type="text/javascript">
     // 引入组件并初始化
@@ -111,7 +118,7 @@
                 });
             }
             if (layEvent === 'leaderCancel') {
-                febs.modal.confirm('取消', '用户被取消团长资格将无法再次申请', function () {
+                febs.modal.confirm('拉黑', '团长被拉黑,将无法再次申请团长', function () {
                     leaderCancel(data.id);
                 });
             }
@@ -168,6 +175,8 @@
                     {field: 'addressArea', title: '自提点名称', minWidth: 150,align:'left'},
                     {field: 'detailAddress', title: '自提点地址', minWidth: 150,align:'left'},
                     {field: 'totalProfit', title: '收益', minWidth: 150,align:'left'},
+                    {field: 'profitSwitch', title: '是否返利', templet: '#upOrDownSwitch', minWidth: 100,align:'center'},
+                    {field: 'bonusPercent', title: '返利比例', minWidth: 150,align:'left'},
                     // {field: 'phone', title: '电话', minWidth: 150,align:'left'},
                     {field: 'state', title: '状态',
                         templet: function (d) {
@@ -190,7 +199,8 @@
                                     + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderUpdate" shiro:hasPermission="user:update">审核</button>'
                             }else if(d.state === 1) {
                                 return ''
-                                    + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderCancel" shiro:hasPermission="user:update">取消</button>'
+                                    + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderUpdate" shiro:hasPermission="user:update">修改</button>'
+                                    + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderCancel" shiro:hasPermission="user:update">拉黑</button>'
                                     // + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderGoodsUpdate" shiro:hasPermission="user:update">团长商品设置</button>'
                             }else{
                                 return '';
@@ -200,14 +210,28 @@
             });
         }
 
-        form.on('switch(startOrCloseSwitch)', function (data) {
+        form.on('switch(upOrDownSwitch)', function (data) {
             if (data.elem.checked) {
-                startAct(data.value);
+                startProfit(data.value);
             } else {
-                closeAct(data.value);
+                closeProfit(data.value);
             }
         })
 
+        function startProfit(id) {
+            febs.get(ctx + 'admin/leader/startProfit/' + id, null, function () {
+                febs.alert.success('开启成功');
+                $query.click();
+            });
+        }
+
+        function closeProfit(id) {
+            febs.get(ctx + 'admin/leader/closeProfit/' + id, null, function () {
+                febs.alert.success('关闭成功');
+                $query.click();
+            });
+        }
+
         // 获取查询参数
         function getQueryParams() {
             return {

--
Gitblit v1.9.1