| | |
| | | |
| | | import Message from 'tdesign-miniprogram/message/message'; |
| | | const app = getApp() |
| | | Component({ |
| | |
| | | treeList: { |
| | | type: Array, |
| | | value: [] |
| | | }, |
| | | bookInfo: { |
| | | type: Object, |
| | | value: {} |
| | | }, |
| | | buyIds: { |
| | | type: Array, |
| | |
| | | this.triggerEvent('downloadTeach', myEventDetail, myEventOption) |
| | | }, |
| | | // 判断资源是否购买 |
| | | resourceIsBuy (data) { |
| | | if (data.saleMethod && data.saleMethod.length) { |
| | | const isSHow = buyIdList.value.some((item) => item == data.saleMethod[0].Id) |
| | | return !isSHow |
| | | } else { |
| | | return false |
| | | } |
| | | } |
| | | resourceIsBuy(data) { |
| | | if (data.saleMethod && data.saleMethod.length) { |
| | | const isSHow = buyIdList.value.some((item) => item == data.saleMethod[0].Id) |
| | | return !isSHow |
| | | } else { |
| | | return false |
| | | } |
| | | }, |
| | | // 跳转音视频播放器 |
| | | goPlayer(e) { |
| | | const item = e.currentTarget.dataset.item |
| | | const parent = e.currentTarget.dataset.parent |
| | | console.log(this.properties.bookInfo); |
| | | wx.navigateTo({ |
| | | url: `/pages/resourceDetails/index?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parent.productLinkPath}&parentName=${parent.name}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}`, |
| | | }) |
| | | console.log(e); |
| | | } |
| | | } |
| | | }) |