From 93463d63f0dd81c436aa3335506611aab8356b88 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期一, 25 三月 2024 23:39:40 +0800 Subject: [PATCH] 样式修改 --- pages/personalCenter/index.js | 39 ++++++++++++++++++++++++++++----------- 1 files changed, 28 insertions(+), 11 deletions(-) diff --git a/pages/personalCenter/index.js b/pages/personalCenter/index.js index 7ece773..ff34677 100644 --- a/pages/personalCenter/index.js +++ b/pages/personalCenter/index.js @@ -117,6 +117,9 @@ moreMenu, moreMenu1, visible: false, + baseRefresh: { + value: false + } }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 @@ -142,15 +145,21 @@ url: "/pages/testLogin/index", }); } - }, onShow() { - + if (typeof this.getTabBar === 'function' && this.getTabBar()) { + this.getTabBar().setData({ + active: 4 + }) + } }, /** * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 */ onPullDownRefresh() { + this.setData({ + 'baseRefresh.value': true, + }) this.getUserInfo() }, /** @@ -175,6 +184,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 +192,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,20 +206,22 @@ } else if (WeChatInfo) { defaultUser = { ...WeChatInfo, - fullName: WeChatInfo.name, - icon: WeChatInfo.icon, + nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, + icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, userId: res.userId, - userType: type + userType: type, + role: 'Student', } this.setData({ currAuthStep: 3, }); } else if (secretData) { defaultUser = { - fullName: secretData.credential, - icon: "", + nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : secretData.credential, + icon: nickNameData ? JSON.parse(nickNameData.data).icon : "", userId: res.userId, - userType: type + userType: type, + role: 'Student', } } this.setData({ @@ -217,6 +229,11 @@ }) this.getTeacherInfo() wx.setStorageSync(app.config.userInfoKey, JSON.stringify(this.data.userInfo)); + setTimeout(() => { + this.setData({ + 'baseRefresh.value': false, + }) + }, 500); } }); }, @@ -318,7 +335,7 @@ } }, - onPageScroll(e) { + onScroll(e) { this.setData({ isWhite: e.scrollTop > 20 ? true : false }) -- Gitblit v1.9.1