| | |
| | | if (this.data.storeInfo) { |
| | | query.storeInfo = this.data.storeInfo |
| | | } |
| | | app.MG.store.getProductDetail(query).then((res) => { |
| | | app.MG.store.getProductDetail(query).then(async (res) => { |
| | | wx.hideLoading(); |
| | | const list = res.datas.cmsDatas[0]?.datas |
| | | if (this.data.source == 'qrcode') { |
| | |
| | | this.setData({ |
| | | isBuy: res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId) |
| | | }) |
| | | list?.forEach(async (item) => { |
| | | for (const item of list) { |
| | | if (this.data.storeInfo == 'jsek_digitalCourses') { |
| | | if (this.data.isBuy) { |
| | | if (this.data.productLinkPath == item.productLinkPath) { |
| | |
| | | const isBuyCms = await app.MG.file.checkCmsItem({ |
| | | cmsItemId: Number(item.id) |
| | | }) |
| | | if (isBuyCms && this.data.productLinkPath == item.productLinkPath) { |
| | | this.data.threeLeveData(item) |
| | | item.isBuyCms = isBuyCms |
| | | if (isBuyCms) { |
| | | this.data.threeLeveData.push(item) |
| | | } else { |
| | | if (item.freeFile && this.data.productLinkPath == item.productLinkPath) { |
| | | this.data.threeLeveData(item) |
| | | if (item.freeFile) { |
| | | this.data.threeLeveData.push(item) |
| | | } else { |
| | | wx.showModal({ |
| | | icon: 'error', |
| | | title: '温馨提示', |
| | | content: '请购买题库,即将返回购买页', |
| | | content: '请购买资源,即将返回购买页', |
| | | confirmText: '确定', |
| | | showCancel: false, // 关闭取消按钮 |
| | | success: (cres) => { |
| | |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | if (this.data.threeLeveData.length > 0) { |
| | | let item = this.data.threeLeveData[0] |
| | | this.handleTeachData(item) |
| | |
| | | let that = this |
| | | //图片 |
| | | if (item.selectType == 'picture' || item.learnSelectType == 'picture') { |
| | | const isBuy = this.cmsItemIsBuy(item) |
| | | const isBuy = item.isBuyCms |
| | | let file = isBuy ? item.protectedFile || item.file : item.freeFile |
| | | this.setData({ |
| | | showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + file, |
| | |
| | | } |
| | | //文档等 |
| | | if (item.selectType == 'document' || item.selectType == 'pdf' || item.learnSelectType == 'document' || item.learnSelectType == 'pdf') { |
| | | const isBuy = this.cmsItemIsBuy(item) |
| | | const isBuy = item.isBuyCms |
| | | let md5 = isBuy ? item.protectedFile || item.file || item.freeFile : item.freeFile |
| | | if (item.fileMap[md5]?.extension == 'xlsx' || item.fileMap[md5]?.extension == 'xls') { |
| | | this.setData({ |