From f4e7324c27b7c6ecb824029e22a13541c5033ade Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期一, 22 七月 2024 16:07:56 +0800 Subject: [PATCH] ceshi --- packageBookService/pages/bookServices/examination/examination.js | 5 +- packageBookService/pages/bookServices/detail/components/testResource/testResource.js | 9 +++- packageBookService/pages/bookServices/detail/index.wxml | 2 packageBookService/pages/bookServices/detail/index.js | 59 ++++++++++++++++++----------- packageBookService/pages/bookServices/detail/components/testTree/index.js | 1 5 files changed, 47 insertions(+), 29 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js index 09b18ad..eb3f075 100644 --- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js +++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js @@ -29,6 +29,9 @@ type: String, value: "", }, + jslx: { + type: Boolean, + }, }, /** @@ -57,7 +60,6 @@ }) }, async goTest(e) { - console.log(e.detail.value.item, 666) const value = e.detail.value.item; const token = wx.getStorageSync("jsek-token"); if (!token) { @@ -73,7 +75,8 @@ }); // 鑾峰彇绔犺妭涓嬫槸鍚︽湁棰樼洰 let idPathList = []; - if (this.properties.storeInfo) { + + if (this.properties.storeInfo || this.properties.jslx) { idPathList.push({ id: this.properties.bookInfo.id, name: this.properties.bookInfo.name, @@ -117,7 +120,7 @@ this.properties.bookInfo.rootCmsItemId }&idPathList=${JSON.stringify(idPathList)}&answerTitle=${ value.name - }&answerType=${"option"}&storeInfo=${this.properties.storeInfo}`, + }&answerType=${"option"}&storeInfo=${this.properties.storeInfo}&jslx=${this.properties.jslx}`, }); }, goMycollect(e) { diff --git a/packageBookService/pages/bookServices/detail/components/testTree/index.js b/packageBookService/pages/bookServices/detail/components/testTree/index.js index 4b8c534..5aa6708 100644 --- a/packageBookService/pages/bookServices/detail/components/testTree/index.js +++ b/packageBookService/pages/bookServices/detail/components/testTree/index.js @@ -35,7 +35,6 @@ }); }, goTest(e) { - console.log(e, 234) const value = e.currentTarget.dataset; var myEventDetail = { value, diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index d0fa544..94b0dc2 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -35,6 +35,7 @@ teach: [], learn: [], test: [], + jslx: true, openTeachids: [], openLearnids: [], openTestids: [], @@ -154,7 +155,8 @@ ], showIndex: '', successOrderNumber: '', - applicationState: '' // 鐢靛瓙鏍蜂功鐢宠鐘舵�� + applicationState: '', // 鐢靛瓙鏍蜂功鐢宠鐘舵�� + }, resetTree: function (e) { @@ -385,7 +387,6 @@ }, }; app.MG.store.getProductDetail(query).then(async (res) => { - console.log(res.datas, 'res.datas'); this.setData({ bookDetail: res.datas, buyIdList: res.datas.purchasedSaleMethodIdList, @@ -457,7 +458,6 @@ ), }); - console.log("鍥句功淇℃伅", this.data.bookClass); }); }, //璇锋眰瀛愬晢鍝佺殑鏂囦欢 @@ -658,8 +658,6 @@ this.setData({ showIndex: '1' }) - console.log(this.data.bookDetail.icon, '0111111'); - console.log(this.data.bookDetail.name, '45688'); }, // 璺宠浆缃戝簵 goShop(e) { @@ -977,15 +975,16 @@ }, // 鑾峰彇 浜戞祴璇� getResourceData(type) { - this.setData({ + var that = this + that.setData({ loading: true, noResources: false, }); let query = { path: "*", queryType: "*", - storeInfo: this.data.options.storeInfo, - productId: this.data.bookDetail.id, + storeInfo: that.data.options.storeInfo, + productId: that.data.bookDetail.id, cmsPath: type.productLinkPath, cmsType: '*', itemFields: { @@ -1012,38 +1011,57 @@ if (type.refCode == "questionBank") { let data = [] let result = []; - if (this.data.options.storeInfo == 'jsek_jslx') { + const isTSFW = res.datas.cmsDatas[0].datas.filter( + (item) => + item.type == 'questionBankFolder' && + (item.name == '濉┖棰�' || + item.name == '鍒ゆ柇棰�' || + item.name == '鍗曢�夐' || + item.name == '澶氶�夐' || + item.name == '绠�绛旈') + ) + if (that.data.options.storeInfo == 'jsek_jslx') { data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder'); if (data.length > 0) { - this.setData({ + that.setData({ test: data, loading: false, openTeachids: result, }); } else { - this.setData({ + that.setData({ noResources: true, loading: false, }); } } else { - data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder' && item.childrenFolderCount > 0); + if (isTSFW.length > 0) { + data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder' && item.childrenFolderCount > 0) + that.setData({ + jslx: false, + }); + } else { + data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder') + that.setData({ + jslx: true, + }); + } if (data.length > 0) { let list = [] // 娴嬭瘯 6浣�// 姝e紡 5浣�// 娴嬭瘯璋冪敤浼�20锛屽唴閮�7 姝e紡璋冪敤浼�17 鍐呴儴浼�6 const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 14 ? 8 : 6 const num = query.cmsPath.length + addNum - this.getTreeList(data, num, list, '\\', addNum) - list = this.ensureTreeConsistency(list) - this.findChildIds(list[0].children, result); - this.setData({ - test: list[0].children, + that.getTreeList(data, num, list, '\\', addNum) + list = that.ensureTreeConsistency(list) + that.findChildIds(list[0].children, result); + that.setData({ + test: list.length == 1 && list[0].name == '棰樺簱' ? list[0].children : list, loading: false, openTeachids: result, }); } else { - this.setData({ + that.setData({ noResources: true, loading: false, }); @@ -1265,9 +1283,7 @@ url, }); } - } else { - console.log(222); - } + } else {} } else { wx.showToast({ title: "鍟嗗搧涓嶅湪鏈夋晥鏈�", @@ -2228,7 +2244,6 @@ }); return false; } else if (isApply.state == 'Normal') { - console.log(isApply.state, "isApply.state") const flag = new Date(isApply.feedBack.endDate + ' 23:59:59').getTime() > new Date().getTime() if (flag) { wx.showToast({ diff --git a/packageBookService/pages/bookServices/detail/index.wxml b/packageBookService/pages/bookServices/detail/index.wxml index d79e000..18f460f 100644 --- a/packageBookService/pages/bookServices/detail/index.wxml +++ b/packageBookService/pages/bookServices/detail/index.wxml @@ -157,7 +157,7 @@ </t-tab-panel> <t-tab-panel label="浜戞祴璇�" icon="{{tabValue == 'questionBank' ? testResourceClickIocn : testResourceIocn}}" value="questionBank" style="{{tabPanelstyle}}"> <view wx:if="{{!loading}}"> - <test-resource id="test-resource" list="{{test}}" bookInfo="{{bookDetail}}" openIds="{{openLearnids}}" mockData="{{mockData}}" tab="{{tabValue}}" storeInfo="{{options.storeInfo}}" bind:buyMock="buyMock"></test-resource> + <test-resource id="test-resource" list="{{test}}" bookInfo="{{bookDetail}}" openIds="{{openLearnids}}" mockData="{{mockData}}" tab="{{tabValue}}" storeInfo="{{options.storeInfo}}" jslx="{{jslx}}" bind:buyMock="buyMock"></test-resource> </view> </t-tab-panel> <t-tab-panel label="浜戠瑪璁�" icon="{{tabValue == 'jsek_note' ? noteClickIcon: noteIcon}}" value="jsek_note" style="{{tabPanelstyle}}"> diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js index 7e2f406..19bcdfe 100644 --- a/packageBookService/pages/bookServices/examination/examination.js +++ b/packageBookService/pages/bookServices/examination/examination.js @@ -15,6 +15,7 @@ isCountdownRunning: true, // 鏄惁鍊掕鏃� countdownTime: 0, // 鍊掕鏃舵椂闂� storeInfo: '', + jslx: '', bookId: "", productLinkPath: "", rootCmsItemId: "", @@ -70,6 +71,7 @@ idPathList: options.idPathList ? JSON.parse(options.idPathList) : [], answerType: options.answerType, storeInfo: options.storeInfo, + jslx: options.jslx, }); wx.setNavigationBarTitle({ title: options.answerTitle, @@ -464,7 +466,6 @@ const inputData = e.detail.value.detail.value; const id = e.detail.value.currentTarget.dataset.id; const index = Number(e.detail.value.currentTarget.dataset.index); - console.log(index); const questionList = this.data.questionDataList; questionList.forEach((item) => { if (item.id == id) { @@ -859,7 +860,7 @@ }); } res.datas.cmsDatas[0].datas.forEach((item, index) => { - if (this.data.storeInfo) { + if (this.data.storeInfo || this.data.jslx) { if (item.Embedded_QuestionBank_QuestionType == 'singleChoice') { pathitem.name = "鍗曢�夐" } else if (item.Embedded_QuestionBank_QuestionType == 'shortAnswer') { -- Gitblit v1.9.1