From 8a66618254338978c6ea4315896e24c8571fc372 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期一, 15 七月 2024 18:54:06 +0800 Subject: [PATCH] 资源 --- packageBookService/pages/bookServices/detail/index.js | 26 ++++++++++++-------------- 1 files changed, 12 insertions(+), 14 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index 9be7119..870f733 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -190,7 +190,7 @@ // this.getResourceClass(); // 鑾峰彇璧勬簮鎵�灞炲垎绫� const token = wx.getStorageSync(app.config.tokenKey); if (token) { - + this.getShoppingCartProductGet(); this.getApplyInfo(options.id); this.getAlreadyPBookList(); this.getAlreadyEBookList(); @@ -386,9 +386,6 @@ }; app.MG.store.getProductDetail(query).then(async (res) => { console.log(res.datas, 'res.datas'); - wx.setNavigationBarTitle({ - title: res.datas.name, - }) this.setData({ bookDetail: res.datas, buyIdList: res.datas.purchasedSaleMethodIdList, @@ -575,9 +572,6 @@ expire: false, }); } - } - if (!this.data.buy && this.data.bookDetail.isSell == '1') { - this.getShoppingCartProductGet(); } }); }, @@ -814,9 +808,11 @@ } } //缁欐暟缁勯噷闈㈠啀娣诲姞涓�涓猚hildren鐨勭┖鏁扮粍 + // let addnum1 = pathLength - path.length == 6 ? 6 : 7 for (const i of newArr) { i.children = [] - this.getTreeList(rootList, pathLength + addNum, i.children, i.productLinkPath, addNum) + let addnum1 = i.productLinkPath.length - path.length == 6 ? 6 : 7 + this.getTreeList(rootList, pathLength + addnum1, i.children, i.productLinkPath, addnum1) if (i.children.length == 0) { delete i.children } @@ -899,14 +895,14 @@ size: 999 }, } - app.MG.store.getProductDetail(query).then((res) => { + app.MG.store.getProductDetailNoChildren(query).then((res) => { + console.log(res.datas.cmsDatas[0].datas, 2345) if (!res.datas.cmsDatas[0].datas.length) { return this.setData({ noResources: true, loading: false, }); } - console.log(res.datas.cmsDatas[0].datas, "璧勬簮") let list = [] // 娴嬭瘯 6浣�// 姝e紡 5浣�// 娴嬭瘯璋冪敤浼�20锛屽唴閮�7 姝e紡璋冪敤浼�17 鍐呴儴浼�6 //鏁欏璧勬簮 浜戝涔� @@ -944,12 +940,13 @@ }) } } - const addNum = query.cmsPath.length > 11 ? 7 : query.cmsPath.length > 13 ? 8 : 6 + console.log(query.cmsPath, 111) + const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 14 ? 8 : 6 const num = query.cmsPath.length + addNum this.getTreeList(res.datas.cmsDatas[0].datas, num, list, '\\', addNum) list = this.ensureTreeConsistency(list) list = this.changeResourceChildren(list) - console.log('淇敼鍚庝簯', list); + console.log('淇敼鍚�', list); let result = []; if (type.refCode == "jsek_teachingResources") { this.findChildIds(list, result); @@ -1035,7 +1032,8 @@ if (data.length > 0) { let list = [] // 娴嬭瘯 6浣�// 姝e紡 5浣�// 娴嬭瘯璋冪敤浼�20锛屽唴閮�7 姝e紡璋冪敤浼�17 鍐呴儴浼�6 - const addNum = query.cmsPath.length > 11 ? 7 : query.cmsPath.length > 13 ? 8 : 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) @@ -1150,7 +1148,7 @@ for (let i = 0; i < data.length; i++) { if (index < 3) { const item = data[i] - if (item.childrenFolderCount > 0) { + if (item.children && item.children.length > 0) { result.push(item.id) if (item.children) { for (let j = 0; j < item.children.length; j++) { -- Gitblit v1.9.1