From 56b70cdad0a96691eaf37e04a79ef5e92b892480 Mon Sep 17 00:00:00 2001 From: yiming <m13691596795@163.com> Date: 星期五, 19 四月 2024 11:14:40 +0800 Subject: [PATCH] bug1 --- pages/bibliographyList/index.js | 95 +++++++++++++++++++++++++++++------------------ 1 files changed, 59 insertions(+), 36 deletions(-) diff --git a/pages/bibliographyList/index.js b/pages/bibliographyList/index.js index af7a83d..7529409 100644 --- a/pages/bibliographyList/index.js +++ b/pages/bibliographyList/index.js @@ -251,6 +251,8 @@ fileType: [], jsek_resource: [], freeFile: [], + bookshelf_freeEpub: [], //epub璇曡鐧惧垎姣� + bookshelf_probationPage: [], //pdf璇曡椤垫暟 ...searchObj }, SysType: 'CmsItem' @@ -265,44 +267,65 @@ }) wx.stopPullDownRefresh() }, + // downloadData(event) { + // this.setData({ + // downloadLoadin: true + // }) + // console.log(111); + // const item = event.currentTarget.dataset.item; + // // console.log(item.datas.freeFile.Value); + // const URL = app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.datas.freeFile.Value + // item.determine = false + // console.log(URL, 'URL'); + // setTimeout(() => { + // if (URL) { + // item.determine = true + // } + // }, 600) + // wx.downloadFile({ + // url: URL, + // success: function (res) { + // const filePath = res.tempFilePath; + // wx.openDocument({ + // filePath: filePath, + // success: function (res) { + // console.log('鎵撳紑鏂囨。鎴愬姛'); + // }, + // fail: function (res) { + // console.log('鎵撳紑鏂囨。澶辫触', res); + // } + // }); + // }, + // fail: function (res) { + // console.log('涓嬭浇鏂囦欢澶辫触', res); + // } + // }); + // setTimeout(() => { + // this.setData({ + // downloadLoadin: false + // }); + // }, 2000); + // }, downloadData(event) { - this.setData({ - downloadLoadin: true - }) - console.log(111); - const item = event.currentTarget.dataset.item; - // console.log(item.datas.freeFile.Value); - const URL = app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.datas.freeFile.Value - item.determine = false - console.log(URL, 'URL'); - setTimeout(() => { - if (URL) { - item.determine = true - } - }, 600) - wx.downloadFile({ - url: URL, - success: function (res) { - const filePath = res.tempFilePath; - wx.openDocument({ - filePath: filePath, - success: function (res) { - console.log('鎵撳紑鏂囨。鎴愬姛'); - }, - fail: function (res) { - console.log('鎵撳紑鏂囨。澶辫触', res); - } - }); - }, - fail: function (res) { - console.log('涓嬭浇鏂囦欢澶辫触', res); - } + + const item = event.currentTarget.dataset.item + console.log(item); + wx.navigateTo({ + url: "/packageBookService/pages/components/webView/index?md5=" + + item.freeFile + + "&fileName=" + + item.name + + "&fileType=" + + item.fileType + "&bookBuy=true" + // "&freePage=" + + // this.data.fileInfo.freePage + + + // + + // "&bookId=" + + // this.data.bookDetail.id, }); - setTimeout(() => { - this.setData({ - downloadLoadin: false - }); - }, 2000); + + }, onSearchSubmit: function (e) { const keyword = e.detail.value; -- Gitblit v1.9.1