Commit cbe9d227 authored by GuanHua's avatar GuanHua

fix: 自营商城模板使用接口修改

parent cb803efd
......@@ -82,7 +82,7 @@
"god": "0.2.11",
"immutability-helper": "^3.1.1",
"js-cookie": "^2.2.1",
"lingxi-design-ui": "^2.0.17",
"lingxi-design-ui": "^2.0.19",
"lint-staged": "^10.0.7",
"lodash": "^4.17.20",
"mobx": "^5.15.4",
......
......@@ -157,6 +157,21 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
// })
// }
const fetchNewByLabel = (label: string) => {
// 1-头条文章 2-轮播新闻 3-图片新闻 4-推荐阅读
return new Promise((resolve, reject) => {
PublicApi.getManageContentInformationFindAllByRecommendLabel({ recommendLabel: label }).then((res: { code: number; data: unknown }) => {
if (res.code === 1000) {
resolve(res.data);
} else {
reject();
}
}).catch(() => {
reject();
});
});
};
const getComponentsConfig = async () => {
// 导航栏
const navData = await getOwnMallNavData();
......@@ -182,6 +197,9 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
topBarConfig[topBarConfig.key].props.shopname = webMallInfo.name
headerConfig[headerConfig.key].props.logoUrl = webMallInfo.logoUrl
// 行情资讯
InformationConfig[InformationConfig.key].props.newsList = await fetchNewByLabel('4');
// AboutUsConfig[AboutUsConfig.key].props.shopInfo = shopInfo
let initIndex = 100
let floorLineConfig: any = {}
......@@ -236,7 +254,7 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
}
mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, fourBannerConfig.key, FooterConfig.key]
mallLayoutConfig["0"].childNodes = [...mallLayoutConfig["0"].childNodes, ...floorLineKeys, fourBannerConfig.key, InformationConfig.key, FooterConfig.key]
const config = {
...mallLayoutConfig,
...topBarConfig,
......@@ -250,7 +268,7 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
...threeBannerConfig,
...floorLineConfig,
...fourBannerConfig,
// ...InformationConfig,
...InformationConfig,
...FooterConfig
}
setComponentConfigs(config)
......
......@@ -43,8 +43,10 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
*/
const handleConfirmUse = () => {
setConfirmLoading(true)
PublicApi.postTemplateWebPageTemplateWebUseShopTemplate({ id }).then(res => {
const params: any = {
id
}
PublicApi.postTemplateWebPageTemplateWebUseSelfTemplate(params).then(res => {
if (res.code === 1000) {
setUseModalVisible(false)
fetchDetail()
......@@ -124,7 +126,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
</div>
<UseModal
title="使用店铺模板"
title="使用自营商城模板"
visible={useModalVisible}
dataInfo={detailInfo}
confirmLoading={confirmLoading}
......
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