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 | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index ec54438..870f733 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -808,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 } @@ -893,7 +895,8 @@ 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, @@ -937,12 +940,13 @@ }) } } - const addNum = query.cmsPath.length > 12 ? 7 : query.cmsPath.length > 14 ? 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); @@ -1028,7 +1032,8 @@ if (data.length > 0) { let list = [] // 娴嬭瘯 6浣�// 姝e紡 5浣�// 娴嬭瘯璋冪敤浼�20锛屽唴閮�7 姝e紡璋冪敤浼�17 鍐呴儴浼�6 - const addNum = query.cmsPath.length > 12 ? 7 : query.cmsPath.length > 14 ? 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) @@ -1143,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