From c3086cda662e2b908cf96b6b3ff599713eb924d6 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期一, 02 九月 2024 16:59:16 +0800 Subject: [PATCH] gongneng --- packageBookService/pages/bookServices/detail/index.js | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index bbc3420..a5395e2 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -985,18 +985,16 @@ }) } } - const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 14 ? 8 : 6 + const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 13 ? 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); let result = []; if (type.refCode == "jsek_teachingResources") { this.findChildIds(list, result); - const newUSeList = this.deleteTreeData(list, result) - console.log('鏍戝墧闄�', result, newUSeList); - console.log('鏍戝姞涓�', this.increaseTreeData(list, newUSeList, 16094)); + // const newUSeList = this.deleteTreeData(list, result) + // console.log('鏍戝墧闄�', result, newUSeList); this.setData({ openTeachids: result, @@ -1101,7 +1099,7 @@ let list = [] // 娴嬭瘯 6浣�// 姝e紡 5浣�// 娴嬭瘯璋冪敤浼�20锛屽唴閮�7 姝e紡璋冪敤浼�17 鍐呴儴浼�6 - const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 14 ? 8 : 6 + const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 13 ? 8 : 6 const num = query.cmsPath.length + addNum that.getTreeList(data, num, list, '\\', addNum) list = that.ensureTreeConsistency(list) @@ -2524,9 +2522,11 @@ let resultList = [] for (let index = 0; index < list.length; index++) { const item = list[index]; - for (let cindex = 0; cindex < item.children.length; cindex++) { - const citem = item.children[cindex]; - citem.children = [] + if (item.children.length > 0) { + for (let cindex = 0; cindex < item.children.length; cindex++) { + const citem = item.children[cindex]; + citem.children = [] + } } resultList.push(item) } -- Gitblit v1.9.1