| | |
| | | const parentName = parent ? parent.name : "教学资源"; |
| | | // 资源购买页面(只展示未购买资源) 点击不跳转 |
| | | if (this.properties.isShowCheck) return false; |
| | | if (item.selectType == "webpage") { |
| | | if (item.selectType == "webpage" || item.learnSelectType == "webpage") { |
| | | // 网页类型跳转到网址复制页,因为url传参不能传 带参数的网络地址,所以此处要把网络地址里的传参摘出来,放到url里 |
| | | let urlData = '' |
| | | const flags = item.jsek_link.indexOf("?") |
| | |
| | | title: '暂无资源', |
| | | }) |
| | | } |
| | | if (item.selectType == 'zip') { |
| | | if (item.selectType == 'zip' || item.learnSelectType == 'zip') { |
| | | // if (this.properties.applyState == 'Normal') { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | |
| | | let file = item.fileMap[item.file] ? item.fileMap[item.file] : item.fileMap[item.freeFile] |
| | | if (file && file.protectType !== "Public") { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | icon: "none", |
| | | title: "资源不可用,请联系管理员", |
| | | }); |
| | | } |
| | | } |
| | | if (this.properties.tab == "jsek_cloudLearning") { |
| | | |
| | | // 1.找出所有父级目录和本身(有销售方式) 和 云学习本身(有销售方式) 放到一个数组 为空则暂未开放销售 |
| | | let learn = [] |
| | | if (this.properties.isCloundHaveSaleMethod) { |
| | |
| | | learn.push(this.properties.learnMenu) |
| | | } else { |
| | | // 1.2 云学习无销售方式,将父级目录和本身加入数组 |
| | | const learn = this.handleTreeData(this.properties.learnList).filter( |
| | | learn = this.handleTreeData(this.properties.learnList).filter( |
| | | (citem) => citem.saleMethod && |
| | | citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal') && |
| | | new Date(citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal').EndDate).getTime() >= new Date().getTime() && |
| | |
| | | icon: 'error', |
| | | title: '请先购买该资源', |
| | | }) |
| | | if (item.protectedFile || item.freeFile) { |
| | | let file = item.fileMap[item.protectedFile] ? item.fileMap[item.protectedFile] : item.fileMap[item.freeFile] |
| | | if (file && file.protectType !== "Public") { |
| | | return wx.showToast({ |
| | | icon: 'none', |
| | | title: "资源不可用,请联系管理员", |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | let url; |
| | | if (item.selectType == "video" || item.learnSelectType == "video") { |
| | |
| | | ) { |
| | | url = "/packageDomain/pages/resourceDetails/myAudio/index"; |
| | | } |
| | | if (item.selectType == "picture" || item.selectType == 'document' || item.selectType == 'pdf') { |
| | | if (item.selectType == "picture" || item.selectType == 'document' || item.selectType == 'pdf' || item.learnSelectType == "picture" || item.learnSelectType == 'document' || item.learnSelectType == 'pdf') { |
| | | url = "/packageDomain/pages/resourceDetails/document/index"; |
| | | } |
| | | wx.navigateTo({ |
| | |
| | | }); |
| | | if (shoppingCartGetId.includes(saleMethodId)) { |
| | | wx.showToast({ |
| | | icon: "error", |
| | | icon: "success", |
| | | title: "已添加", |
| | | }); |
| | | this.setData({ |