From 188a925be5b1024608eba034d1225e126b3134a8 Mon Sep 17 00:00:00 2001 From: QYF-GitLab1 <1940665526@qq.com> Date: 星期三, 16 七月 2025 16:46:41 +0800 Subject: [PATCH] 资源扫码 --- packageDomain/pages/resourceDetails/myVideo/index.js | 54 +++++++++++++++++------------------------------------- 1 files changed, 17 insertions(+), 37 deletions(-) diff --git a/packageDomain/pages/resourceDetails/myVideo/index.js b/packageDomain/pages/resourceDetails/myVideo/index.js index efda51a..ea072ff 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.js +++ b/packageDomain/pages/resourceDetails/myVideo/index.js @@ -332,32 +332,10 @@ // 鍒ゆ柇褰撳墠鐩爣鏄惁宸茶喘涔� async getCmsDataByQrcode() { - let query = { - storeInfo: this.data.storeInfo, - path: '*', - queryType: '*', - productId: this.data.bookId, - itemId: this.data.activeId, - 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 ?? [] + const query = { + cmsItemId: Number(this.data.activeId) + }; + return app.MG.file.checkCmsItem(query) }, resourceDetailsData() { @@ -433,21 +411,23 @@ }) if (this.data.source == 'qrcode') { let qrData = this.data.threeLeveData.find(ditem => ditem.id == this.data.activeId) - const currentSaleMaths = await this.getCmsDataByQrcode() - // 鍒ゆ柇鏄惁璐拱鐩綍 - const catalg = currentSaleMaths?.saleMethod?.find(i => currentSaleMaths.purchasedSaleMethodIdList.includes(i.Id)) - // 鍒ゆ柇鏄惁璐拱璧勬簮鏈韩 - const ownCms = qrData?.saleMethods?.find(i => currentSaleMaths.purchasedSaleMethodIdList.includes(i.Id)) - if (catalg || ownCms) { - if (qrData) { + const isBuyCms = await this.getCmsDataByQrcode() // 褰撳墠璧勬簮鎴栫埗绾х洰褰曟槸鍚﹁喘涔� + const isDefualtPrice = this.data.bookDetail?.defaultSaleMethod?.price // 褰撳墠涔︾殑浠烽粯璁ら攢鍞柟寮忎环鏍兼槸鍚︿负0 + const isBuyBook = this.data.bookDetail?.alreadyBuy // 褰撳墠涔︽槸鍚﹁喘涔� + if (isBuyCms) { + this.setData({ + threeLeveData: [qrData] + }) + } else { + if (isDefualtPrice == 0 || isBuyBook) { this.setData({ threeLeveData: [qrData] }) + } else { + this.setData({ + threeLeveData: [] + }) } - } else { - this.setData({ - threeLeveData: [] - }) } } else { this.setData({ -- Gitblit v1.9.1