From b55024ee2f42aa93e0ecaa3113bdeb286f6e59ac Mon Sep 17 00:00:00 2001 From: QYF-GitLab1 <1940665526@qq.com> Date: 星期二, 29 七月 2025 18:01:55 +0800 Subject: [PATCH] 优化按钮显示,教学互动 --- packageBookService/pages/bookServices/detail/components/tree/index.js | 55 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 45 insertions(+), 10 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js index a36aa4a..509c3a9 100644 --- a/packageBookService/pages/bookServices/detail/components/tree/index.js +++ b/packageBookService/pages/bookServices/detail/components/tree/index.js @@ -109,9 +109,9 @@ } }); const flag = list.findIndex((item) => item.checked == true); + console.log(this.properties.treeList) }, }, - methods: { handleList(tree) { for (let index = 0; index < tree.length; index++) { @@ -188,10 +188,42 @@ 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 = () => { + // if (this.properties.bookInfo.IsTextbook) return + const goPlayerFun = async () => { const item = e.currentTarget.dataset.item; const parent = e.currentTarget.dataset.parent; const parentProductLinkPath = parent ? @@ -258,12 +290,16 @@ 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: '璇峰厛璐拱璇ヨ祫婧�', + }); + } } } } @@ -282,6 +318,7 @@ } 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=YDHYD&cmsId=161974&productLinkPath=161974\\161976\\162006&activeId=162006&parentProductLinkPath=161976&source=qrcode&bookName=fffff&bookId=7136' }); } const token = wx.getStorageSync(app.config.tokenKey); @@ -293,7 +330,6 @@ goPlayerFun() } }, - // 鎷垮埌鎵�鏈夐」 getAllChildren(id) { let result = []; @@ -324,8 +360,10 @@ // 鎷垮埌褰撳墠椤瑰瓙椤� flattenTree(tree) { let result = []; + let that = this function flatten(node) { + result.push(node); if (node.children && node.children.length > 0) { node.children.forEach((child) => { @@ -338,7 +376,6 @@ }); return result; }, - // 鍙樹负true findAndUpdateItemsByIds(tree, ids, state) { function findAndUpdate(node) { @@ -356,7 +393,6 @@ } return tree; // 杩斿洖淇敼鍚庣殑瀹屾暣鏁扮粍 }, - // 鍏ㄩ�� checkAll() { wx.showLoading() @@ -393,7 +429,6 @@ this.triggerEvent("changeCheckAll", myEventDetail, myEventOption); wx.hideLoading() }, - // 绔犺妭鍕鹃�� checkResourceTitle(e) { wx.showLoading() -- Gitblit v1.9.1