Commit fb963007 authored by GuanHua's avatar GuanHua

fix: 店铺装修拼团活动商品修改

parent 6decd525
......@@ -25,6 +25,7 @@ interface Iprops {
products: any[],
activityImage: string,
mode?: 'radio' | 'checked',
disabledKeys?: number[],
}
type SubmitType = {
......@@ -89,7 +90,7 @@ const columns: ColumnsType<GetMarketingAdornMerchantActivityListAdornResponseDet
const ActivityProductDrawer: React.FC<Iprops> = (props: Iprops) => {
const { visible, onCancel, fetchData = null, onOk, products = [], activityImage, mode = 'checked' } = props;
const { visible, onCancel, fetchData = null, onOk, products = [], activityImage, disabledKeys, mode = 'checked' } = props;
const [current, setPage] = useState<number>(1);
const [currentPageSize, setPageSize] = useState<number>(10);
const [dataSource, setDataSource] = useState<GetMarketingAdornMerchantActivityListAdornResponseDetail[]>([]);
......@@ -178,7 +179,10 @@ const ActivityProductDrawer: React.FC<Iprops> = (props: Iprops) => {
const rowSelection = {
type: mode,
onSelect: handleRowSelect,
selectedRowKeys: selectedRowKeys
selectedRowKeys: selectedRowKeys,
getCheckboxProps: (record: any) => ({
disabled: disabledKeys?.includes(record.id), // Column configuration not to be checked
}),
};
const drawerStyle = { background: '#FAFBFC' };
......
......@@ -8,6 +8,7 @@ import { getMarketingAdornActivityGoodsAdorn, getMarketingAdornMerchantActivityL
import StatusTag from '@/components/StatusTag';
import ActivityProductDrawer from '@/pages/editor/components/drawer/activityProductDrawer/activityProductDrawer';
import ActivityImage from '@/assets/couponIcons/ActivityImage.svg';
import useSamLevelProps from '../../../common/hooks/useSameLevelProps';
import { priceFormat } from '@/utils/numberFomat';
import styles from './index.less';
import { LAYOUT_TYPE } from '@/constants';
......@@ -24,7 +25,7 @@ interface MarketingCardGoodProps {
}
const MarketingCardGood: React.FC<MarketingCardGoodProps> = (props: MarketingCardGoodProps) => {
const { id, actType, exType, tags = [], layoutType, pageConfig } = props;
const { id, actType, exType, tags = [], layoutType, selectedKey, pageConfig } = props;
const { query: { shopId } }: any = history.location;
const intl = useIntl()
const [record, setRecord] = useState<any>([]);
......@@ -35,6 +36,7 @@ const MarketingCardGood: React.FC<MarketingCardGoodProps> = (props: MarketingCar
const [editInputValue, setEditInputValue] = useState<any>('');
const [inputValue, setInputValue] = useState<any>('');
const [inputVisible, setInputVisible] = useState(false);
const sameLevelPropsList = useSamLevelProps({ key: selectedKey })
useEffect(() => {
if (id && id != record[0]?.id) {
......@@ -379,6 +381,7 @@ const MarketingCardGood: React.FC<MarketingCardGoodProps> = (props: MarketingCar
onOk={onOk}
fetchData={fetchData}
visible={actVisible}
disabledKeys={sameLevelPropsList ? sameLevelPropsList.map((item) => item.id) : []}
onCancel={() => setActVisible(false)}
mode='radio'
/>
......
......@@ -765,9 +765,13 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
_marketingConfig13[_newKey] = {
key: _newKey,
title: item.productName,
componentName: 'MarketingCard.CollageContainerItem',
componentName: 'MarketingCard.DetailItem',
props: {
...item,
style: {
padding: '8px',
backgroundColor: '#FFF',
},
detail: {
title: item.productName,
img: item.productImgUrl,
......
......@@ -464,6 +464,7 @@ export const marketingConfig_12 = {
},
};
// 拼团
export const marketingConfig_13 = {
'11-13': {
title: `${intl.formatMessage({ id: 'editor.marketing.activity' })}-${intl.formatMessage({ id: 'editor.marketing.type_title_13' })}`,
......@@ -488,12 +489,12 @@ export const marketingConfig_13 = {
title: intl.formatMessage({ id: 'editor.template.activity.goods.container'}),
canEdit: true,
canHide: false,
componentName: 'MarketingCard.CollageContainer',
componentName: 'MarketingCard.VerticalContainer',
props: {
type: 9,
},
childNodes: [],
childComponentName: 'MarketingCard.CollageContainerItem',
childComponentName: 'MarketingCard.DetailItem',
addBtnText: intl.formatMessage({ id: 'editor.template.add.product' }),
},
};
......
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