| | |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | | } |
| | | this.getBookList(false); |
| | | |
| | | }, |
| | | |
| | |
| | | this.setData({ |
| | | num: this.data.paperBookList.length + this.data.electronicBookList.length |
| | | }) |
| | | this.getBookList(false); |
| | | |
| | | }, |
| | | goBack() { |
| | | wx.navigateBack(); |
| | |
| | | this.setData({ |
| | | alreadyElectronicBookList: list, |
| | | }); |
| | | if (wx.getStorageSync(app.config.tokenKey)) { |
| | | this.getBookList(false); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | |
| | | 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本样书", |
| | |
| | | this.setData({ |
| | | num: this.data.electronicBookList.length + this.data.paperBookList.length |
| | | }) |
| | | this.getBookList(false); |
| | | } else { |
| | | let list = this.data.electronicBookList; |
| | | list.forEach((obj, index) => { |
| | |
| | | num: list.length + this.data.paperBookList.length |
| | | }) |
| | | wx.setStorageSync("electronicBookList", list); |
| | | this.getBookList(false); |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | |
| | | num: 1 + this.data.paperBookList.length |
| | | }) |
| | | wx.setStorageSync("electronicBookList", [itemAttr]); |
| | | |
| | | } |
| | | } else { |
| | | item.electronChecked = false |
| | |
| | | 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本样书", |
| | |
| | | this.setData({ |
| | | num: this.data.paperBookList.length + this.data.electronicBookList.length |
| | | }) |
| | | |
| | | } else { |
| | | let list = this.data.paperBookList; |
| | | list.forEach((obj, index) => { |