From c58e2078bc06a22d1d71c8eb6ea532bf2248ad9f Mon Sep 17 00:00:00 2001 From: Tuan Duong Date: Thu, 25 Apr 2019 16:45:46 +0700 Subject: [PATCH] feature[profile]: add profile page (#1953) --- src/filters/index.js | 8 + src/icons/svg/education.svg | 1 + src/icons/svg/skill.svg | 1 + src/lang/en.js | 6 +- src/lang/es.js | 6 +- src/lang/zh.js | 6 +- src/layout/components/Navbar.vue | 5 + src/router/index.js | 14 ++ src/views/profile/components/Account.vue | 38 +++++ src/views/profile/components/Activity.vue | 185 ++++++++++++++++++++++ src/views/profile/components/Timeline.vue | 43 +++++ src/views/profile/components/UserCard.vue | 134 ++++++++++++++++ src/views/profile/index.vue | 70 ++++++++ 13 files changed, 511 insertions(+), 6 deletions(-) create mode 100644 src/icons/svg/education.svg create mode 100644 src/icons/svg/skill.svg create mode 100644 src/views/profile/components/Account.vue create mode 100644 src/views/profile/components/Activity.vue create mode 100644 src/views/profile/components/Timeline.vue create mode 100644 src/views/profile/components/UserCard.vue create mode 100644 src/views/profile/index.vue diff --git a/src/filters/index.js b/src/filters/index.js index 051000c1..f6a28488 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -58,3 +58,11 @@ export function numberFormatter(num, digits) { export function toThousandFilter(num) { return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ',')) } + +/** + * Upper case first char + * @param {String} string + */ +export function uppercaseFirst(string) { + return string.charAt(0).toUpperCase() + string.slice(1) +} diff --git a/src/icons/svg/education.svg b/src/icons/svg/education.svg new file mode 100644 index 00000000..7bfb01d1 --- /dev/null +++ b/src/icons/svg/education.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/skill.svg b/src/icons/svg/skill.svg new file mode 100644 index 00000000..a3b73121 --- /dev/null +++ b/src/icons/svg/skill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/lang/en.js b/src/lang/en.js index 426d3d26..ae221ba8 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -61,12 +61,14 @@ export default { theme: 'Theme', clipboardDemo: 'Clipboard', i18n: 'I18n', - externalLink: 'External Link' + externalLink: 'External Link', + profile: 'Profile' }, navbar: { - logOut: 'Log Out', dashboard: 'Dashboard', github: 'Github', + logOut: 'Log Out', + profile: 'Profile', theme: 'Theme', size: 'Global Size' }, diff --git a/src/lang/es.js b/src/lang/es.js index 50b96037..8187bfe7 100755 --- a/src/lang/es.js +++ b/src/lang/es.js @@ -61,14 +61,16 @@ export default { theme: 'Tema', clipboardDemo: 'Clipboard', i18n: 'I18n', - externalLink: 'Enlace externo' + externalLink: 'Enlace externo', + profile: 'Profile' }, navbar: { logOut: 'Salir', dashboard: 'Panel de control', github: 'Github', theme: 'Tema', - size: 'Tamaño global' + size: 'Tamaño global', + profile: 'Profile' }, login: { title: 'Formulario de acceso', diff --git a/src/lang/zh.js b/src/lang/zh.js index 2055c5ab..dee804d2 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -61,12 +61,14 @@ export default { theme: '换肤', clipboardDemo: 'Clipboard', i18n: '国际化', - externalLink: '外链' + externalLink: '外链', + profile: '个人中心' }, navbar: { - logOut: '退出登录', dashboard: '首页', github: '项目地址', + logOut: '退出登录', + profile: '个人中心', theme: '换肤', size: '布局大小' }, diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 51972166..9d5c6658 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -26,6 +26,11 @@ + + + {{ $t('navbar.profile') }} + + {{ $t('navbar.dashboard') }} diff --git a/src/router/index.js b/src/router/index.js index 34afd5c5..d1dfda90 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -107,6 +107,20 @@ export const constantRoutes = [ meta: { title: 'guide', icon: 'guide', noCache: true } } ] + }, + { + path: '/profile', + component: Layout, + redirect: '/profile/index', + hidden: true, + children: [ + { + path: 'index', + component: () => import('@/views/profile/index'), + name: 'Profile', + meta: { title: 'profile', icon: 'user', noCache: true } + } + ] } ] diff --git a/src/views/profile/components/Account.vue b/src/views/profile/components/Account.vue new file mode 100644 index 00000000..9f2e3865 --- /dev/null +++ b/src/views/profile/components/Account.vue @@ -0,0 +1,38 @@ + + + diff --git a/src/views/profile/components/Activity.vue b/src/views/profile/components/Activity.vue new file mode 100644 index 00000000..dd5db3a5 --- /dev/null +++ b/src/views/profile/components/Activity.vue @@ -0,0 +1,185 @@ + + + + + diff --git a/src/views/profile/components/Timeline.vue b/src/views/profile/components/Timeline.vue new file mode 100644 index 00000000..ba90b3d2 --- /dev/null +++ b/src/views/profile/components/Timeline.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/views/profile/components/UserCard.vue b/src/views/profile/components/UserCard.vue new file mode 100644 index 00000000..a8d27513 --- /dev/null +++ b/src/views/profile/components/UserCard.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/src/views/profile/index.vue b/src/views/profile/index.vue new file mode 100644 index 00000000..e54bc718 --- /dev/null +++ b/src/views/profile/index.vue @@ -0,0 +1,70 @@ + + +