|
|
@@ -7,7 +7,7 @@
|
|
|
<el-row>
|
|
|
<el-col :md="1">
|
|
|
<el-avatar>
|
|
|
- <el-image :src="user.avatarUrl"/>
|
|
|
+ <el-image :src="user.avatarUrl" />
|
|
|
</el-avatar>
|
|
|
</el-col>
|
|
|
<el-col :md="23">
|
|
|
@@ -21,7 +21,7 @@
|
|
|
:icon="followButton.icon"
|
|
|
@click="followUser(user.userId)"
|
|
|
>
|
|
|
- <span>{{followButton.text}}</span>
|
|
|
+ <span>{{ followButton.text }}</span>
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
@@ -39,24 +39,24 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :md="24" class="movie-list">
|
|
|
- <el-tabs v-model="activeName" @tab-click='tabClick'>
|
|
|
+ <el-tabs v-model="activeName" @tab-click="tabClick">
|
|
|
<el-tab-pane name="following">
|
|
|
<span slot="label">
|
|
|
- Ta 的关注<el-badge :value="this.user.following" :max="9999" class="item" type="warning"/>
|
|
|
+ Ta 的关注<el-badge :value="this.user.following" :max="9999" class="item" type="warning" />
|
|
|
</span>
|
|
|
<div v-if="activeName === 'following'">
|
|
|
<el-col v-for="(user, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
- <user-avatar-card :userAvatar="user"></user-avatar-card>
|
|
|
+ <user-avatar-card :user-avatar="user" />
|
|
|
</el-col>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane name="follower">
|
|
|
<span slot="label">
|
|
|
- Ta 的粉丝<el-badge :value="this.user.follower" :max="9999" class="item" type="warning"/>
|
|
|
+ Ta 的粉丝<el-badge :value="this.user.follower" :max="9999" class="item" type="warning" />
|
|
|
</span>
|
|
|
<div v-if="activeName === 'follower'">
|
|
|
<el-col v-for="(user, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
- <user-card :user="user"></user-card>
|
|
|
+ <user-card :user="user" />
|
|
|
</el-col>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
@@ -89,7 +89,7 @@
|
|
|
<script>
|
|
|
import UserAvatarCard from '@/components/card/UserAvatarCard'
|
|
|
|
|
|
-import { getUserInfo, getUserFollowing, getUserFollower, checkRelation, followUser, unfollowUser } from "@/api/user";
|
|
|
+import { getUserInfo, getUserFollowing, getUserFollower, checkRelation, followUser, unfollowUser } from '@/api/user'
|
|
|
|
|
|
export default {
|
|
|
name: 'Home',
|
|
|
@@ -109,7 +109,12 @@ export default {
|
|
|
pageSize: 12,
|
|
|
totalSize: 0,
|
|
|
dataList: [],
|
|
|
- showEmpty: true,
|
|
|
+ showEmpty: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ $route() {
|
|
|
+ this.$router.go()
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -118,10 +123,10 @@ export default {
|
|
|
if (res.code === 0) {
|
|
|
this.user = res.data
|
|
|
const path = this.$route.path
|
|
|
- if (path.endsWith("following")) {
|
|
|
+ if (path.endsWith('following')) {
|
|
|
this.activeName = 'following'
|
|
|
document.title = this.user.screenName + '的关注'
|
|
|
- } else if (path.endsWith("follower")) {
|
|
|
+ } else if (path.endsWith('follower')) {
|
|
|
this.activeName = 'follower'
|
|
|
document.title = this.user.screenName + '的粉丝'
|
|
|
} else {
|
|
|
@@ -148,16 +153,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- watch: {
|
|
|
- $route(){
|
|
|
- this.$router.go()
|
|
|
- }
|
|
|
- },
|
|
|
methods: {
|
|
|
handleCurrentChange(pageNumber) {
|
|
|
this.currentPage = pageNumber
|
|
|
this.getData()
|
|
|
- /*if (this.activeName === 'following') {
|
|
|
+ /* if (this.activeName === 'following') {
|
|
|
getUserFollowing(this.userId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
this.dataList = res.data
|