import React, { Fragment } from 'react'; import { connect } from 'dva'; import { Form, Input, Button, Select, Divider } from 'antd'; import styles from './index.less'; import { FormComponentProps } from 'antd/lib/form'; import { IStateType } from '../../model'; import { Dispatch } from 'redux'; const { Option } = Select; const formItemLayout = { labelCol: { span: 5, }, wrapperCol: { span: 19, }, }; interface Step1Props extends FormComponentProps { data?: IStateType['step']; dispatch?: Dispatch; } class Step1 extends React.PureComponent { render() { const { form, dispatch, data } = this.props; if (!data) { return; } const { getFieldDecorator, validateFields } = form; const onValidateForm = () => { validateFields((err, values) => { if (!err && dispatch) { dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/saveStepFormData', payload: values, }); dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/saveCurrentStep', payload: 'confirm', }); } }); }; return (
{getFieldDecorator('payAccount', { initialValue: data.payAccount, rules: [{ required: true, message: '请选择付款账户' }], })( , )} {getFieldDecorator('receiverAccount', { initialValue: data.receiverAccount, rules: [ { required: true, message: '请输入收款人账户' }, { type: 'email', message: '账户名应为邮箱格式' }, ], })()} {getFieldDecorator('receiverName', { initialValue: data.receiverName, rules: [{ required: true, message: '请输入收款人姓名' }], })()} {getFieldDecorator('amount', { initialValue: data.amount, rules: [ { required: true, message: '请输入转账金额' }, { pattern: /^(\d+)((?:\.\d+)?)$/, message: '请输入合法金额数字', }, ], })()}

说明

转账到支付宝账户

如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。

转账到银行卡

如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。

); } } export default connect(({ BLOCK_NAME_CAMEL_CASE }: { BLOCK_NAME_CAMEL_CASE: IStateType }) => ({ data: BLOCK_NAME_CAMEL_CASE.step, }))(Form.create()(Step1));