Commit 337ce82f authored by GuanHua's avatar GuanHua
parents b098bc05 e3841e40
......@@ -131,7 +131,7 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
return (
<Drawer
width={1200}
title={'选择活动'}
title={'选择商品'}
visible={visible}
onClose={onClose}
footer={
......
......@@ -44,7 +44,7 @@ const CommoditySchema: ISchema = {
type: 'string',
'x-component': 'CustomInputSearch',
'x-component-props': {
placeholder: '商品品牌',
placeholder: '品牌',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
......@@ -59,7 +59,7 @@ const CommoditySchema: ISchema = {
type: 'string',
'x-component': 'CustomCategorySearch',
'x-component-props': {
placeholder: '平台品类',
placeholder: '品类',
showSearch: true,
notFoundContent: null,
style: { width: '174px' },
......
......@@ -10,6 +10,7 @@ import { priceFormat } from '@/utils/numberFomat';
import MixDrawer from '@/pages/pageCustomized/components/drawers/mixDrawer';
import ActivityDrawer from '@/pages/pageCustomized/components/drawers/activityDrawer';
import CommodityDrawer from '@/pages/pageCustomized/components/drawers/commodityDrawer';
import uploadImgIcon from '@/asserts/icons/upload_img_icon.svg'
......@@ -85,6 +86,7 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
const { name, img, id, type, property = 2, selectedKey } = props;
const [mixVisible, setMixVisible] = useState<boolean>(false);
const [actVisible, setActVisible] = useState<boolean>(false);
const [commodityVisible, setCommodityVisible] = useState<boolean>(false);
const [record, setRecord] = useState<any>();
const _fetch: any = useMemo(() => {
......@@ -222,8 +224,15 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
setActVisible(false);
}
const _onCommodityClose = () => {
setCommodityVisible(false);
}
const _onChoose = () => {
switch (type) {
case 1:
setCommodityVisible(true);
break;
case 2:
setActVisible(true);
break;
......@@ -237,6 +246,9 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
const _onChooseConfirm = (record) => {
setRecord(record);
switch (type) {
case 1:
_onCommodityClose();
break;
case 2:
changeProps({
props: Object.assign({ ...props }, { id: record.id, isnull: _isNull([name, img, type]) })
......@@ -321,6 +333,12 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
onClose={_onActClose}
onConfirm={_onChooseConfirm}
/>
<CommodityDrawer
selectId={id}
visible={commodityVisible}
onClose={_onCommodityClose}
onConfirm={_onChooseConfirm}
/>
</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