litian
2024-02-29 39924c310ef7c5b936a5cbd71ec96b144ef133f7
pages/personalCenter/index.js
@@ -83,6 +83,7 @@
   * 页面的初始数据
   */
  data: {
    isWhite: false,
    show: false,
    userInfo: {
      avatarUrl:
@@ -122,9 +123,11 @@
          selected: 4 //这个数字是当前页面在tabBar中list数组的索引
        })
      }
      if (this.data.userInfo) {
        this.getTeacherInfo()
      }
      this.getTeacherInfo()
    } else {
      wx.navigateTo({
        url: "/pages/testLogin/index",
      });
    }
  },
  /**
@@ -159,7 +162,8 @@
      }
    }
    app.MG.ugc.getTopicMessageList(data).then((res) => {
      const resData = res.datas.find((i) => i.appUserCreator.userId == userId.value)
      console.log(this.data.userInfo, "userInfo")
      const resData = res.datas.find((i) => i.appUserCreator.userId == this.data.userInfo.userId)
      if (resData) {
        this.setData({
          teacherState: {
@@ -193,5 +197,12 @@
   */
  onShareAppMessage() {
  },
  onPageScroll(e) {
    this.setData({
      isWhite: e.scrollTop > 50 ? true : false
    })
  }
})