From 5ca38e4ef60e35f08e87d6569b72c25433c311ca Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 26 三月 2024 17:05:14 +0800 Subject: [PATCH] 答题器bug修改,添加请求地址 --- pages/personalCenter/index.js | 30 +++++++++++++++++++++++------- 1 files changed, 23 insertions(+), 7 deletions(-) diff --git a/pages/personalCenter/index.js b/pages/personalCenter/index.js index b7bd420..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() }, /** @@ -198,9 +207,10 @@ defaultUser = { ...WeChatInfo, nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, - icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, + icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, userId: res.userId, - userType: type + userType: type, + role: 'Student', } this.setData({ currAuthStep: 3, @@ -208,9 +218,10 @@ } else if (secretData) { defaultUser = { nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : secretData.credential, - icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : "", + icon: nickNameData ? JSON.parse(nickNameData.data).icon : "", userId: res.userId, - userType: type + userType: type, + role: 'Student', } } this.setData({ @@ -218,6 +229,11 @@ }) this.getTeacherInfo() wx.setStorageSync(app.config.userInfoKey, JSON.stringify(this.data.userInfo)); + setTimeout(() => { + this.setData({ + 'baseRefresh.value': false, + }) + }, 500); } }); }, @@ -319,7 +335,7 @@ } }, - onPageScroll(e) { + onScroll(e) { this.setData({ isWhite: e.scrollTop > 20 ? true : false }) -- Gitblit v1.9.1