| | |
| | | type: Array, |
| | | value: [], |
| | | }, |
| | | isBuy: { |
| | | type: Boolean, |
| | | value: false, |
| | | }, |
| | | }, |
| | | data: { |
| | | sonPurchaseSaleMethodId: "", |
| | |
| | | shoppingCart: true, |
| | | stop: false, |
| | | cart: true, |
| | | canExecute: true |
| | | canExecute: true, |
| | | isBuy: false, |
| | | }, |
| | | ready() {}, |
| | | |
| | | onLoad() { |
| | | this.setData({ |
| | | sonPurchaseSaleMethodId: [], |
| | | isBuy: this.properties.isBuy |
| | | }); |
| | | }, |
| | | methods: { |
| | |
| | | if (token) { |
| | | const item = e.currentTarget.dataset.item; |
| | | const parent = e.currentTarget.dataset.parent; |
| | | console.log('item', item); |
| | | const isTry = e.currentTarget.dataset.istry; |
| | | 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 (!isTry && !this.data.isBuy) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请先购买该课程', |
| | | }) |
| | | } |
| | | if (item.selectType == "webpage" || item.learnSelectType == "webpage") { |
| | | // 网页类型跳转到网址复制页,因为url传参不能传 带参数的网络地址,所以此处要把网络地址里的传参摘出来,放到url里 |
| | | let urlData = '' |
| | | const flags = item.jsek_link.indexOf("?") |
| | | if (flags > -1) { |
| | | urlData = item.jsek_link.slice(flags + 1, item.jsek_link.length) |
| | | } |
| | | url = '/packageBookService/pages/bookServices/linkPage/index' |
| | | return wx.navigateTo({ |
| | | url: urlData ? url + `?path=${item.jsek_link.slice(0,flags)}` + '&' + urlData : url + `?path=${item.jsek_link}` |
| | | }) |
| | | } |
| | | if (item.selectType == 'zip' || item.learnSelectType == 'zip') { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请前往PC端下载', |
| | | }) |
| | | } |
| | | if (item.learnSelectType == "video") { |
| | | url = "/packageDomain/pages/resourceDetails/myVideo/index"; |
| | | } else if (item.learnSelectType == "audio") { |
| | | url = "/packageDomain/pages/resourceDetails/myAudio/index"; |
| | | } else if (item.selectType == "picture" || item.selectType == "zip") { |
| | | } else if (item.learnSelectType == "picture" || item.learnSelectType == 'document' || item.learnSelectType == 'pdf') { |
| | | url = "/packageDomain/pages/resourceDetails/document/index"; |
| | | } |
| | | if ((!item.file && !item.freeFile && !item.protectedFile)) { |