const app = getApp(); Component({ properties: { treeList: { type: Array, value: [], }, learnList: { type: Array, value: [], }, bookInfo: { type: Object, value: {}, }, openIds: { type: Array, value: [], }, }, data: { sonPurchaseSaleMethodId: "", superiorPurchaseSaleMethodId: [], activeValues: [1, 2], webpageSrc: "", cloudShoppingCart: [], selectAll: [], shoppingCart: true, stop: false, cart: true, canExecute: true }, ready() {}, onLoad() { this.setData({ sonPurchaseSaleMethodId: [], }); }, methods: { handleList(tree) { for (let index = 0; index < tree.length; index++) { const item = tree[index]; if (item.sysType == "CmsItem" && !item.checked) {} if (item.children && item.children.length > 0) { this.handleList(item.children); } } }, // 节点展开 handleChange(e) { this.setData({ openIds: e.detail.value, }); }, // 跳转音视频播放器 goPlayer(e) { // 检查登录状态 const token = wx.getStorageSync(app.config.tokenKey); 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 (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") { url = "/packageDomain/pages/resourceDetails/document/index"; } if ((!item.file && !item.freeFile && !item.protectedFile)) { return wx.showToast({ icon: 'error', title: '暂无资源', }) } wx.navigateTo({ url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parentProductLinkPath}&parentName=${parentName}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=jsek_cloudLearning&storeInfo=${app.config.digitalCourses}`, }); } }, }, });