From 02eb8d0829a78a30bdb6ce25f93858dfdd61c4dc Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期六, 07 九月 2024 19:06:14 +0800 Subject: [PATCH] bug --- packageBookService/pages/bookServices/detail/index.js | 32 ++++++++++++++++++++++---------- 1 files changed, 22 insertions(+), 10 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index 8e0ddd0..e8b3f6f 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -1,6 +1,7 @@ // pages/bookServices/detail/index.js import Toast from "tdesign-miniprogram/toast"; import tool from "../../../../assets/js/toolClass"; +import moment from 'moment' import { loginInfo } from "../../../../assets/js/login"; @@ -192,20 +193,24 @@ bookId: options.id + "", barHeight: systInfo.statusBarHeight, navBarHeight: navBarHeight, - }); - this.setData({ options: { id: options.id, - name: options.name, + name: decodeURI(options.name), storeInfo: options.storeInfo, }, }); wx.setNavigationBarTitle({ - title: options.name, + title: decodeURI(options.name), }) + let token = wx.getStorageSync(app.config.tokenKey) + if (!token) { + loginInfo(app, (data) => { + if (data) {} else {} + }) + } this.getBookInfo(options.id); // this.getResourceClass(); // 鑾峰彇璧勬簮鎵�灞炲垎绫� - const token = wx.getStorageSync(app.config.tokenKey); + token = wx.getStorageSync(app.config.tokenKey) if (token) { this.getShoppingCartProductGet(); this.getApplyInfo(options.id); @@ -219,6 +224,15 @@ // 鑾峰彇鐢宠娆℃暟 this.getSelectPaperBookCount(); this.getSelectBookCount(); + } + if (options.tabValue) { + this.setData({ + tabValue: options.tabValue, + }); + const checkData = this.data.cmsDatas.find( + (item) => item.refCode == options.tabValue + ); + this.getResourceDataList(checkData) } }, @@ -465,9 +479,7 @@ } } this.setData({ - "bookDetail.publicationDate": this.formatDate( - this.data.bookDetail.publicationDate - ), + "bookDetail.publicationDate": moment(this.data.bookDetail.publicationDate).format("YYYY骞碝M鏈�"), "bookDetail.price": this.numFormat(this.data.bookDetail.price), "bookDetail.oldPrice": this.numFormat(this.data.bookDetail.oldPrice), "bookDetail.paperPrice": this.numFormat( @@ -703,7 +715,7 @@ link } = e.currentTarget.dataset; wx.navigateTo({ - url: `/packageBookService/pages/bookServices/webpage/index?url=${link}`, + url: `/packageBookService/pages/bookServices/linkPage/index?path=${link}`, }); }, // tag鍒囨崲 @@ -719,7 +731,7 @@ e.detail.label == "浜戞祴璇�" ) { const checkData = this.data.cmsDatas.find( - (item) => item.refCode == e.detail.value + (item) => item.refCode == this.data.tabValue ); if (!this.data.resourceClassList.length) this.getResourceClass() if (checkData) { -- Gitblit v1.9.1