Commit 28d9e5c4 authored by 卢均锐's avatar 卢均锐

feat: 营销能力-选择优惠券&修改detaillayout

parent 01a889d4
......@@ -23,6 +23,8 @@ export interface IProps {
effect?: React.ReactNode,
/** 页面的组件 */
components?: React.ReactNode,
/** 隐藏头部分割线 */
hideBreak?: boolean
}
const PeripheralLayout: React.FC<IProps> = (props: any) => {
......@@ -32,6 +34,7 @@ const PeripheralLayout: React.FC<IProps> = (props: any) => {
tabLink,
effect,
components,
hideBreak
} = props;
const dataSource = useContext(Context)
......@@ -71,7 +74,7 @@ const PeripheralLayout: React.FC<IProps> = (props: any) => {
<ArrowLeftOutlined className={style.goBack} onClick={() => history.goBack()} />
<span className={style.titleContext}>
{detail ? detail : dataSource.details}
&nbsp;|&nbsp;
&nbsp;{!hideBreak && '|'}&nbsp;
{no}
</span>
</div>
......
......@@ -6,6 +6,7 @@ import Card from '@/pages/transaction/components/card';
import TableModel from './tableModel';
import AddGoodsDrawer from './modal/addGoodsDrawer';
import AddCouponsDrawer from './modal/addCouponsDrawer';
interface AddFormGoodsProps {
currentRef?: any,
......@@ -26,6 +27,7 @@ const AddFormGoods: React.FC<AddFormGoodsProps> = (props: any) => {
const [form] = Form.useForm();
const [dataSource, setDataSource] = useState<any>([]);
const [visible, setVisible] = useState<boolean>(false);
const [couponVisible, setCouponVisible] = useState<boolean>(false);
const _deleteRow = (index: number) => {
const _dataSource = [...dataSource];
......@@ -68,7 +70,7 @@ const AddFormGoods: React.FC<AddFormGoodsProps> = (props: any) => {
autoComplete='off'
>
<Space direction='vertical' style={{ display: 'flex' }}>
{ruleType != 10 && <Button type="dashed" block icon={<PlusOutlined />} onClick={() => { setVisible(true) }}>选择活动商品</Button>}
{ruleType != 10 && <Button type="dashed" block icon={<PlusOutlined />} onClick={() => { setCouponVisible(true) }}>选择活动商品</Button>}
<Table
columns={columns}
dataSource={dataSource}
......@@ -82,6 +84,10 @@ const AddFormGoods: React.FC<AddFormGoodsProps> = (props: any) => {
effects='name'
onClose={() => { setVisible(false) }}
/>
<AddCouponsDrawer
visible={couponVisible}
onClose={() => { setCouponVisible(false) }}
/>
</Card>
);
}
......
import React, { useRef, useCallback, useEffect, useState } from 'react';
import { Space, Button, Select, Input, Drawer, Row, Col } from 'antd';
const { Search } = Input;
const AddCouponsDrawer = (props: any) => {
const { visible, onClose, onConfirm, effects, fetch } = props;
const _onConfirm = () => {
}
const onSearch = () => {
}
return (
<Drawer
title="选择优惠券"
width={600}
onClose={onClose}
visible={visible}
bodyStyle={{ paddingBottom: 80 }}
footer={
<div style={{ textAlign: 'right', }}>
<Button onClick={onClose} style={{ marginRight: 8 }}>取消</Button>
<Button onClick={_onConfirm} type="primary">确认</Button>
</div>
}
>
<Space style={{ display: 'flex' }} direction='vertical'>
<Row gutter={8}>
<Col>
<Select style={{width: '200px'}}></Select>
</Col>
<Col>
<Search placeholder="搜索" onSearch={onSearch} style={{ width: 200 }} />
</Col>
<Col>
<Button>重置</Button>
</Col>
</Row>
</Space>
</Drawer>
);
}
export default AddCouponsDrawer;
......@@ -23,6 +23,7 @@ const TABLINK = [
]
const Add = () => {
const { query: { id } } = history.location;
const [ruleType, setRuleType] = useState(1);
const [extraType, setExtraType] = useState(1);
......@@ -43,9 +44,11 @@ const Add = () => {
return (
<PeripheralLayout
detail={`${id ? '编辑' : '新增'}营销活动`}
no={<ProgressBar ratio={85} />}
tabLink={TABLINK}
effect={<Button type="primary" onClick={_handleSave}><SaveOutlined /> 保存</Button>}
hideBreak={true}
components={
<>
<AddFormBasicItem currentRef={basicForm} setRuleType={setRuleType} />
......
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