| | |
| | | loading: false, |
| | | hidden: true, |
| | | videoError: false, |
| | | videoLoading: false |
| | | videoLoading: false, |
| | | progress: 0, |
| | | playerList: [] |
| | | }, |
| | | // 格式化笔记时间 |
| | | convertTimestamp(timestamp) { |
| | |
| | | formPath: options.formPath, |
| | | flag: false |
| | | }) |
| | | console.log(this.data.storeInfo,13) |
| | | console.log(this.data.storeInfo, 13) |
| | | if (options.parentName !== "教学资源" && options.parentName !== "云学习") { |
| | | this.setData({ |
| | | parentName: options.parentName, |
| | |
| | | let duration = this.data.pauseTime - this.data.startTime |
| | | this.count(duration) |
| | | } |
| | | this.setPlayerList() |
| | | }, |
| | | |
| | | /** |
| | |
| | | let duration = this.data.pauseTime - this.data.startTime |
| | | this.count(duration) |
| | | } |
| | | this.setPlayerList() |
| | | }, |
| | | count(timeStr) { |
| | | const data = { |
| | |
| | | |
| | | }, |
| | | showDialog(e) { |
| | | |
| | | this.setData({ |
| | | dialogKey: true, |
| | | textvalue: '', |
| | |
| | | app.MG.store.getProductDetail(query).then(res => { |
| | | console.log(this.data.productLinkPath, 345) |
| | | res.datas.cmsDatas[0].datas.forEach((item) => { |
| | | console.log(item, 222) |
| | | if (item.selectType === "video" || item.learnSelectType === "video") { |
| | | this.data.threeLeveData.push(item) |
| | | this.setData({ |
| | |
| | | }) |
| | | this.data.threeLeveData.forEach((items, index) => { // 修改此处添加index参数 |
| | | if (this.data.productLinkPath == items.productLinkPath) { |
| | | console.log(items, 5678) |
| | | if (this.data.formPath === "jsek_cloudLearning") { |
| | | let file |
| | | items.protectedFile ? file = items.protectedFile : file = items.freeFile |
| | |
| | | loading: false, |
| | | hidden: false |
| | | }) |
| | | console.log('地址', this.data.showData); |
| | | }) |
| | | }, |
| | | onVideo(e) { |
| | | this.setPlayerList() |
| | | const item = e.currentTarget.dataset.item |
| | | this.setData({ |
| | | videoLoaidng: true, |
| | | selectedId: e.currentTarget.dataset.index, |
| | | activeId: item.id, |
| | | // showData: '', |
| | | titleName: item.name |
| | | }) |
| | | if (item.selectType == "video" || item.learnSelectType === "video") { |
| | | if (this.data.formPath === "jsek_cloudLearning") { |
| | | |
| | | let file |
| | | item.protectedFile ? file = item.protectedFile : file = item.freeFile |
| | | item.protectedFile || item.file ? file = item.protectedFile || item.file : file = item.freeFile |
| | | this.setData({ |
| | | showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey) |
| | | }) |
| | | console.log(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, |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | timeUpdate(e) { |
| | | let { |
| | | currentTime, |
| | | duration |
| | | } = e.detail |
| | | this.setData({ |
| | | progress: ((currentTime / duration) * 100).toFixed(2) |
| | | }) |
| | | }, |
| | | //获取视频学习 |
| | | getPlayerList() { |
| | | app.MG.identity |
| | | .getUserKey({ |
| | | domain: 'videoPlayer', |
| | | keys: [this.data.bookId] |
| | | }) |
| | | .then((res) => { |
| | | if (res.length > 0) { |
| | | this.setData({ |
| | | playerList: JSON.parse(res[0].value) |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | setPlayerList() { |
| | | let that = this |
| | | if (that.data.progress > 0) { |
| | | let index = that.data.playerList.findIndex((itemData) => itemData.cmsItemId == that.data.activeId) |
| | | if (index > -1) { |
| | | that.data.playerList.splice(index, 1) |
| | | } |
| | | that.data.playerList.push({ |
| | | cmsItemId: that.data.activeId, |
| | | progress: that.data.progress |
| | | }) |
| | | app.MG.identity |
| | | .setUserKey({ |
| | | setKeyRequests: [{ |
| | | domain: 'videoPlayer', |
| | | key: that.data.bookId, |
| | | value: JSON.stringify(that.data.playerList) |
| | | }] |
| | | }) |
| | | .then((res) => {}) |
| | | } |
| | | }, |
| | | |
| | | |
| | | getProductUserSubmitTopicGet() { |
| | | app.MG.ugc.getProductUserSubmitTopic({ |
| | |
| | | } else if (this.data.submitType == 'edit') { |
| | | this.updateNote() |
| | | } |
| | | console.log(this.data.textvalue); |
| | | console.log(this.data.titleName); |
| | | this.setData({ |
| | | dialogKey: false |
| | | }); |
| | |
| | | // item.deleteHover = false |
| | | item.createDate = this.convertTimestamp(item.createDate) |
| | | }) |
| | | console.log(res, 'res'); |
| | | this.setData({ |
| | | "pageCount.total": res.totalSize, |
| | | noteList: res.datas, |
| | |
| | | console.log(e); |
| | | }, |
| | | videoError: function (e) { |
| | | console.log('视频加载失败', e); |
| | | this.setData({ |
| | | videoError: true |
| | | }); |