From 02eb8d0829a78a30bdb6ce25f93858dfdd61c4dc Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期六, 07 九月 2024 19:06:14 +0800 Subject: [PATCH] bug --- pages/digitalCourses/digitalCoursesDetails/index.js | 29 +++++++++++++++++++++-------- 1 files changed, 21 insertions(+), 8 deletions(-) diff --git a/pages/digitalCourses/digitalCoursesDetails/index.js b/pages/digitalCourses/digitalCoursesDetails/index.js index b9528d1..594d290 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.js +++ b/pages/digitalCourses/digitalCoursesDetails/index.js @@ -85,6 +85,7 @@ closeBtn: false, deleteBtn: false, bookId: '', + bookPath: '', playerList: [], worksInfo: [], isCertificate: {}, @@ -154,9 +155,11 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { + let parentPath = options.path.split('\\'); + parentPath.pop(); this.setData({ bookId: options.id, - userName: wx.getStorageSync(app.config.tokenKey) + bookPath: parentPath.join('\\') }) const token = wx.getStorageSync(app.config.tokenKey) if (!token) { @@ -171,9 +174,6 @@ this.digitalCoursesDetailsGet(options.id) this.getPlayerList() this.getType() - this.setData({ - userName: JSON.parse(wx.getStorageSync(app.config.userInfoKey)).name - }) }, /** @@ -278,6 +278,7 @@ } } app.MG.store.getProductDetail(query).then(async res => { + console.log('淇℃伅', res); if (res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId)) { this.setData({ isBuy: true @@ -300,7 +301,7 @@ } res.datas.publicationDate = moment(res.datas.publicationDate).format('YYYY骞碝M鏈�') res.datas.price = res.datas.price.toFixed(2) - + res.datas.oldPrice = res.datas.oldPrice.toFixed(2) wx.setNavigationBarTitle({ title: res.datas.name, }) @@ -324,9 +325,16 @@ } }) } - this.getAboutBook(res.datas.productLinkInfo[res.datas.productLinkInfo.length - 1].LinkPath) + if (this.data.bookPath) { + this.getAboutBook(this.data.bookPath) + } else { + this.getAboutBook(res.datas.productLinkInfo[res.datas.productLinkInfo.length - 1].LinkPath) + } this.getCertificateList() - res.datas.content = res.datas.content && res.datas.content.replace('../', app.config.requestCtx + '/') + res.datas.content = res.datas.content && res.datas.content.replace('../', app.config.requestCtx + '/').replace( + /\<img/gi, + '<img style="max-width:100%;height:auto;display:block;margin-top:0;margin-bottom:0;"' + ) this.setData({ lecturerList: lecturer, digitalsData: res.datas, @@ -679,6 +687,12 @@ }); }, + onCorrelationBook(e) { + const item = e.currentTarget.dataset.item; + this.digitalCoursesDetailsGet(item.id) + this.getPlayerList() + }, + // 鑾峰彇鐩稿叧璇剧▼ getAboutBook(path) { let query = { @@ -875,7 +889,6 @@ width: that.data.imageWidth, height: that.data.imageHeight, element: 'myCanvas', - background: '#f0f0f0', progress(percent) {}, finish(url) { console.log("鐢熸垚鐨勫浘鐗囧湴鍧�", url) -- Gitblit v1.9.1