| | |
| | | }, |
| | | // 节点展开 |
| | | handleChange(e) { |
| | | console.log(e.detail.value); |
| | | this.setData({ |
| | | openIds: e.detail.value, |
| | | }); |
| | |
| | | }, |
| | | // 判断资源是否购买 |
| | | resourceIsBuy(data) { |
| | | return true |
| | | // if (data.saleMethod && data.saleMethod.length) { |
| | | // if (data.saleMethod[0].State == "Disable") return false; |
| | | // const isSHow = this.properties.buyIds.some( |
| | | // (item) => item == data.saleMethod[0].Id |
| | | // ); |
| | | // return !isSHow; |
| | | // } else { |
| | | // return false; |
| | | // } |
| | | if (data.saleMethod && data.saleMethod.length) { |
| | | if (data.saleMethod[0].State == "Disable") return false; |
| | | const isSHow = this.properties.buyIds.some( |
| | | (item) => item == data.saleMethod[0].Id |
| | | ); |
| | | return !isSHow; |
| | | } else { |
| | | return false; |
| | | } |
| | | }, |
| | | // 跳转音视频播放器 |
| | | goPlayer(e) { |
| | |
| | | wx.getStorageSync("teachResourcesPath"); |
| | | const parentName = parent ? parent.name : "教学资源"; |
| | | let url; |
| | | if (item.selectType == 'zip') { |
| | | if (item.selectType == "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}` |
| | | }) |
| | | } else if (item.selectType == 'zip') { |
| | | if (this.properties.applyState == 'Normal') { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | |
| | | item.learnSelectType == "audio" |
| | | ) { |
| | | url = "/packageDomain/pages/resourceDetails/myAudio/index"; |
| | | } else if (item.selectType == "picture" || item.selectType == "zip") { |
| | | } else if (item.selectType == "picture") { |
| | | url = "/packageDomain/pages/resourceDetails/document/index"; |
| | | } |
| | | if ( |
| | | this.properties.tab == "jsek_cloudLearning" && |
| | | // this.resourceIsBuy(item) |
| | | item.saleMethod.length > 0 |
| | | this.resourceIsBuy(item) |
| | | // item.saleMethod.length > 0 |
| | | ) { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | |
| | | // }, |
| | | // }); |
| | | // } |
| | | if (item.selectType == "webpage") { |
| | | this.setData({ |
| | | webpageSrc: item.jsek_link, |
| | | }); |
| | | } |
| | | // if (item.selectType == "webpage") { |
| | | // this.setData({ |
| | | // webpageSrc: item.jsek_link, |
| | | // }); |
| | | // } |
| | | } |
| | | }, |
| | | |