From a9c680d3fcde05afbbca0bb03f95e75027608b22 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期六, 07 九月 2024 15:47:59 +0800 Subject: [PATCH] btn --- packageDomain/pages/resourceDetails/myVideo/index.js | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 51 insertions(+), 4 deletions(-) diff --git a/packageDomain/pages/resourceDetails/myVideo/index.js b/packageDomain/pages/resourceDetails/myVideo/index.js index d08e26d..94d8d8d 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.js +++ b/packageDomain/pages/resourceDetails/myVideo/index.js @@ -1,6 +1,8 @@ // pages/resourceDetails/index.js const app = getApp() - +import { + loginInfo +} from '../../../../assets/js/login'; Page({ /** @@ -25,6 +27,7 @@ productLinkPath: '', threeLeveData: [], showData: '', + showDataVod: '', src: '', selectedId: null, topicId: '', @@ -44,7 +47,8 @@ videoError: false, videoLoading: false, progress: 0, - playerList: [] + playerList: [], + videoLoaidng: true }, // 鏍煎紡鍖栫瑪璁版椂闂� convertTimestamp(timestamp) { @@ -86,8 +90,18 @@ parentName: options.parentName, }) } - this.resourceDetailsData() - + const token = wx.getStorageSync(app.config.tokenKey) + if (!token) { + loginInfo(app, (data) => { + if (data) { + this.resourceDetailsData() + } else { + this.resourceDetailsData() + } + }) + } else { + this.resourceDetailsData() + } }, /** @@ -254,11 +268,14 @@ showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey), titleName: items.name }) + this.aliVod(file, this.data.showData) + } else { this.setData({ showData: items.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.freeFile, titleName: items.name }) + this.aliVod(items.file, this.data.showData) } let selectedIndex = index; // 瀛樺偍閫変腑椤圭殑绱㈠紩 this.setData({ @@ -289,15 +306,44 @@ this.setData({ showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey) }) + this.aliVod(file, this.data.showData) } else { this.setData({ showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile, }) + this.aliVod(item.file, this.data.showData) } } }, + aliVod(md5, currentVideo) { + let query = { + md5: md5, + appRefCode: app.config.appRefCode + } + app.MG.file.getAliVod(query).then((res) => { + if (res) { + if (res && res.data == '') { + this.setData({ + showDataVod: currentVideo, + }) + } else { + this.setData({ + showDataVod: res, + }) + } + } else if (currentVideo) { + this.setData({ + showDataVod: currentVideo, + }) + } else { + return ElMessage.error('鏃犳硶鑾峰彇瑙嗛璧勬簮') + } + }) + }, + timeUpdate(e) { + console.log(2); let { currentTime, duration @@ -597,6 +643,7 @@ }); }, loadedmetadata(e) { + console.log(1); this.setData({ videoLoaidng: false }) -- Gitblit v1.9.1