BindingView.js 1.91 KB
Newer Older
陈帅's avatar
陈帅 committed
1
import React, { Component, Fragment } from 'react';
张秀玲's avatar
张秀玲 committed
2
import { injectIntl, FormattedMessage } from 'react-intl';
陈帅's avatar
陈帅 committed
3 4
import { Icon, List } from 'antd';

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

陈帅's avatar
陈帅 committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
  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
62
export default injectIntl(BindingView);