|
|
@@ -56,7 +56,7 @@
|
|
|
视频<el-badge :value="userContentData.videoCount" :max="9999" class="item" type="warning"/>
|
|
|
</span>
|
|
|
<div v-if="activeName === 'video'">
|
|
|
- <el-col v-for="(video, index) in videoList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
+ <el-col v-for="(video, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
<video-card :video="video" />
|
|
|
</el-col>
|
|
|
</div>
|
|
|
@@ -136,7 +136,7 @@ import ImageAlbumCard from '@/components/card/ImageAlbumCard'
|
|
|
import AudioCard from '@/components/card/AudioCard'
|
|
|
|
|
|
import { getUserInfo, getUserFollowing, getUserFollower, checkRelation, followUser, unfollowUser } from "@/api/user";
|
|
|
-import { userVideoList, getUserContentData } from "@/api/video";
|
|
|
+import { getUserContentData, userVideoCard } from "@/api/video";
|
|
|
import { getUserAlbums } from "@/api/image";
|
|
|
import { getUserAudio } from "@/api/audio";
|
|
|
import { userStatus } from "@/api/status";
|
|
|
@@ -159,10 +159,6 @@ export default {
|
|
|
pageSize: 12,
|
|
|
totalSize: 0,
|
|
|
dataList: [],
|
|
|
- videoList: [],
|
|
|
- statusList: [],
|
|
|
- followerList: [],
|
|
|
- followingList: [],
|
|
|
showEmpty: true,
|
|
|
userContentData: null
|
|
|
}
|
|
|
@@ -231,21 +227,9 @@ export default {
|
|
|
handleCurrentChange(pageNumber) {
|
|
|
this.currentPage = pageNumber
|
|
|
if (this.activeName === 'video') {
|
|
|
- this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)
|
|
|
+ this.userVideoListWrapper(this.currentPage, this.userId)
|
|
|
} else if (this.activeName === 'status') {
|
|
|
- this.userStatusListWrapper(this.currentPage, this.userId, this.lastId)
|
|
|
- } 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 => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.followerList = res.data
|
|
|
- }
|
|
|
- })
|
|
|
+ this.userStatusListWrapper(this.currentPage, this.userId)
|
|
|
}
|
|
|
|
|
|
// 回到顶部
|
|
|
@@ -264,10 +248,9 @@ export default {
|
|
|
this.$router.push(path)
|
|
|
},
|
|
|
getData() {
|
|
|
+ this.dataList = []
|
|
|
if (this.activeName === 'video') {
|
|
|
- this.currentPage = 1
|
|
|
- this.lastId = 0
|
|
|
- this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)
|
|
|
+ this.userVideoListWrapper(this.currentPage, this.userId)
|
|
|
} else if (this.activeName === 'image') {
|
|
|
getUserAlbums(this.userId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
@@ -283,8 +266,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
} else if (this.activeName === 'audio') {
|
|
|
- this.currentPage = 1
|
|
|
- this.lastId = 0
|
|
|
getUserAudio(this.userId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
const resData = res.data.list
|
|
|
@@ -299,12 +280,9 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
} else if (this.activeName === 'article') {
|
|
|
- this.currentPage = 1
|
|
|
- this.lastId = 0
|
|
|
+ // todo
|
|
|
} else if (this.activeName === 'status') {
|
|
|
- this.currentPage = 1
|
|
|
- this.lastId = 0
|
|
|
- this.userStatusListWrapper(this.currentPage, this.userId, this.lastId)
|
|
|
+ this.userStatusListWrapper(this.currentPage, this.userId)
|
|
|
}
|
|
|
},
|
|
|
followUser(userId) {
|
|
|
@@ -327,15 +305,13 @@ export default {
|
|
|
sendMessage(userId) {
|
|
|
console.log('发送消息')
|
|
|
},
|
|
|
- userVideoListWrapper(pageNumber, userId, lastId) {
|
|
|
- userVideoList(pageNumber, userId, lastId).then(res => {
|
|
|
+ userVideoListWrapper(pageNumber, userId) {
|
|
|
+ userVideoCard(pageNumber, userId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
const resData = res.data
|
|
|
- this.videoList = resData.list
|
|
|
+ this.dataList = resData.list
|
|
|
this.totalSize = resData.totalSize
|
|
|
- this.lastId = resData.lastId
|
|
|
-
|
|
|
- if (this.videoList.length !== 0) {
|
|
|
+ if (this.dataList.length !== 0) {
|
|
|
this.showEmpty = false
|
|
|
} else {
|
|
|
this.showEmpty = true
|
|
|
@@ -343,11 +319,11 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- userStatusListWrapper(pageNumber, userId, lastId) {
|
|
|
+ userStatusListWrapper(pageNumber, userId) {
|
|
|
userStatus(userId, pageNumber).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
- this.statusList = res.data.list
|
|
|
- if (this.statusList.length === 0) {
|
|
|
+ this.dataList = res.data.list
|
|
|
+ if (this.dataList.length === 0) {
|
|
|
this.showEmpty = true
|
|
|
} else {
|
|
|
this.showEmpty = false
|