Browse Source

团队成员是否启用添加二次确定

zhaoxiaohai 3 years ago
parent
commit
5d03effb59
1 changed files with 24 additions and 6 deletions
  1. 24 6
      pages/teamManagement/change.js

+ 24 - 6
pages/teamManagement/change.js

@@ -151,12 +151,30 @@ Page({
             title: '商户主账号不可停用',
             icon: "none"
         });
-        const checked = !this.data.checked,
-            fisused = (checked) ? 1 : 0
-        this.setData({
-            checked,
-            fisused
-        })
+        const that = this;
+        if (this.data.tenterprise_userid != 0) {
+            wx.showModal({
+                title: "提示",
+                content: (this.data.checked) ? '是否停用“' + this.data.fname + '”,停用后该角色将暂时无法登陆' : '是否启用“' + this.data.fname + '”',
+                success(res) {
+                    if (res.confirm) {
+                        const checked = !that.data.checked,
+                            fisused = (checked) ? 1 : 0
+                        that.setData({
+                            checked,
+                            fisused
+                        })
+                    }
+                }
+            })
+        } else {
+            const checked = !that.data.checked,
+                fisused = (checked) ? 1 : 0
+            that.setData({
+                checked,
+                fisused
+            })
+        }
     },
     /**
      * 生命周期函数--监听页面初次渲染完成