From bbba5d26e9e26c910ed337dcb65f462752ee6dce Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期四, 12 九月 2024 09:11:47 +0800 Subject: [PATCH] fenxiang --- pages/digitalTextbooks/digitalTextbooksDetails/index.js | 65 ++++++++++++++++++++------------ 1 files changed, 41 insertions(+), 24 deletions(-) diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/index.js b/pages/digitalTextbooks/digitalTextbooksDetails/index.js index 523ca07..0215786 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() @@ -188,9 +200,8 @@ /** * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� */ - onShareAppMessage() { - - }, + onShareAppMessage() {}, + onShareTimeline() {}, digitalTextbooksDetailsGet(digitalId) { @@ -238,7 +249,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 +527,6 @@ }, onTabClick(e) { - // debugger console.log(e); let tab = e.currentTarget.dataset.tab; @@ -720,14 +730,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 +746,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({ @@ -827,6 +837,10 @@ }, confirmM() { + let currentDate = new Date() + let year = currentDate.getFullYear() + let month = currentDate.getMonth() + 1 + let day = currentDate.getDate() if (this.data.userInfo.fullName) { if (this.data.pictureMd5 == '') { wx.showToast({ @@ -844,8 +858,11 @@ author: this.data.digitalsData.author, ISBN: this.data.digitalsData.isbn, publicationDate: this.data.digitalsData.publicationDate, + publicationDate: this.data.digitalsData.publicationDate, + userName: this.data.userInfo.fullName, userPicture: this.data.pictureMd5, - certificate: this.data.rzzsImg + studyTime: this.data.digitalsData.beginDate + '-' + year + '-' + month + '-' + day, + website: this.data.website } data = { topicIdOrRefCode: 'applyTextbookCertificate', @@ -888,14 +905,14 @@ //璇佷功鏌ョ湅 onClick1() { this.setData({ - images: ['/static/images/certificate/cbzs.jpg'], + images: ['https://jsek.bnuic.com/home/certificate/szjc.jpg'], showIndex: true, visible: true, }) }, onClick2() { this.setData({ - images: ['/static/images/certificate/rzzs.jpg'], + images: ['https://jsek.bnuic.com/home/certificate/jczs.jpg'], showIndex: true, visible: true, }) -- Gitblit v1.9.1