Commit a13b185e authored by GuanHua's avatar GuanHua

fix: 自营商城装修保存数据问题

parent b2fa872e
......@@ -719,10 +719,12 @@ export const paramsShop = (
if (_childList?.length) {
const _customize: any = [];
for (const keys in _childList) {
_customize.push({
id: pageConfig[_childList[keys]].props.id,
tags: pageConfig[_childList[keys]].props.tags,
});
if (pageConfig[_childList[keys]].props.id) {
_customize.push({
id: pageConfig[_childList[keys]].props.id,
tags: pageConfig[_childList[keys]].props.tags,
});
}
}
_obj.customize =_customize;
}
......@@ -1360,10 +1362,12 @@ export const paramsShop = (
if (_childList?.length) {
const _customize: any = [];
for (const keys in _childList) {
_customize.push({
id: pageConfig[_childList[keys]].props.id,
tags: pageConfig[_childList[keys]].props.tags,
});
if (pageConfig[_childList[keys]].props.id) {
_customize.push({
id: pageConfig[_childList[keys]].props.id,
tags: pageConfig[_childList[keys]].props.tags || [],
});
}
}
_obj.customize =_customize;
}
......
......@@ -1005,34 +1005,38 @@ const OwnMallTempleteEdit: React.FC<ShopPreviewPropsType> = props => {
memberRoleId,
};
const _detailsData = await PublicApi.getMarketingAdornGoodsListAdorn(
param,
);
_detailsData.data.data?.forEach((child, childIndex) => {
const _childNewKey = `${_newKey}-${Number(childIndex) + 1}`;
!_suggestProductConfig[_newKey].childNodes.includes(
_childNewKey,
) &&
_suggestProductConfig[_newKey].childNodes.push(_childNewKey);
_suggestProductConfig[_childNewKey] = {
key: _childNewKey,
title: child?.name,
componentName: 'SuggestProduct.Commodity',
canEdit: true,
canHide: false,
props: {
...child,
name: child.name,
image: child.mainPic,
mode: 'vertical',
discountPrice: priceFormat(child.min),
buyBtn: false,
tags: item.customize.filter(
filChild => filChild.id === child.id,
)?.[0]?.tags,
},
};
});
try {
const _detailsData = await PublicApi.getMarketingAdornGoodsListAdorn(
param,
);
_detailsData.data.data?.forEach((child, childIndex) => {
const _childNewKey = `${_newKey}-${Number(childIndex) + 1}`;
!_suggestProductConfig[_newKey].childNodes.includes(
_childNewKey,
) &&
_suggestProductConfig[_newKey].childNodes.push(_childNewKey);
_suggestProductConfig[_childNewKey] = {
key: _childNewKey,
title: child?.name,
componentName: 'SuggestProduct.Commodity',
canEdit: true,
canHide: false,
props: {
...child,
name: child.name,
image: child.mainPic,
mode: 'vertical',
discountPrice: priceFormat(child.min),
buyBtn: false,
tags: item.customize.filter(
filChild => filChild.id === child.id,
)?.[0]?.tags,
},
};
});
} catch (error) {
console.log(error)
}
}
}
}
......
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