| | |
| | | buyIdList: [], |
| | | buyList: [], |
| | | learnClassData: null, |
| | | isLearnDataBuy: false, |
| | | isLearnDataBuy: true, |
| | | bookDetail: null, |
| | | learnStartTime: 0, |
| | | learnTimeList: [], |
| | | learnTimeData: 0, |
| | | toView: 'activeName', |
| | | promptVisable: false, |
| | | confirmBtn: { |
| | | content: '确定', |
| | | variant: 'base', |
| | | }, |
| | | showMd5: '' |
| | | }, |
| | | // 格式化笔记时间 |
| | | convertTimestamp(timestamp) { |
| | |
| | | } |
| | | this.setData({ |
| | | showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey), |
| | | titleName: items.name |
| | | titleName: items.name, |
| | | selectedId: index |
| | | }) |
| | | this.aliVod(file, this.data.showData) |
| | | } else { |
| | | let file = items.file ? items.file : items.freeFile |
| | | 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 |
| | | showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + file, |
| | | titleName: items.name, |
| | | selectedId: index |
| | | }) |
| | | this.aliVod(items.file, this.data.showData) |
| | | } |
| | | let selectedIndex = index; // 存储选中项的索引 |
| | | console.log(selectedIndex, "selectedIndex") |
| | | this.setData({ |
| | | selectedId: selectedIndex // 设置选中项的索引 |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | wx.showToast({ |
| | | icon: 'none', |
| | | title: '请先返回资源所在图书详情购买视频资源', |
| | | }) |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=jsek_cloudLearning`, |
| | | wx.showModal({ |
| | | title: '温馨提示', |
| | | content: '请先返回资源所在图书详情购买视频资源', |
| | | confirmText: '确定', |
| | | showCancel: false, // 关闭取消按钮 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=${this.data.formPath}`, |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | this.setData({ |
| | | loading: false, |
| | |
| | | appRefCode: app.config.appRefCode |
| | | } |
| | | app.MG.file.getAliVod(query).then((res) => { |
| | | this.setData({ |
| | | showMd5: md5 |
| | | }) |
| | | if (res) { |
| | | if (res && res.data == '') { |
| | | this.setData({ |
| | |
| | | } |
| | | } |
| | | return flag |
| | | }, |
| | | videoEnd() { |
| | | const data = this.data.threeLeveData.find(item => item.id == this.data.activeId) |
| | | if (data.freeFile && (this.data.showDataVod.includes(data.freeFile) || this.data.showMd5 == data.freeFile) && data.protectedFile) |
| | | this.setData({ |
| | | promptVisable: true |
| | | }) |
| | | }, |
| | | // 提示弹窗关闭 |
| | | closePromapDialog() { |
| | | this.setData({ |
| | | promptVisable: false |
| | | }) |
| | | if (this.data.source == 'qrcode') { |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=${this.data.formPath}`, |
| | | }); |
| | | } else { |
| | | wx.navigateBack() |
| | | } |
| | | } |
| | | }) |