Skip to content

Commit a03bed5

Browse files
committed
add user homepage style
Signed-off-by: zhangtianli2006 <49156174+zhangtianli2006@users.noreply.github.com>
1 parent 811a6f6 commit a03bed5

File tree

4 files changed

+39
-14
lines changed

4 files changed

+39
-14
lines changed

src/components/lib/AjaxTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default {
4444
this.loading = false;
4545
})
4646
.catch(err => {
47-
this.$message.error('[Ajax Table] Request Failed.');
47+
this.$SegmentMessage.error(this, '[Ajax Table] Request Failed.');
4848
console.log(err);
4949
});
5050
}

src/components/page/navbar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</el-avatar>
2424
</template>
2525
<div v-if="this.$store.state.user.authenticated">
26-
<el-menu-item>
26+
<el-menu-item :index="'/account/' + $store.state.user.userid">
2727
{{this.$store.state.user.username}}
2828
</el-menu-item>
2929
<UserLogout v-if="$store.state.user.showlogout" />

src/components/user/content.vue

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
<template>
2-
<div>
3-
<span class="text-extra-big">{{username}} </span>
4-
<span>{{email}}</span>
5-
<br>
6-
<span class="text-extra-big">Introduction</span>
7-
<div class="introduction">
8-
<MarkdownContainer v-if="introduction" :content="introduction"/>
2+
<div id="user-content">
3+
<div>
4+
<el-card shadow="never">
5+
<el-avatar shape="square" icon="el-icon-user-solid" :size="400"></el-avatar>
6+
</el-card>
7+
</div>
8+
<div id="info">
9+
<el-card shadow="never">
10+
<div slot="header" class="clearfix">User Name</div>
11+
{{username}}
12+
</el-card>
13+
<el-card shadow="never" class="item">
14+
<div slot="header" class="clearfix">Email</div>
15+
{{email}}
16+
</el-card>
17+
<el-card shadow="never" class="item">
18+
<div slot="header" class="clearfix">Sloved</div>
19+
{{solved}}
20+
</el-card>
21+
<el-card shadow="never" class="item">
22+
<div slot="header" class="clearfix">Introduction</div>
23+
<MarkdownContainer v-if="introduction" :content="introduction"/>
24+
</el-card>
925
</div>
1026
</div>
1127
</template>
@@ -32,6 +48,7 @@ export default {
3248
this.username = data.username;
3349
this.email = data.email;
3450
this.introduction = data.introduction;
51+
this.solved = data.solved;
3552
})
3653
.catch(err => {
3754
if(err.request.status === 404) {
@@ -52,8 +69,16 @@ export default {
5269
</script>
5370

5471
<style scoped>
55-
.introduction {
56-
border: dashed 1px rgb(189, 189, 189);
57-
padding: 15px;
72+
.item {
73+
margin-top: 20px;
74+
}
75+
76+
#info {
77+
margin-left: 30px;
78+
width: 800px;
79+
}
80+
81+
#user-content {
82+
display: flex;
5883
}
59-
</style>
84+
</style>

src/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let router = new Router({
88
path: '/',
99
component: () => import('./components/home/page.vue')
1010
}, {
11-
path: '/user/:id',
11+
path: '/account/:id',
1212
component: () => import('./components/user/content.vue')
1313
}, {
1414
path: '/problem/list',

0 commit comments

Comments
 (0)