| | |
| | | }, |
| | | fields: {}, |
| | | }; |
| | | if (this.data.storeInfo) query['storeInfo'] = this.data.storeInfo |
| | | app.MG.store.getProductDetail(query).then(async (res) => { |
| | | this.setData({ |
| | | bookDetail: res.datas, |
| | | buyIdList: res.datas.purchasedSaleMethodIdList, |
| | | learnClassData: res.datas.cmsDatas[0].datas.length > 0 ? res.datas.cmsDatas[0].datas.find(item => item.refCode == "jsek_cloudLearning") : null |
| | | }) |
| | | try { |
| | | this.setData({ |
| | | bookDetail: res.datas, |
| | | buyIdList: res.datas.purchasedSaleMethodIdList, |
| | | learnClassData: res.datas.cmsDatas[0].datas.length > 0 ? res.datas.cmsDatas[0].datas.find(item => item.refCode == "jsek_cloudLearning") : null |
| | | }) |
| | | } catch (error) {} |
| | | if (this.data.learnClassData) { |
| | | this.getResourceDataList(this.data.learnClassData) |
| | | } else { |
| | | this.resourceDetailsData() |
| | | } |
| | | }); |
| | | }, |
| | |
| | | const buyList = res.datas.cmsDatas[0].datas.filter(item => item.saleMethod.length && this.data.buyIdList.includes(item.saleMethod.find(citem => citem.SaleType == 'Normal').Id)) |
| | | if (this.data.learnClassData && this.data.learnClassData.saleMethod.length) { |
| | | const learnSaleMethod = this.data.learnClassData.saleMethod.find(citem => citem.SaleType == 'Normal') |
| | | if (this.data.buyIdList.includes(learnSaleMethod.Id)) buyList.push(learnClassData) |
| | | if (this.data.buyIdList.includes(learnSaleMethod.Id)) buyList.push(this.data.learnClassData) |
| | | } |
| | | this.setData({ |
| | | buyList: buyList |
| | |
| | | this.setData({ |
| | | isBuy: res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId) |
| | | }) |
| | | console.log(0, res.datas.cmsDatas[0].datas); |
| | | res.datas.cmsDatas[0].datas.forEach((item) => { |
| | | if (this.data.source == 'qrcode') { |
| | | if (item.id == this.data.activeId) { |
| | |
| | | if (new Date().getTime() > new Date(itemSaleMethod.EndDate).getTime()) { |
| | | this.data.threeLeveData.push(item) |
| | | } |
| | | // 没买且只有试读资源 |
| | | if (!item.file && item.freeFile) this.data.threeLeveData.push(item) |
| | | } |
| | | } |
| | | } |
| | |
| | | videoLoading: false, |
| | | }) |
| | | } else { |
| | | return ElMessage.error('无法获取视频资源') |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '无法获取视频资源', |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | currentTime, |
| | | duration |
| | | } = e.detail |
| | | |
| | | this.setData({ |
| | | progress: ((currentTime / duration) * 100).toFixed(2) |
| | | }) |
| | | console.log('进度', e); |
| | | }, |
| | | //获取视频学习 |
| | | getPlayerList() { |