index.tsx 2.23 KB
Newer Older
陈帅's avatar
陈帅 committed
1
import React, { Fragment } from 'react';
WhatAKitty's avatar
WhatAKitty committed
2
import { connect } from 'dva';
3
import { Button, Row, Col } from 'antd';
陈帅's avatar
陈帅 committed
4
import Result from '../Result';
5
import styles from './index.less';
陈帅's avatar
陈帅 committed
6 7
import { IStateType } from '../../model';
import { Dispatch } from 'redux';
8

陈帅's avatar
陈帅 committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
interface Step3Props {
  data?: IStateType['step'];
  dispatch?: Dispatch;
}

@connect(
  ({
    BLOCK_NAME_CAMEL_CASE,
  }: {
    BLOCK_NAME_CAMEL_CASE: IStateType;
    loading: {
      effects: { [key: string]: boolean };
    };
  }) => ({
    data: BLOCK_NAME_CAMEL_CASE.step,
  })
)
class Step3 extends React.Component<Step3Props> {
WhatAKitty's avatar
WhatAKitty committed
27
  render() {
28
    const { data, dispatch } = this.props;
陈帅's avatar
陈帅 committed
29 30 31
    if (!data) {
      return;
    }
WhatAKitty's avatar
WhatAKitty committed
32
    const onFinish = () => {
陈帅's avatar
陈帅 committed
33 34 35 36 37
      dispatch &&
        dispatch({
          type: 'BLOCK_NAME_CAMEL_CASE/saveCurrentStep',
          payload: 'info',
        });
WhatAKitty's avatar
WhatAKitty committed
38 39 40 41
    };
    const information = (
      <div className={styles.information}>
        <Row>
jim's avatar
jim committed
42
          <Col xs={24} sm={8} className={styles.label}>
jim's avatar
jim committed
43 44
            付款账户:
          </Col>
jim's avatar
jim committed
45 46 47
          <Col xs={24} sm={16}>
            {data.payAccount}
          </Col>
WhatAKitty's avatar
WhatAKitty committed
48 49
        </Row>
        <Row>
jim's avatar
jim committed
50
          <Col xs={24} sm={8} className={styles.label}>
jim's avatar
jim committed
51 52
            收款账户:
          </Col>
jim's avatar
jim committed
53 54 55
          <Col xs={24} sm={16}>
            {data.receiverAccount}
          </Col>
WhatAKitty's avatar
WhatAKitty committed
56 57
        </Row>
        <Row>
jim's avatar
jim committed
58
          <Col xs={24} sm={8} className={styles.label}>
jim's avatar
jim committed
59 60
            收款人姓名:
          </Col>
jim's avatar
jim committed
61 62 63
          <Col xs={24} sm={16}>
            {data.receiverName}
          </Col>
WhatAKitty's avatar
WhatAKitty committed
64 65
        </Row>
        <Row>
jim's avatar
jim committed
66
          <Col xs={24} sm={8} className={styles.label}>
jim's avatar
jim committed
67 68
            转账金额:
          </Col>
jim's avatar
jim committed
69
          <Col xs={24} sm={16}>
jim's avatar
jim committed
70 71
            <span className={styles.money}>{data.amount}</span>
          </Col>
WhatAKitty's avatar
WhatAKitty committed
72 73 74 75
        </Row>
      </div>
    );
    const actions = (
陈帅's avatar
陈帅 committed
76
      <Fragment>
WhatAKitty's avatar
WhatAKitty committed
77 78 79
        <Button type="primary" onClick={onFinish}>
          再转一笔
        </Button>
jim's avatar
jim committed
80
        <Button>查看账单</Button>
陈帅's avatar
陈帅 committed
81
      </Fragment>
WhatAKitty's avatar
WhatAKitty committed
82 83 84 85 86 87 88 89 90 91 92 93 94
    );
    return (
      <Result
        type="success"
        title="操作成功"
        description="预计两小时内到账"
        extra={information}
        actions={actions}
        className={styles.result}
      />
    );
  }
}
lijiehua's avatar
lijiehua committed
95 96

export default Step3;