BindingView.js 1.84 KB
Newer Older
陈帅's avatar
陈帅 committed
1
import React, { Component, Fragment } from 'react';
陈帅's avatar
陈帅 committed
2
import { formatMessage, FormattedMessage } from 'umi/locale';
陈帅's avatar
陈帅 committed
3 4
import { Icon, List } from 'antd';

张秀玲's avatar
张秀玲 committed
5
class BindingView extends Component {
陈帅's avatar
陈帅 committed
6 7 8
  getData = () => {
    return [
      {
陈帅's avatar
陈帅 committed
9 10
        title: formatMessage({ id: 'app.settings.binding.taobao' }, {}),
        description: formatMessage({ id: 'app.settings.binding.taobao-description' }, {}),
张秀玲's avatar
张秀玲 committed
11 12 13 14 15
        actions: [
          <a>
            <FormattedMessage id="app.settings.binding.bind" defaultMessage="Bind" />
          </a>,
        ],
陈帅's avatar
陈帅 committed
16 17 18
        avatar: <Icon type="taobao" className="taobao" />,
      },
      {
陈帅's avatar
陈帅 committed
19 20
        title: formatMessage({ id: 'app.settings.binding.alipay' }, {}),
        description: formatMessage({ id: 'app.settings.binding.alipay-description' }, {}),
张秀玲's avatar
张秀玲 committed
21 22 23 24 25
        actions: [
          <a>
            <FormattedMessage id="app.settings.binding.bind" defaultMessage="Bind" />
          </a>,
        ],
陈帅's avatar
陈帅 committed
26 27 28
        avatar: <Icon type="alipay" className="alipay" />,
      },
      {
陈帅's avatar
陈帅 committed
29 30
        title: formatMessage({ id: 'app.settings.binding.dingding' }, {}),
        description: formatMessage({ id: 'app.settings.binding.dingding-description' }, {}),
张秀玲's avatar
张秀玲 committed
31 32 33 34 35
        actions: [
          <a>
            <FormattedMessage id="app.settings.binding.bind" defaultMessage="Bind" />
          </a>,
        ],
陈帅's avatar
陈帅 committed
36 37 38 39
        avatar: <Icon type="dingding" className="dingding" />,
      },
    ];
  };
陈帅's avatar
陈帅 committed
40

陈帅's avatar
陈帅 committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
  render() {
    return (
      <Fragment>
        <List
          itemLayout="horizontal"
          dataSource={this.getData()}
          renderItem={item => (
            <List.Item actions={item.actions}>
              <List.Item.Meta
                avatar={item.avatar}
                title={item.title}
                description={item.description}
              />
            </List.Item>
          )}
        />
      </Fragment>
    );
  }
}
陈帅's avatar
陈帅 committed
61
export default BindingView;