| | |
| | | return false; |
| | | } |
| | | }, |
| | | |
| | | |
| | | // 判断当前目标是否已购买 |
| | | async getCmsDataByQrcode(item) { |
| | | let query = { |
| | | path: '*', |
| | | queryType: '*', |
| | | productId: this.properties.bookInfo.id, |
| | | itemId: item.id, |
| | | itemFields: { |
| | | // 资源类型,试读文件,是否允许下载等参数 |
| | | selectType: [], |
| | | freeFile: [], |
| | | file: [], |
| | | protectedFile: [], |
| | | resourcesClassification: [], |
| | | isDownload: [], |
| | | jsek_resourceBrief: [], |
| | | jsek_link: [], |
| | | jsek_questionBank: [], |
| | | learnSelectType: [] |
| | | }, |
| | | pading: { |
| | | start: 0, |
| | | size: 999 |
| | | } |
| | | } |
| | | const data = await app.MG.store.getProductDetail(query) |
| | | return data?.datas ?? [] |
| | | }, |
| | | |
| | | // 跳转音视频播放器 |
| | | goPlayer(e) { |
| | | // 检查登录状态 |
| | | const goPlayerFun = () => { |
| | | const goPlayerFun = async () => { |
| | | const item = e.currentTarget.dataset.item; |
| | | const parent = e.currentTarget.dataset.parent; |
| | | const parentProductLinkPath = parent ? |
| | |
| | | title: '请先购买该资源', |
| | | }) |
| | | if (item.protectedFile || item.freeFile) { |
| | | const currentSaleMaths = await this.getCmsDataByQrcode(item) |
| | | 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: "资源不可用,请联系管理员", |
| | | }); |
| | | const isBuyData = currentSaleMaths.purchasedSaleMethodIdList?.includes(item.saleMethod[0]?.Id) |
| | | if (!isBuyData) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请先购买该资源', |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | url = "/packageDomain/pages/resourceDetails/document/index"; |
| | | } |
| | | 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=${this.properties.tab}&applyState=${this.properties.applyState}&deadline=${this.properties.deadline}`, |
| | | url: '/packageDomain/pages/resourceDetails/myVideo/index?formPath=jsek_cloudLearning&parentName=mingxing&cmsId=161796&productLinkPath=161796\\161798\\165396\\162299&activeId=162299&parentProductLinkPath=161798\\165396&source=qrcode&bookName=&bookId=7129' |
| | | 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=${this.properties.tab}&applyState=${this.properties.applyState}&deadline=${this.properties.deadline}`, |
| | | // url: '/packageDomain/pages/resourceDetails/myVideo/index?formPath=jsek_cloudLearning&parentName=mingxing&cmsId=161796&productLinkPath=161796\\161798\\165396\\162299&activeId=162299&parentProductLinkPath=161798\\165396&source=qrcode&bookName=&bookId=7129' |
| | | }); |
| | | } |
| | | const token = wx.getStorageSync(app.config.tokenKey); |