import React from 'react'; import { connect } from 'dva'; import { Form, Input, Button, Alert, Divider, Statistic } from 'antd'; import styles from './index.less'; import { FormComponentProps } from 'antd/lib/form'; import { IStateType } from '../../model'; import { Dispatch } from 'redux'; const formItemLayout = { labelCol: { span: 5, }, wrapperCol: { span: 19, }, }; interface Step2Props extends FormComponentProps { data?: IStateType['step']; dispatch?: Dispatch; submitting?: boolean; } class Step2 extends React.Component { render() { const { form, data, dispatch, submitting } = this.props; if (!data) { return; } const { getFieldDecorator, validateFields } = form; const onPrev = () => { dispatch && dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/saveCurrentStep', payload: 'info', }); }; const onValidateForm = (e: React.FormEvent) => { e.preventDefault(); validateFields((err, values) => { if (!err) { dispatch && dispatch({ type: 'BLOCK_NAME_CAMEL_CASE/submitStepForm', payload: { ...data, ...values, }, }); } }); }; return (
{data.payAccount} {data.receiverAccount} {data.receiverName} {data.amount} {getFieldDecorator('password', { initialValue: '123456', rules: [ { required: true, message: '需要支付密码才能进行支付', }, ], })()} ); } } export default connect( ({ BLOCK_NAME_CAMEL_CASE, loading, }: { BLOCK_NAME_CAMEL_CASE: IStateType; loading: { effects: { [key: string]: boolean }; }; }) => ({ submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/submitStepForm'], data: BLOCK_NAME_CAMEL_CASE.step, }) )(Form.create()(Step2));