From 985f70ad180b1ce396cf03e29cc2551a0bd892a2 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期一, 25 三月 2024 18:28:48 +0800
Subject: [PATCH] 删除多余文件

---
 pages/personalCenter/index.js |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/pages/personalCenter/index.js b/pages/personalCenter/index.js
index 7ece773..486252c 100644
--- a/pages/personalCenter/index.js
+++ b/pages/personalCenter/index.js
@@ -145,7 +145,11 @@
 
   },
   onShow() {
-
+    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+      this.getTabBar().setData({
+        active: 4
+      })
+    }
   },
   /**
    * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
@@ -175,6 +179,7 @@
           type = '-'
         }
         let defaultUser = {};
+        let nickNameData = res.infoList.find((item) => item.type == 'nickName')
         let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher')
         let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo')
         let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword')
@@ -182,8 +187,8 @@
         if (teacherRole && teacherInfos) {
           defaultUser = {
             ...teacherInfos,
-            fullName: teacherInfos.fullName,
-            icon: teacherInfos.icon,
+            nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : teacherInfos.name,
+            icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo ? WeChatInfo.icon : '',
             userId: res.userId,
             role: 'Teacher',
             roleId: teacherRole.role.id,
@@ -196,8 +201,8 @@
         } else if (WeChatInfo) {
           defaultUser = {
             ...WeChatInfo,
-            fullName: WeChatInfo.name,
-            icon: WeChatInfo.icon,
+            nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name,
+            icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon,
             userId: res.userId,
             userType: type
           }
@@ -206,8 +211,8 @@
           });
         } else if (secretData) {
           defaultUser = {
-            fullName: secretData.credential,
-            icon: "",
+            nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : secretData.credential,
+            icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : "",
             userId: res.userId,
             userType: type
           }

--
Gitblit v1.9.1