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/detail/components/testResource/testResource.js | 94 ++++++++++++++++++++++++++++++++-------------- 1 files changed, 65 insertions(+), 29 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js index 88b146f..eb3f075 100644 --- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js +++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js @@ -13,9 +13,24 @@ type: Object, value: "", }, + tab: { + type: String, + value: "", + }, + openIds: { + type: Array, + value: [], + }, mockData: { type: Object, value: {}, + }, + storeInfo: { + type: String, + value: "", + }, + jslx: { + type: Boolean, }, }, @@ -28,12 +43,24 @@ loading: false, }, + ready() {}, + /** * 缁勪欢鐨勬柟娉曞垪琛� */ methods: { + testBtn() { + this.setData({ + radioItem: 'test' + }) + }, + mockBtn() { + this.setData({ + radioItem: 'mock' + }) + }, async goTest(e) { - const value = e.currentTarget.dataset.value; + const value = e.detail.value.item; const token = wx.getStorageSync("jsek-token"); if (!token) { return wx.getUserProfile({ @@ -48,32 +75,42 @@ }); // 鑾峰彇绔犺妭涓嬫槸鍚︽湁棰樼洰 let idPathList = []; - let query = { - path: "*", - queryType: "*", - productId: this.properties.bookInfo.id, - cmsPath: value.productLinkPath, - pading: { - start: 0, - size: 999, - }, - }; - if (value.childrenFolderCount == 0) { - wx.hideLoading(); - return wx.showToast({ - icon: "error", - title: "鏆傛棤鏁版嵁", - }); + + if (this.properties.storeInfo || this.properties.jslx) { + idPathList.push({ + id: this.properties.bookInfo.id, + name: this.properties.bookInfo.name, + productLinkPath: value.productLinkPath, + type: value.type, + }) } else { - const res = await app.MG.store.getProductDetail(query); - res.datas.cmsDatas[0].datas.forEach((item) => { - idPathList.push({ - id: item.id, - name: item.name, - productLinkPath: item.productLinkPath, - type: item.type, + let query = { + path: "*", + queryType: "*", + productId: this.properties.bookInfo.id, + cmsPath: value.productLinkPath, + pading: { + start: 0, + size: 999, + }, + }; + if (value.childrenFolderCount == 0) { + wx.hideLoading(); + return wx.showToast({ + icon: "error", + title: "鏆傛棤鏁版嵁", }); - }); + } else { + const res = await app.MG.store.getProductDetail(query); + res.datas.cmsDatas[0].datas.forEach((item) => { + idPathList.push({ + id: item.id, + name: item.name, + productLinkPath: item.productLinkPath, + type: item.type, + }); + }); + } } wx.hideLoading(); wx.navigateTo({ @@ -83,7 +120,7 @@ this.properties.bookInfo.rootCmsItemId }&idPathList=${JSON.stringify(idPathList)}&answerTitle=${ value.name - }&answerType=${"option"}`, + }&answerType=${"option"}&storeInfo=${this.properties.storeInfo}&jslx=${this.properties.jslx}`, }); }, goMycollect(e) { @@ -110,8 +147,7 @@ this.setData({ radioItem: e.detail.value, }); - if (e.detail.value == "mock") { - } + if (e.detail.value == "mock") {} }, async getMockId() { wx.showLoading({ @@ -160,4 +196,4 @@ }); }, }, -}); +}); \ No newline at end of file -- Gitblit v1.9.1