| | |
| | | parentName: '', |
| | | parentProductLinkPath: '', |
| | | productLinkPath: '', |
| | | isBuy: false, |
| | | threeLeveData: [], |
| | | source: "", |
| | | showData: '', |
| | |
| | | } |
| | | } |
| | | app.MG.store.getProductDetail(query).then(res => { |
| | | if (res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId)) { |
| | | this.setData({ |
| | | isBuy: true |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | isBuy: false |
| | | }) |
| | | } |
| | | res.datas.cmsDatas[0].datas.forEach((item) => { |
| | | if (this.data.source == 'qrcode') { |
| | | if (item.id == this.data.activeId) { |
| | |
| | | } |
| | | } else { |
| | | if (item.selectType === "video" || item.learnSelectType === "video") { |
| | | if (this.data.storeInfo == 'jsek_digitalCourses') { |
| | | if (this.data.isBuy) { |
| | | if (item.sysType == 'CmsItem') { |
| | | this.data.threeLeveData.push(item) |
| | | } |
| | | } else { |
| | | if (item.sysType == 'CmsItem' && item.freeFile) { |
| | | this.data.threeLeveData.push(item) |
| | | } |
| | | } |
| | | } else { |
| | | if (res.datas.purchasedSaleMethodIdList.includes(item.defaultSaleMethodId) || item.freeFile) { |
| | | this.data.threeLeveData.push(item) |
| | | } |
| | | } |
| | | this.setData({ |
| | | threeLeveData: this.data.threeLeveData |
| | | }) |
| | |
| | | }) |
| | | if (item.selectType == "video" || item.learnSelectType === "video") { |
| | | if (this.data.formPath === "jsek_cloudLearning") { |
| | | let file |
| | | let file = |
| | | 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) |