diff --git a/src/common/router.js b/src/common/router.js
index fe8226119f2fa9f7abee24d027e03ee731acae07..b90b9b24b23ac77fdc4adcbc96187a506249966e 100644
--- a/src/common/router.js
+++ b/src/common/router.js
@@ -164,7 +164,16 @@ export const getRouterData = (app) => {
component: dynamicWrapper(app, [], () => import('../routes/User/RegisterResult')),
},
'/account/center': {
- component: dynamicWrapper(app, ['list', 'user', 'project'], () => import('../routes/Account/Center')),
+ component: dynamicWrapper(app, ['list', 'user', 'project'], () => import('../routes/Account/Center/Center')),
+ },
+ '/account/center/articles': {
+ component: dynamicWrapper(app, [], () => import('../routes/Account/Center/Articles')),
+ },
+ '/account/center/applications': {
+ component: dynamicWrapper(app, [], () => import('../routes/Account/Center/Applications')),
+ },
+ '/account/center/projects': {
+ component: dynamicWrapper(app, [], () => import('../routes/Account/Center/Projects')),
},
'/account/settings': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/Account/Settings/Info')),
diff --git a/src/routes/Account/Center/Applications.js b/src/routes/Account/Center/Applications.js
new file mode 100644
index 0000000000000000000000000000000000000000..2e042b7f313a01c9ac35ca290648578dcac8058b
--- /dev/null
+++ b/src/routes/Account/Center/Applications.js
@@ -0,0 +1,67 @@
+import React from 'react';
+import { List, Card, Icon, Dropdown, Menu, Avatar, Tooltip } from 'antd';
+import numeral from 'numeral';
+import { formatWan } from '../../../utils/utils';
+import stylesApplications from '../../List/Applications.less';
+
+export default (props) => {
+ const { list } = props;
+ const itemMenu = (
+
+ );
+ const CardInfo = ({ activeUser, newUser }) => (
+
+ );
+ return (
+ (
+
+ ,
+ ,
+ ,
+ ,
+ ]}
+ >
+ }
+ title={item.title}
+ />
+
+
+
+
+
+ )}
+ />
+ );
+};
diff --git a/src/routes/Account/Center/Articles.js b/src/routes/Account/Center/Articles.js
new file mode 100644
index 0000000000000000000000000000000000000000..98bbccefa2322235c0c652255ee6cf1be7dcbe9b
--- /dev/null
+++ b/src/routes/Account/Center/Articles.js
@@ -0,0 +1,57 @@
+import React from 'react';
+import { List, Icon, Avatar, Tag } from 'antd';
+import moment from 'moment';
+import stylesArticles from '../../List/Articles.less';
+import styles from './Articles.less';
+
+export default (props) => {
+ const { list } = props;
+ const IconText = ({ type, text }) => (
+
+
+ {text}
+
+ );
+ const ListContent = ({ data: { content, updatedAt, avatar, owner, href } }) => (
+
+
{content}
+
+
{owner} 发布在
{href}
+
{moment(updatedAt).format('YYYY-MM-DD HH:mm')}
+
+
+ );
+ return (
+ (
+ ,
+ ,
+ ,
+ ]}
+ >
+ {item.title}
+ )}
+ description={
+
+ Ant Design
+ 设计语言
+ 蚂蚁金服
+
+ }
+ />
+
+
+ )}
+ />
+ );
+};
diff --git a/src/routes/Account/Center/Articles.less b/src/routes/Account/Center/Articles.less
new file mode 100644
index 0000000000000000000000000000000000000000..36cdd0c32d1ac12b899bfcc7341bf53fcc5853bc
--- /dev/null
+++ b/src/routes/Account/Center/Articles.less
@@ -0,0 +1,7 @@
+.articleList {
+ :global {
+ .ant-list-item:first-child {
+ padding-top: 0;
+ }
+ }
+}
diff --git a/src/routes/Account/Center/Center.js b/src/routes/Account/Center/Center.js
new file mode 100644
index 0000000000000000000000000000000000000000..28868d1c9a09a5bccbefe2650209bcad3abda84b
--- /dev/null
+++ b/src/routes/Account/Center/Center.js
@@ -0,0 +1,213 @@
+import React, { PureComponent } from 'react';
+import { connect } from 'dva';
+import { Link, routerRedux, Route, Switch, Redirect } from 'dva/router';
+import { Card, Row, Col, Icon, Avatar, Tag, Divider, Spin, Input } from 'antd';
+import { getRoutes } from '../../../utils/utils';
+import styles from './Center.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 Center extends PureComponent {
+ state = {
+ newTags: [],
+ inputVisible: false,
+ inputValue: '',
+ }
+
+ componentDidMount() {
+ const { dispatch } = this.props;
+ this.props.dispatch({
+ type: 'user/fetchCurrent',
+ });
+ dispatch({
+ type: 'list/fetch',
+ payload: {
+ count: 8,
+ },
+ });
+ dispatch({
+ type: 'project/fetchNotice',
+ });
+ }
+
+ onTabChange = (key) => {
+ const { dispatch, match } = this.props;
+ switch (key) {
+ case 'articles':
+ dispatch(routerRedux.push(`${match.url}/articles`));
+ break;
+ case 'applications':
+ dispatch(routerRedux.push(`${match.url}/applications`));
+ break;
+ case 'projects':
+ dispatch(routerRedux.push(`${match.url}/projects`));
+ break;
+ default:
+ break;
+ }
+ }
+
+ showInput = () => {
+ this.setState({ inputVisible: true }, () => this.input.focus());
+ }
+
+ saveInputRef = (input) => {
+ this.input = input;
+ }
+
+ handleInputChange = (e) => {
+ this.setState({ inputValue: e.target.value });
+ }
+
+ handleInputConfirm = () => {
+ const { state } = this;
+ const { inputValue } = state;
+ let { newTags } = state;
+ if (inputValue && newTags.filter(tag => tag.label === inputValue).length === 0) {
+ newTags = [...newTags, { key: `new-${newTags.length}`, label: inputValue }];
+ }
+ this.setState({
+ newTags,
+ inputVisible: false,
+ inputValue: '',
+ });
+ }
+
+ render() {
+ const { newTags, inputVisible, inputValue } = this.state;
+ const { list: { list }, listLoading, currentUser, currentUserLoading,
+ project: { notice }, projectLoading, match, routerData, location } = this.props;
+ const routes = getRoutes(match.path, routerData);
+
+ const operationTabList = [{
+ key: 'articles',
+ tab: 文章 (8),
+ }, {
+ key: 'applications',
+ tab: 应用 (8),
+ }, {
+ key: 'projects',
+ tab: 项目 (8),
+ }];
+
+ return (
+
+
+
+
+ {
+ currentUser && Object.keys(currentUser).length ?
+ (
+
+
+
+
{currentUser.name}
+
{currentUser.signature}
+
+
+
{currentUser.title}
+
{currentUser.group}
+
+ {currentUser.geographic.province.label}
+ {currentUser.geographic.city.label}
+
+
+
+
+
标签
+ {
+ currentUser.tags.concat(newTags).map(item =>
+
{item.label})
+ }
+ {inputVisible && (
+
+ )}
+ {!inputVisible && (
+
+
+
+ )}
+
+
+
+
团队
+
+
+ {
+ notice.map(item => (
+
+
+
+ {item.member}
+
+
+ ))
+ }
+
+
+
+
+ ) : 'loading...'
+ }
+
+
+
+
+
+ {
+ routes.map(item =>
+ (
+ (
+
+ )}
+ exact={item.exact}
+ />
+ )
+ )
+ }
+
+
+
+
+
+
+
+ );
+ }
+}
diff --git a/src/routes/Account/Center/Center.less b/src/routes/Account/Center/Center.less
new file mode 100644
index 0000000000000000000000000000000000000000..1d6738381437034667814c4cce14e209b2b6d481
--- /dev/null
+++ b/src/routes/Account/Center/Center.less
@@ -0,0 +1,96 @@
+@import '~antd/lib/style/themes/default.less';
+@import "../../../utils/utils.less";
+
+.avatarHolder {
+ text-align: center;
+ margin-bottom: 24px;
+
+ & > img {
+ width: 104px;
+ height: 104px;
+ margin-bottom: 20px;
+ }
+
+ .name {
+ font-size: 20px;
+ line-height: 28px;
+ font-weight: 500;
+ color: @heading-color;
+ margin-bottom: 4px;
+ }
+}
+
+.detail {
+ p {
+ margin-bottom: 8px;
+ padding-left: 26px;
+ position: relative;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+ }
+
+ i {
+ position: absolute;
+ height: 14px;
+ width: 14px;
+ left: 0;
+ top: 4px;
+ background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg);
+
+ &.title {
+ background-position: 0 0;
+ }
+
+ &.group {
+ background-position: 0 -22px;
+ }
+
+ &.address {
+ background-position: 0 -44px;
+ }
+ }
+}
+
+.tagsTitle, .teamTitle {
+ font-weight: 500;
+ color: @heading-color;
+ margin-bottom: 12px;
+}
+
+.tags {
+ :global {
+ .ant-tag {
+ margin-bottom: 8px;
+ }
+ }
+}
+
+.team {
+ :global {
+ .ant-avatar {
+ margin-right: 12px;
+ }
+ }
+
+ a {
+ display: block;
+ margin-bottom: 24px;
+ color: @text-color;
+ transition: color .3s;
+ .textOverflow();
+
+ &:hover {
+ color: @primary-color;
+ }
+ }
+}
+
+.tabsCard {
+ :global {
+ .ant-card-head {
+ padding: 0 16px;
+ }
+ }
+}
diff --git a/src/routes/Account/Center/Projects.js b/src/routes/Account/Center/Projects.js
new file mode 100644
index 0000000000000000000000000000000000000000..cf1d9842a756b70429d7618ce71791047a9e645c
--- /dev/null
+++ b/src/routes/Account/Center/Projects.js
@@ -0,0 +1,47 @@
+import React from 'react';
+import { List, Card } from 'antd';
+import moment from 'moment';
+import AvatarList from '../../../components/AvatarList';
+import stylesProjects from '../../List/Projects.less';
+
+export default (props) => {
+ const { list } = props;
+ return (
+ (
+
+ }
+ >
+ {item.title}}
+ description={item.subDescription}
+ />
+
+
{moment(item.updatedAt).fromNow()}
+
+
+ {
+ item.members.map(member => (
+
+ ))
+ }
+
+
+
+
+
+ )}
+ />
+ );
+};