|
@@ -33,12 +33,16 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<span v-if="user.signature !== null">{{user.signature}}</span>
|
|
<span v-if="user.signature !== null">{{user.signature}}</span>
|
|
|
- <span v-if="user.signature === undefined || user.signature === null">此用户没有签名</span>
|
|
|
|
|
|
|
+ <span v-if="user.signature === undefined || user.signature === null">没有签名</span>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
- <span class="el-icon-user">关注数: {{ user.followingCount }}</span>
|
|
|
|
|
|
|
+ <router-link target="_blank" :to="`/user/${user.userId}/following`">
|
|
|
|
|
+ <span class="el-icon-user">关注数: {{ user.following }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
<span v-html="' '" />
|
|
<span v-html="' '" />
|
|
|
- <span class="el-icon-user">粉丝数: {{ user.followerCount }}</span>
|
|
|
|
|
|
|
+ <router-link target="_blank" :to="`/user/${user.userId}/follower`">
|
|
|
|
|
+ <span class="el-icon-user">粉丝数: {{ user.follower }}</span>
|
|
|
|
|
+ </router-link>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</div>
|
|
</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
@@ -72,52 +76,31 @@
|
|
|
音频<el-badge :value="userContentData.audioCount" :max="9999" class="item" type="warning"/>
|
|
音频<el-badge :value="userContentData.audioCount" :max="9999" class="item" type="warning"/>
|
|
|
</span>
|
|
</span>
|
|
|
<div v-if="activeName === 'audio'">
|
|
<div v-if="activeName === 'audio'">
|
|
|
- <el-col v-for="(video, index) in videoList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
|
|
- <video-card :video="video" />
|
|
|
|
|
|
|
+ <el-col v-for="(audio, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
|
|
+ <audio-card :audio="audio"></audio-card>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</div>
|
|
</div>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
- <!--
|
|
|
|
|
<el-tab-pane name="article">
|
|
<el-tab-pane name="article">
|
|
|
<span slot="label">
|
|
<span slot="label">
|
|
|
文章<el-badge :value="userContentData.articleCount" :max="9999" class="item" type="warning"/>
|
|
文章<el-badge :value="userContentData.articleCount" :max="9999" class="item" type="warning"/>
|
|
|
</span>
|
|
</span>
|
|
|
<div v-if="activeName === 'article'">
|
|
<div v-if="activeName === 'article'">
|
|
|
- <el-col v-for="(video, index) in videoList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
|
|
- <video-card :video="video" />
|
|
|
|
|
|
|
+ <el-col v-for="(article, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
|
|
+ <span>发布的文章</span>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</div>
|
|
</div>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane name="status">
|
|
|
|
|
|
|
+<!-- <el-tab-pane name="status">
|
|
|
<span slot="label">
|
|
<span slot="label">
|
|
|
状态<el-badge :value="userContentData.statusCount" :max="9999" class="item" type="warning"/>
|
|
状态<el-badge :value="userContentData.statusCount" :max="9999" class="item" type="warning"/>
|
|
|
</span>
|
|
</span>
|
|
|
<div v-if="activeName === 'status'">
|
|
<div v-if="activeName === 'status'">
|
|
|
- <el-row v-for="(status, index) in statusList" :key="index" :md="16" :sm="12" :xs="12">
|
|
|
|
|
- <status-card :status="status" />
|
|
|
|
|
- </el-row>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-tab-pane>-->
|
|
|
|
|
- <el-tab-pane name="following">
|
|
|
|
|
- <span slot="label">
|
|
|
|
|
- Ta 的关注<el-badge :value="userContentData.userFollowCount.followingCount" :max="9999" class="item" type="warning"/>
|
|
|
|
|
- </span>
|
|
|
|
|
- <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 v-for="(status, index) in dataList" :key="index" :md="16" :sm="12" :xs="12">
|
|
|
|
|
+ <span>发布的状态</span>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</div>
|
|
</div>
|
|
|
- </el-tab-pane>
|
|
|
|
|
- <el-tab-pane name="follower">
|
|
|
|
|
- <span slot="label">
|
|
|
|
|
- Ta 的粉丝<el-badge :value="userContentData.userFollowCount.followerCount" :max="9999" class="item" type="warning"/>
|
|
|
|
|
- </span>
|
|
|
|
|
- <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-tab-pane>-->
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="24" class="pagination">
|
|
<el-col :span="24" class="pagination">
|
|
@@ -150,15 +133,17 @@ import UserCard from '@/components/card/UserCard'
|
|
|
import StatusCard from '@/components/card/StatusCard'
|
|
import StatusCard from '@/components/card/StatusCard'
|
|
|
import VideoCard from '@/components/card/VideoCard'
|
|
import VideoCard from '@/components/card/VideoCard'
|
|
|
import ImageAlbumCard from '@/components/card/ImageAlbumCard'
|
|
import ImageAlbumCard from '@/components/card/ImageAlbumCard'
|
|
|
|
|
+import AudioCard from '@/components/card/AudioCard'
|
|
|
|
|
|
|
|
import { getUserInfo, getUserFollowing, getUserFollower, checkRelation, followUser, unfollowUser } from "@/api/user";
|
|
import { getUserInfo, getUserFollowing, getUserFollower, checkRelation, followUser, unfollowUser } from "@/api/user";
|
|
|
import { userVideoList, getUserContentData } from "@/api/video";
|
|
import { userVideoList, getUserContentData } from "@/api/video";
|
|
|
import { getUserAlbums } from "@/api/image";
|
|
import { getUserAlbums } from "@/api/image";
|
|
|
|
|
+import { getUserAudio } from "@/api/audio";
|
|
|
import { userStatus } from "@/api/status";
|
|
import { userStatus } from "@/api/status";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'Home',
|
|
name: 'Home',
|
|
|
- components: { UserCard, StatusCard, VideoCard, ImageAlbumCard },
|
|
|
|
|
|
|
+ components: { UserCard, StatusCard, VideoCard, ImageAlbumCard, AudioCard },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
// 屏幕宽度, 为了控制分页条的大小
|
|
// 屏幕宽度, 为了控制分页条的大小
|
|
@@ -200,19 +185,15 @@ export default {
|
|
|
} else if (path.endsWith("article")) {
|
|
} else if (path.endsWith("article")) {
|
|
|
this.activeName = 'article'
|
|
this.activeName = 'article'
|
|
|
document.title = this.user.screenName + '的文章'
|
|
document.title = this.user.screenName + '的文章'
|
|
|
- } else if (path.endsWith("following")) {
|
|
|
|
|
- this.activeName = 'following'
|
|
|
|
|
- document.title = this.user.screenName + '的关注'
|
|
|
|
|
- } else if (path.endsWith("follower")) {
|
|
|
|
|
- this.activeName = 'follower'
|
|
|
|
|
- document.title = this.user.screenName + '的粉丝'
|
|
|
|
|
|
|
+ } else if (path.endsWith("status")) {
|
|
|
|
|
+ this.activeName = 'status'
|
|
|
|
|
+ document.title = this.user.screenName + '的状态'
|
|
|
} else {
|
|
} else {
|
|
|
document.title = this.user.screenName + '的个人主页'
|
|
document.title = this.user.screenName + '的个人主页'
|
|
|
}
|
|
}
|
|
|
this.getData()
|
|
this.getData()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
checkRelation(this.userId).then(res => {
|
|
checkRelation(this.userId).then(res => {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
@@ -221,7 +202,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
getUserContentData(this.userId).then(res => {
|
|
getUserContentData(this.userId).then(res => {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
this.userContentData = res.data
|
|
this.userContentData = res.data
|
|
@@ -273,26 +253,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
tabClick(tab) {
|
|
tabClick(tab) {
|
|
|
this.activeName = tab.name
|
|
this.activeName = tab.name
|
|
|
- if (this.activeName === 'status') {
|
|
|
|
|
- const path = '/user/' + this.userId
|
|
|
|
|
- if (this.$route.path === path) {
|
|
|
|
|
- this.$router.go(0)
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- this.$router.push(path)
|
|
|
|
|
- } else if (this.activeName === 'video') {
|
|
|
|
|
- this.goToTab(this.activeName)
|
|
|
|
|
- } else if (this.activeName === 'image') {
|
|
|
|
|
- this.goToTab(this.activeName)
|
|
|
|
|
- } else if (this.activeName === 'audio') {
|
|
|
|
|
- this.goToTab(this.activeName)
|
|
|
|
|
- } else if (this.activeName === 'article') {
|
|
|
|
|
- this.goToTab(this.activeName)
|
|
|
|
|
- } else if (this.activeName === 'following') {
|
|
|
|
|
- this.goToTab(this.activeName)
|
|
|
|
|
- } else if (this.activeName === 'follower') {
|
|
|
|
|
- this.goToTab(this.activeName)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.goToTab(this.activeName)
|
|
|
},
|
|
},
|
|
|
goToTab(activeName) {
|
|
goToTab(activeName) {
|
|
|
const path = '/user/' + this.userId + '/' + activeName
|
|
const path = '/user/' + this.userId + '/' + activeName
|
|
@@ -303,11 +264,7 @@ export default {
|
|
|
this.$router.push(path)
|
|
this.$router.push(path)
|
|
|
},
|
|
},
|
|
|
getData() {
|
|
getData() {
|
|
|
- if (this.activeName === 'status') {
|
|
|
|
|
- this.currentPage = 1
|
|
|
|
|
- this.lastId = 0
|
|
|
|
|
- this.userStatusListWrapper(this.currentPage, this.userId, this.lastId)
|
|
|
|
|
- } else if (this.activeName === 'video') {
|
|
|
|
|
|
|
+ if (this.activeName === 'video') {
|
|
|
this.currentPage = 1
|
|
this.currentPage = 1
|
|
|
this.lastId = 0
|
|
this.lastId = 0
|
|
|
this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)
|
|
this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)
|
|
@@ -328,21 +285,26 @@ export default {
|
|
|
} else if (this.activeName === 'audio') {
|
|
} else if (this.activeName === 'audio') {
|
|
|
this.currentPage = 1
|
|
this.currentPage = 1
|
|
|
this.lastId = 0
|
|
this.lastId = 0
|
|
|
- } else if (this.activeName === 'article') {
|
|
|
|
|
- this.currentPage = 1
|
|
|
|
|
- this.lastId = 0
|
|
|
|
|
- } else if (this.activeName === 'following') {
|
|
|
|
|
- getUserFollowing(this.userId).then(res => {
|
|
|
|
|
- if (res.code === 0) {
|
|
|
|
|
- this.followingList = res.data
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- } else if (this.activeName === 'follower') {
|
|
|
|
|
- getUserFollower(this.userId).then(res => {
|
|
|
|
|
|
|
+ getUserAudio(this.userId).then(res => {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
- this.followerList = res.data
|
|
|
|
|
|
|
+ const resData = res.data.list
|
|
|
|
|
+ if (resData.length !== 0) {
|
|
|
|
|
+ this.showEmpty = false
|
|
|
|
|
+ for (const item of resData) {
|
|
|
|
|
+ this.dataList.push(item)
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.showEmpty = true
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ } else if (this.activeName === 'article') {
|
|
|
|
|
+ this.currentPage = 1
|
|
|
|
|
+ this.lastId = 0
|
|
|
|
|
+ } else if (this.activeName === 'status') {
|
|
|
|
|
+ this.currentPage = 1
|
|
|
|
|
+ this.lastId = 0
|
|
|
|
|
+ this.userStatusListWrapper(this.currentPage, this.userId, this.lastId)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
followUser(userId) {
|
|
followUser(userId) {
|