闫增涛
2024-04-10 bd3c5bd24f0d5c5b8669bb034a75d46d7a10599d
packageDomain/pages/sampleBookList/applicationForm/index.js
@@ -34,17 +34,21 @@
   * 生命周期函数--监听页面显示
   */
  onShow() {
    let that = this;
    that.setData({
      bookList: []
    })
    if (wx.getStorageSync(app.config.userInfoKey)) {
      this.setData({
      that.setData({
        userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
      })
      if (this.data.userInfo.role == 'Teacher') {
        this.setData({
          'teacherInfo.schoolName': JSON.parse(this.data.userInfo.data).schoolName,
          'teacherInfo.courseName': JSON.parse(this.data.userInfo.data).courseName,
          'contactInfo.fullName': JSON.parse(this.data.userInfo.data).fullName,
          'contactInfo.phone': JSON.parse(this.data.userInfo.data).phone,
          'contactInfo.detailedAddress': JSON.parse(this.data.userInfo.data).detailedAddress,
      if (that.data.userInfo.role == 'Teacher') {
        that.setData({
          'teacherInfo.schoolName': JSON.parse(that.data.userInfo.data).schoolName,
          'teacherInfo.courseName': JSON.parse(that.data.userInfo.data).courseName,
          'contactInfo.fullName': JSON.parse(that.data.userInfo.data).fullName,
          'contactInfo.phone': JSON.parse(that.data.userInfo.data).phone,
          'contactInfo.detailedAddress': JSON.parse(that.data.userInfo.data).detailedAddress,
        })
      } else {
        wx.showModal({
@@ -60,19 +64,19 @@
        })
      }
      if (wx.getStorageSync("paperBookList")) {
        this.setData({
          paperBookList: wx.getStorageSync("paperBookList"),
          bookList: wx.getStorageSync("paperBookList")
        that.setData({
          paperBookList: JSON.parse(wx.getStorageSync("paperBookList")),
          bookList: JSON.parse(wx.getStorageSync("paperBookList"))
        })
      }
      if (wx.getStorageSync("electronicBookList")) {
        this.setData({
          electronicBookList: wx.getStorageSync("electronicBookList")
        that.setData({
          electronicBookList: JSON.parse(wx.getStorageSync("electronicBookList"))
        })
      }
      this.getSelectBookCount();
      this.getSelectPaperBookCount();
      this.getPaperType();
      that.getSelectBookCount();
      that.getSelectPaperBookCount();
      that.getPaperType();
    }
  },