Commit fb963007 authored by GuanHua's avatar GuanHua

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

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