From 02eb8d0829a78a30bdb6ce25f93858dfdd61c4dc Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期六, 07 九月 2024 19:06:14 +0800 Subject: [PATCH] bug --- pages/bookExhibitionDetails/index.js | 51 +++++++++++++++++++++++++-------------------------- 1 files changed, 25 insertions(+), 26 deletions(-) diff --git a/pages/bookExhibitionDetails/index.js b/pages/bookExhibitionDetails/index.js index 21ac2b4..11f9121 100644 --- a/pages/bookExhibitionDetails/index.js +++ b/pages/bookExhibitionDetails/index.js @@ -1,5 +1,8 @@ // pages/bookExhibitionDetails/index.js const app = getApp() +import { + loginInfo +} from '../../assets/js/login'; Page({ /** @@ -34,19 +37,30 @@ navBarHeight: navBarHeight, barHeight: systInfo.statusBarHeight, }) - console.log(); - - this.setData({ bookName: options.bookName, subtitleName: options.subtitleName, passId: options.id }) + const token = wx.getStorageSync(app.config.tokenKey) + if (!token) { + loginInfo(app, (data) => { + if (data) { + this.bookExhibitionGet(this.data.passId) + this.getBookExhibitionDetails() + } else { + this.bookExhibitionGet(this.data.passId) + this.getBookExhibitionDetails() + } + }) - const passId = options.id - - this.bookExhibitionGet(passId) - this.getBookExhibitionDetails() + } else { + this.bookExhibitionGet(this.data.passId) + this.getBookExhibitionDetails() + } + wx.setNavigationBarTitle({ + title: this.data.subtitleName + }); }, /** @@ -103,10 +117,6 @@ loading: true, hidden: true, }) - wx.showLoading({ - title: '鍔犺浇涓�...', - }) - console.log(passId, 8988989); app.MG.store.getProductDetail({ storeInfo: 'jsek_bookFair', //鍟嗗搧搴� path: '*', //璺緞 @@ -126,18 +136,15 @@ bookBeginDate: res.datas.beginDate, bookCreator: res.datas.datas.Creator.Name, bookContent: res.datas.content, - bookImage: res.datas.icon - }); - wx.hideLoading() - this.setData({ + bookImage: res.datas.icon, loading: false, hidden: false, - }) + }); + console.log(this.data.loading, 123) }) }, //涔﹀睍璇︽儏鎺ュ彛 getBookExhibitionDetails() { - app.MG.store.getProductList({ path: '*', storeInfo: 'jsek_bookFair', @@ -155,13 +162,9 @@ Creator: [] } }).then(res => { - this.setData({ bookExhibitionList: res.datas, - totalSize: res.total - }) - - this.setData({ + totalSize: res.total, loading: false, hidden: false, }) @@ -179,10 +182,7 @@ }, // 瑙﹀簳鍑芥暟 onReachBottom() { - console.log(this.data.bookExhibitionList.length); - console.log(this.data.totalSize); if (this.data.bookExhibitionList.length < this.data.totalSize) { - console.log(11111); this.setData({ isMore: true, start: this.data.start + 1 @@ -196,7 +196,6 @@ this.setData({ isMore: false }) - console.log('300'); }, 300) } }, -- Gitblit v1.9.1