Commit 7b3c13c3 authored by 卢均锐's avatar 卢均锐

Merge branch 'v2' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into v2

* 'v2' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform: fix: 店铺装修优惠券可以重复选择的问题修复
parents bc7fbd12 f000e350
......@@ -25,12 +25,13 @@ interface CouponsDrawerProps {
onClose: () => void,
onConfirm?: (record) => void,
selectId?: number,
disabledKeys?: number[],
// 1平台,2商家
belongType?: 1 | 2
}
const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps) => {
const { visible, onClose, onConfirm, selectId } = props;
const { visible, onClose, onConfirm, disabledKeys, selectId } = props;
const { query: { shopId } }: any = history.location
const [type, setType] = useState(2);
const [selectedRowKeys, setSelectedRowKeys] = useState<any>(selectId ? [selectId] : []);
......@@ -135,7 +136,10 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
setSelectedRows(selectedRows);
setSelectedRowKeys(selectedRowKeys)
},
type: 'radio'
type: 'radio',
getCheckboxProps: (record: any) => ({
disabled: disabledKeys?.includes(record.id), // Column configuration not to be checked
}),
}
const drawerStyle = { background: '#FAFBFC' };
......
......@@ -334,7 +334,7 @@ const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
setSelectedRows(selectedRows);
setSelectedRowKeys(selectedRowKeys)
},
type: selectType
type: selectType,
}
useEffect(() => {
......
......@@ -5,9 +5,8 @@ import moment from 'moment';
import { postMarketingCouponActivityPageSelectDetail } from '@/services/MarketingV2Api';
import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat'
import useSamLevelProps from '../../../common/hooks/useSameLevelProps';
import CouponsDrawer from '@/pages/editor/components/drawer/couponsDrawer';
import styles from './index.less';
interface MarketingCardCouponProps {
......@@ -21,6 +20,7 @@ const MarketingCardCoupon: React.FC<MarketingCardCouponProps> = (props: Marketin
const { id, belongType, selectedKey } = props;
const [drawerVisible, setDrawerVisible] = useState(false);
const [record, setRecord] = useState<any>();
const sameLevelPropsList = useSamLevelProps({ key: selectedKey })
useEffect(() => {
changeStylesByKey({
......@@ -104,6 +104,7 @@ const MarketingCardCoupon: React.FC<MarketingCardCouponProps> = (props: Marketin
belongType={belongType}
onClose={_onClose}
onConfirm={_onChooseConfirm}
disabledKeys={sameLevelPropsList ? sameLevelPropsList.map((item) => item.id) : []}
selectId={id}
/>
</div>
......
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