From 81c23f9c2f5bdfbe962d0b19a5a80ea7c12f043d Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期三, 10 七月 2024 17:39:02 +0800 Subject: [PATCH] 二维码 --- pages/index/bookDetail.js | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/pages/index/bookDetail.js b/pages/index/bookDetail.js index ac1a9b6..a24a4a1 100644 --- a/pages/index/bookDetail.js +++ b/pages/index/bookDetail.js @@ -1,5 +1,8 @@ // pages/index/bookDetail.js const app = getApp() +import { + loginInfo +} from '../../assets/js/login'; Page({ /** @@ -13,12 +16,28 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - if (options.scene) { - this.setData({ - refcode: options.scene, + const token = wx.getStorageSync(app.config.tokenKey) + if (!token) { + loginInfo(app, (data) => { + // 濡傛灉涓嶆槸绗竴娆$櫥褰曪紝浼氭墽琛屽洖璋� + if (data) { + if (options.scene) { + this.setData({ + refcode: options.scene, + }) + this.getBookList() + } + } }) - this.getBookList() + } else { + if (options.scene) { + this.setData({ + refcode: options.scene, + }) + this.getBookList() + } } + }, /** @@ -29,7 +48,7 @@ }, getBookList() { const obj = { - storeInfo: app.config.jslx, + // storeInfo: app.config.jslx, path: "*", queryType: '*', coverSize: { @@ -52,7 +71,7 @@ console.log(res.datas, '鍥句功淇℃伅') let book = res.datas[0] wx.redirectTo({ - url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}&storeInfo=${app.config.jslx}`, + url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, }); }) }, -- Gitblit v1.9.1