闫增涛
2025-03-31 04c7b0163caeae4ab1c5da62e301fa993101cfad
packageDomain/pages/sampleBookList/index.js
@@ -142,21 +142,7 @@
    // 检查登录状态
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
      loginInfo(app, (data) => {
        if (data) {
          that.setData({
            userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
          })
          that.getAlreadyPBookList()
          that.getAlreadyEBookList()
          // 获取申请次数
          that.getSelectPaperBookCount()
          that.getSelectBookCount()
        }
      })
    } else {
    if (token) {
      that.setData({
        userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
      })
@@ -181,16 +167,24 @@
   */
  onShow() {
    let that = this;
    // that.setData({
    //   page: 1,
    //   paperBookList: [],
    //   electronicBookList: []
    // })
    that.getAlreadyPBookList()
    that.getAlreadyEBookList()
    // 获取申请次数
    that.getSelectPaperBookCount()
    that.getSelectBookCount()
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
      loginInfo(app, (data) => {
        if (data) {
          that.setData({
            userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
          })
          that.getAlreadyPBookList()
          that.getAlreadyEBookList()
          that.getSelectPaperBookCount()
          that.getSelectBookCount()
        } else {
          wx.switchTab({
            url: '/pages/home/home',
          })
        }
      })
    }
    if (wx.getStorageSync("paperBookList") || wx.getStorageSync("electronicBookList")) {
      if (wx.getStorageSync("paperBookList")) {
        that.setData({