From 3d73fb33c46aada16a6060adcd4ea14bb33b6b2a Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 09 四月 2024 10:39:11 +0800 Subject: [PATCH] 详情页tabs样式优化,答题添加页面退出拦截,合并代码 --- packageDomain/pages/sampleBookList/index.js | 48 +----------------------------------------------- 1 files changed, 1 insertions(+), 47 deletions(-) diff --git a/packageDomain/pages/sampleBookList/index.js b/packageDomain/pages/sampleBookList/index.js index eb4db74..0858a02 100644 --- a/packageDomain/pages/sampleBookList/index.js +++ b/packageDomain/pages/sampleBookList/index.js @@ -420,8 +420,6 @@ author: [], isbn: [], publicationDate: [], - pdf: [], - protectedEpub: [], isApplyBook: [], 'isApplyBook>': ['1'], ...searchObj, @@ -497,9 +495,6 @@ }) } else { that.setData({ - bookList: [], - pageTotalCount: 0, - bottomLoading: false, skeletonLoding: false, loading: false }) @@ -812,55 +807,14 @@ }, //閫夋嫨鐢靛瓙鏍蜂功 - async onChangeElectron(e) { + onChangeElectron(e) { const item = e.currentTarget.dataset.book; - console.log(item) const index = this.data.bookList.findIndex(citem => citem.id == item.id) let role = this.data.userInfo != null ? this.data.userInfo.role : null if (role && role == 'Teacher') { // 鏄暀甯� if (e.detail.checked) { // 鐐瑰嚮閫変腑 - //鍟嗗搧鏈夋棤鐢靛瓙涔� - const obj = { - path: '*', - queryType: 'SubProduct', - sort: { - type: 'Desc', - field: 'CreateDate' - }, - paging: { - start: 0, - size: 1 - }, - mainProductId: item.id, - fields: { - bookshelf_pdf: [], - bookshelf_protectedEpub: [], - } - } - const res = await app.MG.store.getProductList(obj) - if (res.datas.length > 0) { - if (!res.datas[0].bookshelf_pdf && !res.datas[0].bookshelf_protectedEpub) { - wx.showToast({ - title: "鏆傛棤鐢靛瓙涔︽枃浠�,璇疯仈绯荤鐞嗗憳!", - icon: 'none', - duration: 1000, - }) - return false; - } - } else { - if (!item.pdf && !item.protectedEpub) { - wx.showToast({ - title: "鏆傛棤鐢靛瓙涔︽枃浠�,璇疯仈绯荤鐞嗗憳!", - icon: 'none', - duration: 1000, - }) - return false; - } - } - - //鐢宠娆℃暟 if (this.data.ebookCount == 0) { wx.showToast({ title: "鎮ㄧ殑鐢靛瓙鏍蜂功鐢宠娆℃暟宸茬敤灏斤紝鑻ヨ缁х画锛岃鑱旂郴绠$悊鍛橈紒", -- Gitblit v1.9.1