From e3fe8b0782e38f760df9b09a52b09d4282e3fa66 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期三, 03 四月 2024 15:50:20 +0800 Subject: [PATCH] ys1 --- packageBookService/pages/components/webView/index.js | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packageBookService/pages/components/webView/index.js b/packageBookService/pages/components/webView/index.js index 4ee82de..48d319c 100644 --- a/packageBookService/pages/components/webView/index.js +++ b/packageBookService/pages/components/webView/index.js @@ -20,6 +20,7 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { + console.log(options) if (options && options.link) { this.setData({ src: decodeURIComponent(options.link), @@ -53,7 +54,7 @@ let that = this; var url = ""; if (data.fileType == 'epub') { - if (data.bookBuy) { + if (data.bookBuy == "true") { url = app.config.epubUrl + "?md5=" + data.md5 + @@ -74,29 +75,29 @@ "&token=" + wx.getStorageSync(app.config.tokenKey) + "&recordLocation=" + - this.data.currentPage + "&freeEpubPage=" + data.freePage + that.data.currentPage + "&freeEpubPage=" + data.freePage } - this.setData({ + that.setData({ src: url, skeletonLoding: false, }) } else { - this.setData({ + that.setData({ navigationBarTitleText: data.fileName }) app.MG.file.getPdfInfo({ md5: data.md5 }).then((res) => { - let pageCount = data.bookBuy ? res.totalPages : Number(data.freePage) + let pageCount = data.bookBuy == "true" ? res.totalPages : Number(data.freePage) + console.log(pageCount, "connt") if (pageCount) { let list = []; - for (let i = 0; i < pageCount; i++) { const src = app.config.requestCtx + '/file/GetPdfPageImage?md5=' + data.md5 + '&index=' + (i + 1) + '&dpi=300' list.push(src) } console.log(list) - this.setData({ + that.setData({ pdfList: list, skeletonLoding: false, }) @@ -192,7 +193,7 @@ this.setData({ pauseTime: Date.now() }) - if (wx.getStorageSync(app.config.tokenKey) && epubObj.bookBuy) { + if (wx.getStorageSync(app.config.tokenKey) && this.data.epubObj.bookBuy) { let duration = this.data.pauseTime - this.data.startTime this.count(duration) } @@ -205,7 +206,7 @@ this.setData({ pauseTime: Date.now() }) - if (wx.getStorageSync(app.config.tokenKey) && epubObj.bookBuy) { + if (wx.getStorageSync(app.config.tokenKey) && this.data.epubObj.bookBuy == 'true') { let duration = this.data.pauseTime - this.data.startTime this.count(duration) } @@ -220,8 +221,8 @@ sysType: 'App' } //闃呰鍟嗗搧鐨刬d - if (epubObj.bookId) { - data.productId = epubObj.bookId + if (this.data.epubObj.bookId) { + data.productId = this.data.epubObj.bookId } //闃呰璧勬簮鐨刬d // if (product.cmsItemId) { -- Gitblit v1.9.1