From a721f2949a80666751ed7390a9ecba97454f140e Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 15 Sep 2022 17:48:09 +0800
Subject: [PATCH] 20220902
---
src/main/resources/templates/febs/views/modules/leader/leaderList.html | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 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 c7ca5e1..f10fb07 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"></i></a>
</script>
+<script type="text/html" id="onlineStateSwitch">
+ {{# if(d.onlineState === 1) { }}
+ <input type="checkbox" value={{d.id}} lay-text="在线|离线" checked lay-skin="switch" lay-filter="onlineStateSwitch">
+ {{# } else { }}
+ <input type="checkbox" value={{d.id}} lay-text="在线|离线" lay-skin="switch" lay-filter="onlineStateSwitch">
+ {{# } }}
+</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">
@@ -187,6 +194,7 @@
{field: 'addressArea', title: '自提点名称', minWidth: 150,align:'left'},
{field: 'detailAddress', title: '自提点地址', minWidth: 150,align:'left'},
{field: 'totalProfit', title: '收益', minWidth: 150,align:'left'},
+ {field: 'onlineState', title: '在线状态', templet: '#onlineStateSwitch', minWidth: 100,align:'center'},
{field: 'profitSwitch', title: '是否返利', templet: '#upOrDownSwitch', minWidth: 100,align:'center'},
{field: 'bonusPercent', title: '返利比例', minWidth: 150,align:'left'},
// {field: 'phone', title: '电话', minWidth: 150,align:'left'},
@@ -223,6 +231,29 @@
});
}
+ form.on('switch(onlineStateSwitch)', function (data) {
+ if (data.elem.checked) {
+ startOnline(data.value);
+ } else {
+ closeOnline(data.value);
+ }
+ $query.click();
+ })
+
+ function startOnline(id) {
+ febs.get(ctx + 'admin/leader/startOnline/' + id, null, function () {
+ febs.alert.success('在线成功');
+ $query.click();
+ });
+ }
+
+ function closeOnline(id) {
+ febs.get(ctx + 'admin/leader/closeOnline/' + id, null, function () {
+ febs.alert.success('离线成功');
+ $query.click();
+ });
+ }
+
form.on('switch(upOrDownSwitch)', function (data) {
if (data.elem.checked) {
startProfit(data.value);
--
Gitblit v1.9.1