From e38c14de9637d22d0a35ae06bede82dcf31b64ec Mon Sep 17 00:00:00 2001 From: YM <479443481@qq.com> Date: 星期二, 10 九月 2024 16:52:58 +0800 Subject: [PATCH] 1 --- pages/digitalTextbooks/digitalTextbooksDetails/index.js | 47 +++++++++++++++++++++++++++++------------------ 1 files changed, 29 insertions(+), 18 deletions(-) diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/index.js b/pages/digitalTextbooks/digitalTextbooksDetails/index.js index 7bef3b4..f664efa 100644 --- a/pages/digitalTextbooks/digitalTextbooksDetails/index.js +++ b/pages/digitalTextbooks/digitalTextbooksDetails/index.js @@ -89,6 +89,18 @@ this.setData({ digitalTextId: options.id }) + const token = wx.getStorageSync(app.config.tokenKey) + if (!token) { + loginInfo(app, (data) => { + if (data) { + this.digitalTextbooksDetailsGet(this.data.digitalTextId) + this.getType() + this.getCertificateList() + } else { + + } + }) + } this.digitalTextbooksDetailsGet(this.data.digitalTextId) this.getType() this.getCertificateList() @@ -238,7 +250,7 @@ isBuy: false }) } - res.datas.publicationDate = moment(res.datas.publicationDate).format('YYYY骞碝M鏈圖D鏃�') + res.datas.publicationDate = moment(res.datas.publicationDate).format('YYYY骞碝M鏈�') if (res.datas.icon == '') { res.datas.icon = '/static/images/default-book-img.png' } @@ -516,7 +528,6 @@ }, onTabClick(e) { - // debugger console.log(e); let tab = e.currentTarget.dataset.tab; @@ -720,14 +731,14 @@ }, onCertificate() { - // if (!this.data.isBuy) { - // wx.showToast({ - // title: "璇峰厛璐拱锛屼綋楠屽畬鏁存湇鍔�", - // icon: "none", - // duration: 1000, - // }); - // return false - // } + if (!this.data.isBuy) { + wx.showToast({ + title: "璇峰厛璐拱锛屼綋楠屽畬鏁存湇鍔�", + icon: "none", + duration: 1000, + }); + return false + } // if (!this.data.isLearn) { // wx.showToast({ // title: "鎮ㄧ殑瀛︿範浠诲姟杩樻湭瀹屾垚锛屾殏涓嶈兘鐢宠璇佷功锛屽姞娌瑰摝锛�", @@ -736,14 +747,14 @@ // }); // return false // } - // if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { - // wx.showToast({ - // title: "鎮ㄧ敵璇风殑璇佷功姝e湪瀹℃牳涓�", - // icon: "none", - // duration: 1000, - // }); - // return false - // } + if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { + wx.showToast({ + title: this.data.isCertificate.state == 'WaitAudit' ? "鎮ㄧ敵璇风殑璇佷功姝e湪瀹℃牳涓�" : this.data.isCertificate.state == 'Normal' ? '鎮ㄥ凡鐢宠璇佷功' : '', + icon: "none", + duration: 1000, + }); + return false + } var page = getCurrentPages().pop(); // 鑾峰彇褰撳墠椤甸潰瀹炰緥 page.setData({ -- Gitblit v1.9.1