From 61052ffdfbbb93dae84803c5bd966899c2afb684 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期五, 10 一月 2025 17:49:40 +0800 Subject: [PATCH] 云学习购买 --- packageBookService/pages/bookServices/detail/index.js | 42 +++++++++++++++++++++++++++++------------- 1 files changed, 29 insertions(+), 13 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index 917c602..212bf12 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -214,7 +214,8 @@ protocolShow: false, protocolTxt: '', learnMenu: null, - md5List: [] + md5List: [], + editDialog: false }, resetTree: function (e) { @@ -271,8 +272,6 @@ this.setData({ tabValue: options.tabValue, }); - - } }, @@ -394,7 +393,6 @@ }, // 鑾峰彇鍥句功璇︽儏 getBookInfo(id) { - console.log(id, "id") this.setData({ "mockData'.id": 0, "mockData.price": 0, @@ -434,11 +432,14 @@ protectedEpub: [], probationPage: [], //pdf璇曡椤垫暟 freeEpubPage: [], //epub璇曡鐧惧垎姣� + bookEditor: [], //鍥句功缂栬緫 + contactInformation: [], //鑱旂郴鏂瑰紡 }, }; app.MG.store.getProductDetail(query).then(async (res) => { this.getResourceCode(id, res.datas.rootCmsItemId) - console.log(res.datas, "res.datas") + res.datas.bookEditor = res.datas.bookEditor ? res.datas.bookEditor : '-' + res.datas.contactInformation = res.datas.contactInformation ? res.datas.contactInformation : '-' this.setData({ bookDetail: res.datas, buyIdList: res.datas.purchasedSaleMethodIdList, @@ -472,6 +473,16 @@ } await this.getBookClass(classData); } + } + // 鎵爜浠庨搴撹烦杞洖鍥句功璇︽儏 + const localData = wx.getStorageSync('tabValue') + if (localData) { + this.setData({ + tabValue: localData + }) + wx.removeStorage({ + key: 'tabValue', + }) } if (this.data.tabValue == 'questionBank' || this.data.tabValue == 'jsek_cloudLearning' || this.data.tabValue == 'jsek_teachingResources') { const checkData = this.data.cmsDatas.find( @@ -516,7 +527,6 @@ "bookDetail.paperPrice": this.numFormat( this.data.bookDetail.paperPrice ), - }); }); }, @@ -749,6 +759,14 @@ } } }, + + // 鑱旂郴 + editPhone() { + this.setData({ + editDialog: true + }) + }, + // 鎴戣寤鸿 suggestBtn() { // 妫�鏌ョ櫥褰曠姸鎬� @@ -1026,7 +1044,6 @@ res.datas.cmsDatas[0].datas.forEach((item) => { // 浜戝涔犱笂鏈夐攢鍞柟寮忥紝鍘绘帀浜戝涔犱笅鎵�鏈夐攢鍞柟寮� if (this.data.tabValue == "jsek_teachingResources") { - if (item.file || item.freeFile) { let md5 = item.file ? item.file : item.freeFile md5s.push(md5) @@ -1035,7 +1052,7 @@ md5List: md5s, }); } - if (flags) item.saleMethod = [] + if (flags && cloundSaleMethod.Price > 0) item.saleMethod = [] item.checked = false; if (item.sysType == 'CmsItem') { // 鏁欏璧勬簮 绫诲瀷鍚嶇О璧嬪�� @@ -1083,7 +1100,7 @@ new Date(item.saleMethod.find((citem) => citem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime() ) || (flags && cloundSaleMethod.Price == 0) // 鍒ゆ柇浜戝涔犲叏閮ㄨ喘涔版寜閽槸鍚︽樉绀� - let isShowBuyCloundMenu = flags && cloundSaleMethod.Price >= 0 && !this.data.buyIdList.includes(cloundSaleMethod.Id) + let isShowBuyCloundMenu = flags && cloundSaleMethod.Price > 0 && !this.data.buyIdList.includes(cloundSaleMethod.Id) // 鍒ゆ柇璧勬簮璐拱鎸夐挳鏄惁鏄剧ず let isShowBuyCloundBtn = !flags && res.datas.cmsDatas[0].datas.some(citem => citem.saleMethod.length != 0) // 鍒ゆ柇璐墿杞︽寜閽拰閿佹寜閽槸鍚︽樉绀� @@ -1096,7 +1113,7 @@ isshowDrawBtn, isShowBuyCloundMenu, isShowBuyCloundBtn, - isCloundHaveSaleMethod: flags, + isCloundHaveSaleMethod: flags && cloundSaleMethod.Price > 0, learn: list, loading: false, openLearnids: result, @@ -1176,7 +1193,7 @@ jslx: false, }); } else { - data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder' && item.refCode != 'jsek_interaction') + data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder') // && item.refCode != 'jsek_interaction' that.setData({ jslx: true, @@ -1655,7 +1672,7 @@ (item) => item == saleData.Id ); // 宸茬粡璐拱 - if (isShow) return false + if (isShow || saleData.Price == 0) return false // 鏈喘涔帮紝鏌ョ湅閿�鍞柟寮忔槸鍚﹁繃鏈� if (!isShow) { const flag = new Date(saleData.EndDate).getTime() >= new Date().getTime() && @@ -1903,7 +1920,6 @@ // 浜戝涔犲叏閮ㄨ喘涔� async buyCloudLearnClass() { const cloundMenu = this.data.resourceCodeList.find((item) => item.refCode == 'jsek_cloudLearning') - debugger let query = { remarks: '浜戝涔�', requests: [{ -- Gitblit v1.9.1