Commit cbe9d227 authored by GuanHua's avatar GuanHua

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

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