import React, { Component, Fragment } from 'react'; import { Card, Steps } from 'antd'; import { connect } from 'dva'; import PageHeaderWrapper from './components/PageHeaderWrapper'; import Step1 from './components/Step1'; import Step2 from './components/Step2'; import Step3 from './components/Step3'; import styles from './style.less'; import { IStateType } from './model'; const { Step } = Steps; interface PAGE_NAME_UPPER_CAMEL_CASEProps { current: IStateType['current']; } @connect(({ BLOCK_NAME_CAMEL_CASE }: { BLOCK_NAME_CAMEL_CASE: IStateType }) => ({ current: BLOCK_NAME_CAMEL_CASE.current, })) class PAGE_NAME_UPPER_CAMEL_CASE extends Component { getCurrentStep() { const { current } = this.props; switch (current) { case 'info': return 0; case 'confirm': return 1; case 'result': return 2; default: return 0; } } render() { const currentStep = this.getCurrentStep(); let stepComponent; if (currentStep === 1) { stepComponent = ; } else if (currentStep === 2) { stepComponent = ; } else { stepComponent = ; } return ( {stepComponent} ); } } export default PAGE_NAME_UPPER_CAMEL_CASE;