zhaoxiaohai 2 yıl önce
ebeveyn
işleme
479c9fe499

+ 48 - 23
pages/tabbar/mine/index.js

@@ -1,4 +1,5 @@
 const _Http = getApp().globalData.http;
+let downCount = null;
 Page({
 
     /**
@@ -6,19 +7,20 @@ Page({
      */
     data: {
         userMsg: {},
-        pathList: [{
-            name: "修改登录密码",
-            icon: "icon-a-wodeguanyuyingyong",
-            color: "var(--warning)",
-            path: `/pages/tabbar/mine/changePassword/index`
-        }], //功能权限
+        pathList: [], //功能权限
         teamAuth: '', //团队管理权限列表 JSON字符串 用于传递
     },
     onLoad(options) {
         this.queryUserMsg();
-        let authlist = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心']);
+        //美大关闭团队管理
+        /* let authlist = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心']);
+        let pathList = [{
+            name: "修改登录密码",
+            icon: "icon-a-wodeguanyuyingyong",
+            color: "var(--warning)",
+            path: `/pages/tabbar/mine/changePassword/index`
+        }]
         if (authlist.length) {
-            let pathList = this.data.pathList;
             authlist[0].apps.forEach(v => {
                 switch (v.name) {
                     case "teamManagement":
@@ -37,19 +39,35 @@ Page({
             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,
                 icon: "none"
-            })
+            });
+            switch (res.data.usertype) {
+                case 1:
+                    res.data.usertype = '企业职员'
+                    break;
+                case 21:
+                    res.data.usertype = '负责人'
+                    break;
+                case 22:
+                    res.data.usertype = '员工'
+                    break;
+                default:
+                    res.data.usertype = ''
+                    break;
+            }
             this.setData({
                 userMsg: res.data
             })
@@ -60,19 +78,25 @@ Page({
     },
     /* 退出登录 */
     outLogin() {
-        _Http.logout().then(res => {
-            wx.showToast({
-                title: '退出成功'
-            });
-            let loginMsg = wx.getStorageSync("loginMsg");
-            wx.clearStorageSync();
-            wx.setStorageSync('loginMsg', loginMsg)
-            setTimeout(() => {
-                wx.reLaunch({
-                    url: '/pages/login/phone',
-                })
-            }, 300)
+        clearTimeout(downCount);
+        wx.showLoading({
+            title: '正在退出...',
         })
+        downCount = setTimeout(() => {
+            _Http.logout().then(res => {
+                wx.showToast({
+                    title: '退出成功'
+                });
+                let loginMsg = wx.getStorageSync("loginMsg");
+                wx.clearStorageSync();
+                wx.setStorageSync('loginMsg', loginMsg)
+                setTimeout(() => {
+                    wx.reLaunch({
+                        url: '/pages/login/phone',
+                    })
+                }, 300)
+            })
+        }, 300);
     },
     /* 去修改用户信息 */
     changeUserMsg() {
@@ -142,4 +166,5 @@ Page({
             }
         })
     },
+    onShareAppMessage() {}
 })

+ 3 - 3
pages/tabbar/mine/index.wxml

@@ -3,7 +3,7 @@
         <van-image image-class="v-img" round width="128rpx" height="128rpx" src="{{userMsg.attinfos[0].url||'/static/image/user.png'}}" />
         <view class="user-msg">
             <view class="user-name">
-                {{userMsg.name}}<text>店长</text>
+                {{userMsg.name}}<text>{{userMsg.usertype}}</text>
             </view>
             <view class="user-phone">
                 {{userMsg.phonenumber}}
@@ -11,7 +11,7 @@
         </view>
         <van-icon size='40rpx' name="arrow" />
     </My_card>
-    <My_card custom-class='display-data'>
+    <!-- <My_card custom-class='display-data'>
         <view class="display-data_l">
             <view class="first-line">250</view>
             <view class="tow-line">行动力</view>
@@ -20,7 +20,7 @@
             <view class="first-line">平台行动力:250</view>
             <view class="tow-line">总部行动力:250</view>
         </view>
-    </My_card>
+    </My_card> -->
 </view>
 <My_card custom-class='operating' hover>
     <navigator class="item" url="{{item.name=='团队管理'?item.path+'?auth='+teamAuth:item.path}}" wx:for="{{pathList}}">

+ 24 - 23
pages/tabbar/mine/userMsg/index.js

@@ -26,16 +26,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,12 +39,24 @@ 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 ({
+            "copyPhonenumber": options.phonenumber
+        });
+        //美大禁用修改手机号
+        /* this.data.fromList1.push({
+            label: "手机号",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: options.phonenumber,
+            placeholder: "请填写",
+            valueName: "phonenumber", //绑定的字段名称
+            required: true, //必填
+            callback: function ({
                 value
             }) {
                 that.setData({
@@ -62,8 +64,10 @@ Page({
                     newPhone: value
                 })
             },
-            "copyPhonenumber": options.phonenumber
-        });
+        })
+        this.setData({
+            fromList1: this.data.fromList1
+        }) */
     },
     /* from1监听 */
     form1CompletedOrNot({
@@ -112,7 +116,6 @@ 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 (!deletMark.CheckEmail(data.email.trim())) return;
         if (this.data.show && this.data.password.length == 0) return wx.showToast({
             title: '请输入短信验证码',
@@ -126,7 +129,7 @@ Page({
             "method": "updateUserMsg",
             "content": {
                 "name": data.name,
-                "phonenumber": data.phonenumber,
+                "phonenumber": this.data.copyPhonenumber,
                 "email": data.email,
                 "password": MD5.hexMD5(this.data.password.trim())
             }
@@ -166,23 +169,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>