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

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

陈帅's avatar
陈帅 committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
  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>
    );
  }
}
lijiehua's avatar
lijiehua committed
59

陈帅's avatar
陈帅 committed
60
export default BindingView;