import React, { PureComponent } from 'react';
import { connect } from 'dva';
import moment from 'moment';
import numeral from 'numeral';
import { List, Card, Row, Col, Icon, Dropdown,
Menu, Avatar, Tag, Divider, Tooltip, Spin } from 'antd';
import AvatarList from '../components/AvatarList';
import { formatWan } from '../utils/utils';
import styles from './UserCenter.less';
import stylesArticles from './List/Articles.less';
import stylesApplications from './List/Applications.less';
import stylesProjects from './List/Projects.less';
@connect(({ list, loading, user, project }) => ({
list,
listLoading: loading.effects['list/fetch'],
currentUser: user.currentUser,
currentUserLoading: loading.effects['user/fetchCurrent'],
project,
projectLoading: loading.effects['project/fetchNotice'],
}))
export default class UserCenter extends PureComponent {
state = {
key: 'article',
}
componentDidMount() {
const { dispatch } = this.props;
this.props.dispatch({
type: 'user/fetchCurrent',
});
dispatch({
type: 'list/fetch',
payload: {
count: 8,
},
});
dispatch({
type: 'project/fetchNotice',
});
}
onTabChange = (key) => {
this.setState({ key });
}
renderArticles = (list, loading) => {
const IconText = ({ type, text }) => (
活跃用户
{activeUser}
新增用户
{newUser}
{currentUser.title}
{currentUser.group}
{currentUser.geographic.province.label} {currentUser.geographic.city.label}