|
|
@@ -36,13 +36,9 @@
|
|
|
<span v-if="user.intro === undefined || user.intro === null">此用户没有签名</span>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <router-link target="_blank" :to="`/user/` + user.userId + '/following'">
|
|
|
- <span class="el-icon-user">关注数: {{ user.followingCount }}</span>
|
|
|
- </router-link>
|
|
|
+ <span class="el-icon-user">关注数: {{ user.followingCount }}</span>
|
|
|
<span v-html="' '" />
|
|
|
- <router-link target="_blank" :to="`/user/` + user.userId + '/follower'">
|
|
|
- <span class="el-icon-user">粉丝数: {{ user.followerCount }}</span>
|
|
|
- </router-link>
|
|
|
+ <span class="el-icon-user">粉丝数: {{ user.followerCount }}</span>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
@@ -65,6 +61,20 @@
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
+ <el-tab-pane label="Ta 的关注" name="following">
|
|
|
+ <div v-if="activeName === 'following'">
|
|
|
+ <el-col v-for="(user, index) in followingList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
+ <user-card :user="user"></user-card>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="Ta 的粉丝" name="follower">
|
|
|
+ <div v-if="activeName === 'follower'">
|
|
|
+ <el-col v-for="(user, index) in followerList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
+ <user-card :user="user"></user-card>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="pagination">
|
|
|
@@ -91,15 +101,16 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import UserCard from '@/components/card/UserCard'
|
|
|
import StatusCard from '@/components/card/StatusCard'
|
|
|
import VideoCard from '@/components/card/VideoCard'
|
|
|
-import { getUserInfo, checkRelation, followUser, unfollowUser } from "@/api/user";
|
|
|
+import { getUserInfo, getUserFollowing, getUserFollower, checkRelation, followUser, unfollowUser } from "@/api/user";
|
|
|
import { userVideoList } from "@/api/video";
|
|
|
import { userStatus } from "@/api/status";
|
|
|
|
|
|
export default {
|
|
|
name: 'Home',
|
|
|
- components: { StatusCard, VideoCard },
|
|
|
+ components: { UserCard, StatusCard, VideoCard },
|
|
|
data() {
|
|
|
return {
|
|
|
// 屏幕宽度, 为了控制分页条的大小
|
|
|
@@ -116,6 +127,8 @@ export default {
|
|
|
totalPages: 0,
|
|
|
videoList: [],
|
|
|
statusList: [],
|
|
|
+ followerList: [],
|
|
|
+ followingList: [],
|
|
|
showEmpty: false
|
|
|
}
|
|
|
},
|
|
|
@@ -169,7 +182,6 @@ export default {
|
|
|
if (tabName === 'video') {
|
|
|
console.log('获取视频')
|
|
|
} else if (tabName === 'status') {
|
|
|
- console.log('获取状态')
|
|
|
userStatus(this.userId, 1).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
this.statusList = res.data.list
|
|
|
@@ -180,6 +192,18 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ } else if (tabName === 'following') {
|
|
|
+ getUserFollowing(this.userId).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.followingList = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (tabName === 'follower') {
|
|
|
+ getUserFollower(this.userId).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.followerList = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
followUser(userId) {
|