zhaoxiaohai 4 лет назад
Родитель
Сommit
8b30b821ae
1 измененных файлов с 16 добавлено и 33 удалено
  1. 16 33
      pages/teamManagement/change.js

+ 16 - 33
pages/teamManagement/change.js

@@ -11,7 +11,6 @@ Page({
      * 页面的初始数据
      */
     data: {
-        newAdd: false, //是否新增
         fname: '', //用户名称
         frole: '', //身份/职位
         fphonenumber: '', //手机号码
@@ -40,10 +39,6 @@ Page({
                 subusers: memberMessage.subusers,
                 tenterprise_userid: memberMessage.tenterprise_userid
             })
-        } else {
-            this.setData({
-                newAdd: true
-            })
         }
     },
     /* 提交 */
@@ -52,38 +47,29 @@ Page({
             title: '请检查表单内容',
             icon: "none"
         });
-        let content = {
-            "tenterprise_userid": this.data.tenterprise_userid,
-            "fname": this.data.fname,
-            "frole": this.data.frole,
-            "fphonenumber": this.data.fphonenumber,
-            "subusers": this.data.subusers
-        };
-        if (this.data.newAdd) {
-            content = {
-                "tenterprise_userid": 0
-            }
-        }
         _Http.basic({
             "accesstoken": wx.getStorageSync('userData').token,
             "classname": "customer.usercenter.teammsg.teammsg",
             "method": "update_userMsg",
-            "content": content
+            "content": {
+                "tenterprise_userid": this.data.tenterprise_userid,
+                "fname": this.data.fname,
+                "frole": this.data.frole,
+                "fphonenumber": this.data.fphonenumber,
+                "subusers": this.data.subusers
+            }
         }).then(res => {
             console.log(res)
-            if (res.msg == "成功" && !this.data.newAdd) {
-                wx.showToast({
-                    title: '保存成功',
-                });
-                this.setData({
-                    newAdd: false
+            if (res.msg != "成功") return
+            wx.showToast({
+                title: '保存成功',
+            });
+            setTimeout(() => {
+                wx.navigateBack({
+                    delta: 1
                 })
-                setTimeout(() => {
-                    wx.navigateBack({
-                        delta: 1
-                    })
-                }, 500)
-            }
+            }, 500)
+
         })
     },
     /* 商户提交前验证表单 */
@@ -173,9 +159,6 @@ Page({
      * 生命周期函数--监听页面卸载
      */
     onUnload: function () {
-        if(this.data.newAdd){
-            console.log("成员删除")
-        }
     },
 
     /**