zhaoxiaohai 3 年之前
父节点
当前提交
5b1b726acc
共有 3 个文件被更改,包括 63 次插入55 次删除
  1. 31 25
      pages/tabbar/mine/index.js
  2. 32 28
      pages/tabbar/mine/userMsg/index.js
  3. 0 2
      pages/tabbar/mine/userMsg/index.wxml

+ 31 - 25
pages/tabbar/mine/index.js

@@ -6,6 +6,7 @@ Page({
      * 页面的初始数据
      */
     data: {
+        site: getApp().globalData.site,
         userMsg: {},
         pathList: [{
             name: "修改登录密码",
@@ -17,35 +18,40 @@ Page({
     },
     onLoad(options) {
         this.queryUserMsg();
-        let authlist = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心']);
-        if (authlist.length) {
-            let pathList = this.data.pathList;
-            authlist[0].apps.forEach(v => {
-                switch (v.name) {
-                    case "teamManagement":
-                        pathList.unshift({
-                            name: "团队管理",
-                            icon: "icon-a-wodetuanduiguanli",
-                            color: "var(--assist)",
-                            path: `/${v.path}`
-                        })
-                        this.setData({
-                            teamAuth: JSON.stringify(v.meta.auth)
-                        })
-                        break;
-                }
-            });
-            this.setData({
-                pathList
-            })
-        }
+        //美大关闭团队管理
+        if (!['美大'].includes(this.data.site)) {
+            let authlist = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心']);
+            if (authlist.length) {
+                let pathList = this.data.pathList;
+                authlist[0].apps.forEach(v => {
+                    switch (v.name) {
+                        case "teamManagement":
+                            pathList.unshift({
+                                name: "团队管理",
+                                icon: "icon-a-wodetuanduiguanli",
+                                color: "var(--assist)",
+                                path: `/${v.path}`
+                            })
+                            this.setData({
+                                teamAuth: JSON.stringify(v.meta.auth)
+                            })
+                            break;
+                    }
+                });
+                this.setData({
+                    pathList
+                })
+            }
+        };
     },
     /* 查询用户信息 */
     queryUserMsg() {
         _Http.basic({
             "classname": "common.usercenter.usercenter",
             "method": "queryUserMsg",
-            "content": {}
+            "content": {
+                "nochace": true
+            }
         }).then(res => {
             if (res.msg != '成功') return wx.showToast({
                 title: res.msg,
@@ -63,7 +69,7 @@ Page({
     outLogin() {
         clearTimeout(downCount);
         wx.showLoading({
-          title: '正在退出...',
+            title: '正在退出...',
         })
         downCount = setTimeout(() => {
             _Http.logout().then(res => {
@@ -149,5 +155,5 @@ Page({
             }
         })
     },
-    onShareAppMessage() { }
+    onShareAppMessage() {}
 })

+ 32 - 28
pages/tabbar/mine/userMsg/index.js

@@ -7,6 +7,7 @@ Page({
      * 页面的初始数据
      */
     data: {
+        site: getApp().globalData.site,
         attinfos: [],
         fromList1: [{
             label: "姓名",
@@ -26,16 +27,6 @@ Page({
             placeholder: "请填写",
             valueName: "email", //绑定的字段名称
             required: true //必填
-        }, {
-            label: "手机号",
-            error: false,
-            errMsg: "",
-            type: "text",
-            value: "",
-            placeholder: "请填写",
-            valueName: "phonenumber", //绑定的字段名称
-            required: true, //必填
-            callback: null,
         }],
         disabled: true, //禁用按钮
         show: false, //显示验证码输入框
@@ -49,21 +40,36 @@ Page({
      */
     onLoad(options) {
         const that = this;
+        console.log(options.email)
         this.setData({
             attinfos: JSON.parse(options.attinfos),
             "fromList1[0].value": options.name,
             "fromList1[1].value": options.email == "undefined" ? "" : options.email,
-            "fromList1[2].value": options.phonenumber,
-            "fromList1[2].callback": function ({
-                value
-            }) {
-                that.setData({
-                    show: (value != that.data.copyPhonenumber) ? true : false,
-                    newPhone: value
-                })
-            },
             "copyPhonenumber": options.phonenumber
         });
+        if (!['美大'].includes(this.data.site)) { //美大禁用修改手机号
+            this.data.fromList1.push({
+                label: "手机号",
+                error: false,
+                errMsg: "",
+                type: "text",
+                value: options.phonenumber,
+                placeholder: "请填写",
+                valueName: "phonenumber", //绑定的字段名称
+                required: true, //必填
+                callback: function ({
+                    value
+                }) {
+                    that.setData({
+                        show: (value != that.data.copyPhonenumber) ? true : false,
+                        newPhone: value
+                    })
+                },
+            })
+            this.setData({
+                fromList1:this.data.fromList1
+            })
+        }
     },
     /* from1监听 */
     form1CompletedOrNot({
@@ -112,7 +118,7 @@ Page({
     submit() {
         if (this.data.disabled || this.data.loading) return;
         let data = this.selectComponent("#form1").getData().returnData;
-        if (!deletMark.CheckPhoneNumber(data.phonenumber.trim() - 0)) return;
+        if (!['美大'].includes(this.data.site) && !deletMark.CheckPhoneNumber(data.phonenumber.trim() - 0)) return;
         if (!deletMark.CheckEmail(data.email.trim())) return;
         if (this.data.show && this.data.password.length == 0) return wx.showToast({
             title: '请输入短信验证码',
@@ -126,7 +132,7 @@ Page({
             "method": "updateUserMsg",
             "content": {
                 "name": data.name,
-                "phonenumber": data.phonenumber,
+                "phonenumber": !['美大'].includes(this.data.site) ? data.phonenumber : this.data.copyPhonenumber,
                 "email": data.email,
                 "password": MD5.hexMD5(this.data.password.trim())
             }
@@ -166,23 +172,21 @@ Page({
                 "usetype": "headportrait",
                 "attachmentids": detail
             }
-        }).then(res => {
-            console.log(res)
+        }).then(async res => {
             if (res.msg != '成功') return wx.showToast({
                 title: res.msg,
                 icon: "none"
             })
-            let attinfos = this.data.attinfos;
-            if (attinfos[0]) _Http.basic({
+            let linksids = this.data.attinfos.map(v => v.linksid);
+            if (linksids.length) await _Http.basic({
                 "classname": "system.attachment.Attachment",
                 "method": "deleteFileLink",
                 "content": {
-                    "linksids": [attinfos[0].linksid]
+                    "linksids": linksids
                 }
             });
-            attinfos = res.data;
             this.setData({
-                attinfos
+                attinfos: res.data
             })
             this.changeUserMsg();
         })

+ 0 - 2
pages/tabbar/mine/userMsg/index.wxml

@@ -8,9 +8,7 @@
         </view>
     </navigator>
 </My_upload>
-
 <view style="height: 20rpx;" />
-
 <My_form id='form1' fromList='{{fromList1}}' bindCompletedOrNot='form1CompletedOrNot' />
 <van-cell-group wx:if="{{show}}">
     <van-field model:value="{{ password }}" required center clearable label="短信验证码" placeholder="请输入短信验证码" border="{{ false }}" use-button-slot>