|
@@ -46,20 +46,22 @@ function Bottom({ setTopObj, pageKey }: Props) {
|
|
|
|
|
|
const myList1Temp = data.catalogRoot
|
|
|
|
|
|
+ // console.log('ppppppppppp', data.scenes)
|
|
|
+
|
|
|
const myObjTemp: any = {}
|
|
|
data.scenes.forEach((v: any) => {
|
|
|
myList1Temp.forEach((c: any) => {
|
|
|
if (c.children[0] === v.category) {
|
|
|
- if (myObjTemp[c.children[0]]) myObjTemp[c.children[0]].push(v)
|
|
|
- else myObjTemp[c.children[0]] = [v]
|
|
|
+ if (myObjTemp[c.children[0]]) {
|
|
|
+ myObjTemp[c.children[0]].push(v)
|
|
|
+ } else myObjTemp[c.children[0]] = [v]
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
|
|
|
+ // 手动排序
|
|
|
for (const key in myObjTemp) {
|
|
|
- myObjTemp[key] = myObjTemp[key].sort(
|
|
|
- (a: any, b: any) => Number(a.sceneTitle.split('-')[1]) - Number(b.sceneTitle.split('-')[1])
|
|
|
- )
|
|
|
+ myObjTemp[key] = myObjTemp[key].sort((a: any, b: any) => a.weight - b.weight)
|
|
|
}
|
|
|
|
|
|
setMyList1([...KKlist1Temp, ...myList1Temp])
|