Commit 5c9aa071 authored by GuanHua's avatar GuanHua

fix: 优惠券弹窗回显问题

parent a616819c
......@@ -13,6 +13,7 @@ import {
resolveMappingPageConfig,
updatePageConfig,
} from '@lingxi-disign/react';
import moment from 'moment'
import ToolBar from '../../editor/components/toolBar';
import MobileDesignPanel from '../../editor/components/MobileDesignPanel';
import MobileClientEditLeft from '../../editor/components/mobileClientEditLeft';
......@@ -1014,6 +1015,35 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = props => {
}
}
}
if (appConfig?.coupon) {
// 优惠券弹窗
const _details = appConfig?.coupon?.details;
_couponsModalConfig['13'].props.title = _details?.title;
if (_details.id.length > 0) {
const _couponList = _details.id?.map((item) => { return { belongType: item.belongType, couponId: item.id }; });
const _couponListData = await PublicApi.postMarketingCouponActivityPageSelectDetail({ couponList: _couponList });
message.destroy();
if (_couponListData.code === 1000) {
_couponListData.data?.forEach((item, index) => {
console.log(item, 'couponitem')
const _newKey: any = `13-${Number(index) + 1}`;
!_couponsModalConfig['13'].childNodes.includes(_newKey) && _couponsModalConfig['13'].childNodes.push(_newKey);
_couponsModalConfig[_newKey] = {
key: _newKey,
title: item.name,
componentName: 'CouponsModal.CouponsItem',
props: {
...item,
expiredDay: moment(item?.releaseTimeEnd || moment()).diff(moment(), 'days'),
isnull: false
}
};
});
}
}
}
!_mallLayoutConfig['0'].childNodes.includes('12') &&
_mallLayoutConfig['0'].childNodes.push('12');
......
......@@ -22,6 +22,7 @@ import { priceFormat } from '@/utils/numberFomat';
import * as MarketingConfigs from './marketing_config';
import { cloneDeep } from 'lodash';
import { GlobalConfig } from '@/global/config'
import moment from 'moment'
import {
defaultHeaderNavData,
channelLayoutConfig,
......@@ -1042,6 +1043,34 @@ const OwnMallTempleteEdit: React.FC<ShopPreviewPropsType> = props => {
}
}
if (appConfig?.coupon) {
// 优惠券弹窗
const _details = appConfig?.coupon?.details;
_couponsModalConfig['13'].props.title = _details?.title;
if (_details.id.length > 0) {
const _couponList = _details.id?.map((item) => { return { belongType: item.belongType, couponId: item.id }; });
const _couponListData = await PublicApi.postMarketingCouponActivityPageSelectDetail({ couponList: _couponList });
message.destroy();
if (_couponListData.code === 1000) {
_couponListData.data?.forEach((item, index) => {
console.log(item, 'couponitem')
const _newKey: any = `13-${Number(index) + 1}`;
!_couponsModalConfig['13'].childNodes.includes(_newKey) && _couponsModalConfig['13'].childNodes.push(_newKey);
_couponsModalConfig[_newKey] = {
key: _newKey,
title: item.name,
componentName: 'CouponsModal.CouponsItem',
props: {
...item,
expiredDay: moment(item?.releaseTimeEnd || moment()).diff(moment(), 'days'),
isnull: false
}
};
});
}
}
}
_mallLayoutConfig['0'].childNodes = [..._mallLayoutConfig['0'].childNodes, '16', '12','13', '14'];
const config = {
..._mallLayoutConfig,
......
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