From c2cd778fd3f40a75df483758bb2f1fe1dedc7eef Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期五, 26 四月 2024 09:49:25 +0800 Subject: [PATCH] 资源购买页请求慢优化 --- packageDomain/pages/resourceDetails/myVideo/index.js | 23 ++++++++++++++++++----- 1 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packageDomain/pages/resourceDetails/myVideo/index.js b/packageDomain/pages/resourceDetails/myVideo/index.js index c972ff8..63118dd 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.js +++ b/packageDomain/pages/resourceDetails/myVideo/index.js @@ -34,13 +34,13 @@ style: 'height: 248rpx', submitType: "new", // 鏂板缓 or 缂栬緫 noteId: '', - videoChange: true, startTime: "", //杩涘叆椤甸潰褰撳墠鏃堕棿 pauseTime: 0, //鏆傚仠鏃堕棿 formPath: '', loading: true, - hidden: true + hidden: true, + videoError: false }, // 鏍煎紡鍖栫瑪璁版椂闂� convertTimestamp(timestamp) { @@ -59,6 +59,9 @@ */ onLoad(options) { + wx.setNavigationBarTitle({ + title: '璧勬簮璇︽儏-瑙嗛' + }); const systInfo = wx.getSystemInfoSync(); const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅 const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴� @@ -70,12 +73,16 @@ bookId: options.bookId, bookName: options.bookName, cmsId: options.cmsId, - parentName: options.parentName, parentProductLinkPath: options.parentProductLinkPath, productLinkPath: options.productLinkPath, formPath: options.formPath, flag: false }) + if (options.parentName !== "鏁欏璧勬簮" && options.parentName !== "浜戝涔�") { + this.setData({ + parentName: options.parentName, + }) + } console.log(options, 'options'); this.resourceDetailsData() this.getNoteList() @@ -239,7 +246,7 @@ }) } else { this.setData({ - showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.file, + showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile, titleName: items.name }) } @@ -289,7 +296,7 @@ }) } else { this.setData({ - showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file + showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile, }) } @@ -555,5 +562,11 @@ }, videoErrorCallback(e) { console.log(e); + }, + videoError: function (e) { + console.log('瑙嗛鍔犺浇澶辫触', e); + this.setData({ + videoError: true + }); } }) \ No newline at end of file -- Gitblit v1.9.1