Commit b398a006 authored by 卢均锐's avatar 卢均锐

feat: 修改c端商城的推荐商品tags

-map增加key
parent bd1a49ac
......@@ -827,16 +827,16 @@ const mobileClientEdit: React.FC<ShopPreviewPropsType> = (props) => {
// 商品推荐
const _details = appConfig?.adornContent?.suggestProduct?.details;
if (_details.length > 0) {
for(let index in _details){
for (let index in _details) {
const item = _details[index];
const _newKey = `10-${Number(index) + 1}`;
!_suggestProductConfig['10'].childNodes.includes(_newKey) && _suggestProductConfig['10'].childNodes.push(_newKey)
_suggestProductConfig[_newKey] = {
key: _newKey,
title: item?.title || '商品容器',
componentName: 'SuggestProduct.Items',
canEdit: true,
canHide: false,
componentName: 'SuggestProduct.Items',
props: {
...item,
isnull: false
......@@ -849,15 +849,15 @@ const mobileClientEdit: React.FC<ShopPreviewPropsType> = (props) => {
if (item.customize) {
const _ids = item.customize.map((item) => item.id).join(',');
const _detailsData = await PublicApi.getMarketingAdornGoodsListAdorn({ shopId, idInList: _ids, current: '1', pageSize: '100' })
_detailsData.data.data?.forEach((child,childIndex) => {
const _childNewKey = `${_newKey}-${Number(childIndex)+1}`;
_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,
componentName: 'SuggestProduct.Commodity',
props: {
...child,
name: child.name,
......@@ -865,7 +865,7 @@ const mobileClientEdit: React.FC<ShopPreviewPropsType> = (props) => {
mode: 'vertical',
discountPrice: priceFormat(child.min),
buyBtn: false,
tags: item.customize[childIndex].tags,
tags: item.customize.filter((filChild) => filChild.id === child.id)?.[0]?.tags,
},
}
})
......
......@@ -865,7 +865,7 @@ const mobileClientEdit: React.FC<ShopPreviewPropsType> = (props) => {
mode: 'vertical',
discountPrice: priceFormat(child.min),
buyBtn: false,
tags: item.customize[childIndex].tags,
tags: item.customize.filter((filChild) => filChild.id === child.id)?.[0]?.tags,
},
}
})
......
......@@ -168,7 +168,7 @@ const MarketingCardGood: React.FC<MarketingCardGoodProps> = (props: MarketingCar
childNodes: [],
}
item?.list?.forEach((child, childIndex) => {
_groupOriginalPrice = _groupOriginalPrice + Number(child.price) ;
_groupOriginalPrice = _groupOriginalPrice + Number(child.price);
const _childKey = `${_tabKey}-${Number(childIndex) + 1}`;
_pageConfig[_childKey] = {
title: child.productName,
......@@ -215,9 +215,9 @@ const MarketingCardGood: React.FC<MarketingCardGoodProps> = (props: MarketingCar
</div>
<div className={styles['suggestProductCommodity-box']}>
<div className={styles['suggestProductCommodity-box-label']}>商品活动</div>
{_record?.activityList?.map((item) => {
{_record?.activityList?.map((item, index) => {
return (
<div className={styles['suggestProductCommodity-activityList']} onClick={() => {window.open(`/marketing/marketingSearch/preview?id=${item.id}`)}}>
<div className={styles['suggestProductCommodity-activityList']} key={index} onClick={() => { window.open(`/marketing/marketingSearch/preview?id=${item.id}`) }}>
<img src={ActivityImage} />
<div className={styles['suggestProductCommodity-activityList-name']}>{item.name}</div>
<StatusTag title={item.type} type='danger' />
......
......@@ -151,9 +151,9 @@ const SuggestProductCommodity: React.FC<SuggestProductCommodityProps> = (props:
</div>
<div className={styles['suggestProductCommodity-box']}>
<div className={styles['suggestProductCommodity-box-label']}>商品活动</div>
{_record?.activityList?.map((item) => {
{_record?.activityList?.map((item, index) => {
return (
<div className={styles['suggestProductCommodity-activityList']} onClick={() => { _handleToDetailPage(item.id, item.belongType) }}>
<div className={styles['suggestProductCommodity-activityList']} key={index} onClick={() => { _handleToDetailPage(item.id, item.belongType) }}>
<img src={ActivityImage} />
<div className={styles['suggestProductCommodity-activityList-name']}>{item.name}</div>
<StatusTag title={item.type} type='danger' />
......
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