yiming
2024-03-26 09905b43ec2a249ef0e6057d148b8620cfaa1506
pages/personalCenter/index.js
@@ -117,6 +117,9 @@
    moreMenu,
    moreMenu1,
    visible: false,
    baseRefresh: {
      value: false
    }
  },
  /**
   * 生命周期函数--监听页面加载
@@ -142,7 +145,6 @@
        url: "/pages/testLogin/index",
      });
    }
  },
  onShow() {
    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
@@ -155,6 +157,9 @@
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
    this.setData({
      'baseRefresh.value': true,
    })
    this.getUserInfo()
  },
  /**
@@ -202,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,
@@ -212,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({
@@ -222,6 +229,11 @@
        })
        this.getTeacherInfo()
        wx.setStorageSync(app.config.userInfoKey, JSON.stringify(this.data.userInfo));
        setTimeout(() => {
          this.setData({
            'baseRefresh.value': false,
          })
        }, 500);
      }
    });
  },
@@ -323,7 +335,7 @@
    }
  },
  onPageScroll(e) {
  onScroll(e) {
    this.setData({
      isWhite: e.scrollTop > 20 ? true : false
    })