| | |
| | | if (token) { |
| | | const item = e.currentTarget.dataset.item; |
| | | const parent = e.currentTarget.dataset.parent; |
| | | console.log('item', item); |
| | | const parentProductLinkPath = parent ? |
| | | parent.productLinkPath : |
| | | wx.getStorageSync("teachResourcesPath"); |
| | | const parentName = parent ? parent.name : "教学资源"; |
| | | let url; |
| | | if (item.selectType == 'zip') { |
| | | if (this.properties.applyState == 'Normal') { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请前往PC端下载', |
| | | }) |
| | | } else { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请先申请下载', |
| | | }) |
| | | } |
| | | } |
| | | if (this.properties.isShowCheck && this.resourceIsBuy(item)) { |
| | | return false; |
| | | } |
| | |
| | | title: "暂未开始销售,请联系管理员", |
| | | }); |
| | | } |
| | | if (this.properties.tab == "jsek_teachingResources" && item.fileMap) { |
| | | if (this.properties.tab == "jsek_teachingResources" && (item.file || item.freeFile)) { |
| | | let file = item.fileMap[item.file] ? item.fileMap[item.file] : item.fileMap[item.freeFile] |
| | | debugger |
| | | if (file && file.protectType !== "Public") { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "资源不可用,请联系管理员", |
| | | }); |
| | | } |
| | | } else { |
| | | } else if ((this.properties.tab == "jsek_teachingResources" || this.properties.tab == "jsek_cloudLearning") && (!item.file && !item.freeFile && !item.protectedFile)) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '暂无资源', |
| | |
| | | } |
| | | if (item.selectType == "document") { |
| | | // freeFile |
| | | if (item.selectType == "document") { |
| | | item.selectType = "pptx"; |
| | | } |
| | | // if (item.selectType == "document") { |
| | | // item.selectType = "pptx"; |
| | | // } |
| | | const fileLink = item.file ? |
| | | app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.file : |
| | | app.config.requestCtx + |
| | |
| | | item.freeFile; |
| | | console.log(fileLink, "fileLink"); |
| | | //提示加载中 |
| | | util.showLoading(); |
| | | // 单次下载允许的最大文件为 200MB |
| | | wx.downloadFile({ |
| | | url: fileLink, |