litian
2024-03-27 08bcd17001c34265d77b684cfe1bfb1eb1a08113
packageDomain/pages/sampleBookList/index.js
@@ -132,6 +132,7 @@
        userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
      })
    }
    this.getBookList(false);
  },
@@ -159,7 +160,7 @@
    this.setData({
      num: this.data.paperBookList.length + this.data.electronicBookList.length
    })
    this.getBookList(false);
  },
  goBack() {
    wx.navigateBack();
@@ -621,6 +622,9 @@
        this.setData({
          alreadyElectronicBookList: list,
        });
        if (wx.getStorageSync(app.config.tokenKey)) {
          this.getBookList(false);
        }
      }
    })
  },
@@ -884,13 +888,6 @@
      if (this.data.ebookCount > 0) {
        const eBookData = this.data.electronicBookList
        if (eBookData.length == 2) {
          if (this.data.bookList.length > 0) {
            this.data.bookList.forEach(i => {
              if (i.id == item.id) {
                i.electronChecked = false;
              }
            })
          }
          item.electronChecked = false;
          wx.showToast({
            title: "每次最多只可申请2本样书",
@@ -918,6 +915,7 @@
            this.setData({
              num: this.data.electronicBookList.length + this.data.paperBookList.length
            })
            this.getBookList(false);
          } else {
            let list = this.data.electronicBookList;
            list.forEach((obj, index) => {
@@ -936,6 +934,7 @@
              num: list.length + this.data.paperBookList.length
            })
            wx.setStorageSync("electronicBookList", list);
            this.getBookList(false);
          }
        } else {
          wx.showToast({
@@ -948,6 +947,7 @@
            num: 1 + this.data.paperBookList.length
          })
          wx.setStorageSync("electronicBookList", [itemAttr]);
        }
      } else {
        item.electronChecked = false
@@ -961,13 +961,6 @@
      if (this.data.paperBookCount > 0) {
        const pBookData = this.data.paperBookList
        if (pBookData.length == 2) {
          if (this.data.bookList.length > 0) {
            this.data.bookList.forEach(i => {
              if (i.id == item.id) {
                i.paperChecked = false;
              }
            })
          }
          item.paperChecked = false
          wx.showToast({
            title: "每次最多只可申请2本样书",
@@ -996,6 +989,7 @@
            this.setData({
              num: this.data.paperBookList.length + this.data.electronicBookList.length
            })
          } else {
            let list = this.data.paperBookList;
            list.forEach((obj, index) => {