Commit 7ea08af3 authored by GuanHua's avatar GuanHua

fix: 店铺装修品类找不到的问题

parent 42508802
...@@ -216,47 +216,50 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => { ...@@ -216,47 +216,50 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const firstCategory: any = await fetchFirstCategory() const firstCategory: any = await fetchFirstCategory()
for (const item of firstCategory) { for (const item of firstCategory) {
const categoryDetail: any = await fetchCategoryById(item.id) if(item.id) {
const categoryDetail: any = await fetchCategoryById(item.id)
let floorLineConfigItem = {}
floorLineKeys.push(String(initIndex + 1)) let floorLineConfigItem = {}
floorLineKeys.push(String(initIndex + 1))
const FloorLine = {
[String(initIndex + 1)]: {
"componentName": "ShopFloorLine",
"props": {
title: item.name
},
"childNodes": [String(initIndex + 2), String(initIndex + 3)]
}
}
const FloorLine = { const Category = {
[String(initIndex + 1)]: { [String(initIndex + 2)]: {
"componentName": "ShopFloorLine", "componentName": "ShopFloorLine.Category",
"props": { "props": {
title: item.name categoryAdvertPicUrl: categoryDetail.categoryAdvertPicUrl,
categoryid: item.id,
linkdisable: true,
categoryList: categoryDetail.categoryBOList
},
}, },
"childNodes": [String(initIndex + 2), String(initIndex + 3)]
} }
}
const Category = { const Goods = {
[String(initIndex + 2)]: { [String(initIndex + 3)]: {
"componentName": "ShopFloorLine.Category", "componentName": "ShopFloorLine.Goods",
"props": { "props": {
categoryAdvertPicUrl: categoryDetail.categoryAdvertPicUrl, linkdisable: true,
categoryid: item.id, categoryid: item.id,
linkdisable: true, goodsList: categoryDetail.goodsBOList
categoryList: categoryDetail.categoryBOList },
}, },
}, }
}
const Goods = { floorLineConfigItem = { ...FloorLine, ...Category, ...Goods }
[String(initIndex + 3)]: { floorLineConfig = { ...floorLineConfig, ...floorLineConfigItem }
"componentName": "ShopFloorLine.Goods", initIndex += 100
"props": {
linkdisable: true,
categoryid: item.id,
goodsList: categoryDetail.goodsBOList
},
},
} }
floorLineConfigItem = { ...FloorLine, ...Category, ...Goods }
floorLineConfig = { ...floorLineConfig, ...floorLineConfigItem }
initIndex += 100
} }
mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, serviceAdvertConfig.key, CommonTitle2Config.key, AboutUsConfig.key, InformationConfig.key, FooterConfig.key] mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, serviceAdvertConfig.key, CommonTitle2Config.key, AboutUsConfig.key, InformationConfig.key, FooterConfig.key]
......
...@@ -166,46 +166,49 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => { ...@@ -166,46 +166,49 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
const firstCategory: any = await fetchFirstCategory() const firstCategory: any = await fetchFirstCategory()
for (const item of firstCategory) { for (const item of firstCategory) {
const categoryDetail: any = await fetchCategoryById(item.id) if (item.id ){
const categoryDetail: any = await fetchCategoryById(item.id)
let floorLineConfigItem = {}
floorLineKeys.push(String(initIndex + 1)) let floorLineConfigItem = {}
floorLineKeys.push(String(initIndex + 1))
const FloorLine = {
[String(initIndex + 1)]: {
"componentName": "ShopFloorLine",
"props": {
title: item.name
},
"childNodes": [String(initIndex + 2), String(initIndex + 3)]
}
}
const FloorLine = { const Category = {
[String(initIndex + 1)]: { [String(initIndex + 2)]: {
"componentName": "ShopFloorLine", "componentName": "ShopFloorLine.Category",
"props": { "props": {
title: item.name categoryAdvertPicUrl: categoryDetail.categoryAdvertPicUrl,
categoryid: item.id,
categoryList: categoryDetail.categoryBOList
},
}, },
"childNodes": [String(initIndex + 2), String(initIndex + 3)]
} }
}
const Category = { const Goods = {
[String(initIndex + 2)]: { [String(initIndex + 3)]: {
"componentName": "ShopFloorLine.Category", "componentName": "ShopFloorLine.Goods",
"props": { "props": {
categoryAdvertPicUrl: categoryDetail.categoryAdvertPicUrl, linkdisable: true,
categoryid: item.id, categoryid: item.id,
categoryList: categoryDetail.categoryBOList goodsList: categoryDetail.goodsBOList
},
}, },
}, }
}
const Goods = { floorLineConfigItem = { ...FloorLine, ...Category, ...Goods }
[String(initIndex + 3)]: { floorLineConfig = { ...floorLineConfig, ...floorLineConfigItem }
"componentName": "ShopFloorLine.Goods", initIndex += 100
"props": {
linkdisable: true,
categoryid: item.id,
goodsList: categoryDetail.goodsBOList
},
},
} }
floorLineConfigItem = { ...FloorLine, ...Category, ...Goods }
floorLineConfig = { ...floorLineConfig, ...floorLineConfigItem }
initIndex += 100
} }
mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, serviceAdvertConfig.key, FooterConfig.key] mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, serviceAdvertConfig.key, FooterConfig.key]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment