|
@@ -77,7 +77,7 @@
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
<el-tab-pane name="image">
|
|
<el-tab-pane name="image">
|
|
|
<span slot="label">
|
|
<span slot="label">
|
|
|
- 相册<el-badge :value="userContentData.albumCount" :max="9999" class="item" type="warning" />
|
|
|
|
|
|
|
+ 图片<el-badge :value="userContentData.imageCount" :max="9999" class="item" type="warning" />
|
|
|
</span>
|
|
</span>
|
|
|
<div v-if="activeName === 'image'">
|
|
<div v-if="activeName === 'image'">
|
|
|
<el-col v-for="(album, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
<el-col v-for="(album, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
@@ -85,36 +85,16 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</div>
|
|
</div>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
-<!-- <el-tab-pane name="audio">
|
|
|
|
|
|
|
+ <el-tab-pane name="album">
|
|
|
<span slot="label">
|
|
<span slot="label">
|
|
|
- 音频<el-badge :value="userContentData.audioCount" :max="9999" class="item" type="warning" />
|
|
|
|
|
|
|
+ 收藏夹<el-badge :value="userContentData.albumCount" :max="9999" class="item" type="warning" />
|
|
|
</span>
|
|
</span>
|
|
|
- <div v-if="activeName === 'audio'">
|
|
|
|
|
- <el-col v-for="(audio, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
|
|
- <audio-card :audio="audio" />
|
|
|
|
|
|
|
+ <div v-if="activeName === 'album'">
|
|
|
|
|
+ <el-col v-for="(item, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
|
|
+ <span>{{ item.albumName }}</span>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</div>
|
|
</div>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane name="article">
|
|
|
|
|
- <span slot="label">
|
|
|
|
|
- 文章<el-badge :value="userContentData.articleCount" :max="9999" class="item" type="warning" />
|
|
|
|
|
- </span>
|
|
|
|
|
- <div v-if="activeName === 'article'">
|
|
|
|
|
- <el-col v-for="(article, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
|
|
|
|
|
- <article-card :article="article" />
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-tab-pane>-->
|
|
|
|
|
- <!-- <el-tab-pane name="status">
|
|
|
|
|
- <span slot="label">
|
|
|
|
|
- 状态<el-badge :value="userContentData.statusCount" :max="9999" class="item" type="warning"/>
|
|
|
|
|
- </span>
|
|
|
|
|
- <div v-if="activeName === 'status'">
|
|
|
|
|
- <el-col v-for="(status, index) in dataList" :key="index" :md="16" :sm="12" :xs="12">
|
|
|
|
|
- <span>发布的状态</span>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-tab-pane>-->
|
|
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="24" class="pagination">
|
|
<el-col :span="24" class="pagination">
|
|
@@ -132,7 +112,6 @@
|
|
|
/>
|
|
/>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
-
|
|
|
|
|
<el-row v-if="showEmpty" class="not-result">
|
|
<el-row v-if="showEmpty" class="not-result">
|
|
|
<el-col :span="12" :offset="6">
|
|
<el-col :span="12" :offset="6">
|
|
|
<img src="@/assets/img/icon/not-collection.png">
|
|
<img src="@/assets/img/icon/not-collection.png">
|
|
@@ -145,19 +124,16 @@
|
|
|
<script>
|
|
<script>
|
|
|
import StampBadge from '@/components/StampBadge'
|
|
import StampBadge from '@/components/StampBadge'
|
|
|
import VideoCard from '@/components/card/VideoCard'
|
|
import VideoCard from '@/components/card/VideoCard'
|
|
|
-import AudioCard from '@/components/card/AudioCard'
|
|
|
|
|
import ImageAlbumCard from '@/components/card/ImageAlbumCard'
|
|
import ImageAlbumCard from '@/components/card/ImageAlbumCard'
|
|
|
-import ArticleCard from '@/components/card/ArticleCard'
|
|
|
|
|
|
|
|
|
|
import { getUserInfo, checkRelation, followUser, unfollowUser } from '@/api/user'
|
|
import { getUserInfo, checkRelation, followUser, unfollowUser } from '@/api/user'
|
|
|
import { getUserContentData, getUserVideos } from '@/api/video'
|
|
import { getUserContentData, getUserVideos } from '@/api/video'
|
|
|
-import { getUserAlbums1 } from '@/api/image'
|
|
|
|
|
-import { getUserAudios } from '@/api/audio'
|
|
|
|
|
-import { getUserArticles } from '@/api/article'
|
|
|
|
|
|
|
+import { getAlbumImage1 } from '@/api/image'
|
|
|
|
|
+import { getPostAlbums } from '@/api/collect'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'Home',
|
|
name: 'Home',
|
|
|
- components: { StampBadge, VideoCard, ImageAlbumCard, AudioCard, ArticleCard },
|
|
|
|
|
|
|
+ components: { StampBadge, VideoCard, ImageAlbumCard },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
// 屏幕宽度, 为了控制分页条的大小
|
|
// 屏幕宽度, 为了控制分页条的大小
|
|
@@ -173,6 +149,10 @@ export default {
|
|
|
pageSize: 12,
|
|
pageSize: 12,
|
|
|
totalSize: 0,
|
|
totalSize: 0,
|
|
|
dataList: [],
|
|
dataList: [],
|
|
|
|
|
+ queryInfo: {
|
|
|
|
|
+ createBy: null,
|
|
|
|
|
+ pn: 1
|
|
|
|
|
+ },
|
|
|
showEmpty: true,
|
|
showEmpty: true,
|
|
|
userContentData: null
|
|
userContentData: null
|
|
|
}
|
|
}
|
|
@@ -193,18 +173,12 @@ export default {
|
|
|
document.title = this.user.screenName + '的视频'
|
|
document.title = this.user.screenName + '的视频'
|
|
|
} else if (path.endsWith('image')) {
|
|
} else if (path.endsWith('image')) {
|
|
|
this.activeName = 'image'
|
|
this.activeName = 'image'
|
|
|
- document.title = this.user.screenName + '的相册'
|
|
|
|
|
- } else if (path.endsWith('audio')) {
|
|
|
|
|
- this.activeName = 'audio'
|
|
|
|
|
- document.title = this.user.screenName + '的音频'
|
|
|
|
|
- } else if (path.endsWith('article')) {
|
|
|
|
|
- this.activeName = 'article'
|
|
|
|
|
- document.title = this.user.screenName + '的文章'
|
|
|
|
|
- } else if (path.endsWith('status')) {
|
|
|
|
|
- this.activeName = 'status'
|
|
|
|
|
- document.title = this.user.screenName + '的状态'
|
|
|
|
|
|
|
+ document.title = this.user.screenName + '的图片'
|
|
|
|
|
+ } else if (path.endsWith('album')) {
|
|
|
|
|
+ this.activeName = 'album'
|
|
|
|
|
+ document.title = this.user.screenName + '的收藏夹'
|
|
|
} else {
|
|
} else {
|
|
|
- document.title = this.user.screenName + '的个人主页'
|
|
|
|
|
|
|
+ document.title = this.user.screenName + '的主页'
|
|
|
}
|
|
}
|
|
|
this.getData()
|
|
this.getData()
|
|
|
}
|
|
}
|
|
@@ -251,15 +225,17 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
sendMessage(userId) {
|
|
sendMessage(userId) {
|
|
|
- console.log('发送消息')
|
|
|
|
|
|
|
+ this.$message.info('暂未实现')
|
|
|
},
|
|
},
|
|
|
handleCurrentChange(pageNumber) {
|
|
handleCurrentChange(pageNumber) {
|
|
|
this.currentPage = pageNumber
|
|
this.currentPage = pageNumber
|
|
|
|
|
+ this.queryInfo.pn = pageNumber
|
|
|
this.getData()
|
|
this.getData()
|
|
|
// 回到顶部
|
|
// 回到顶部
|
|
|
scrollTo(0, 0)
|
|
scrollTo(0, 0)
|
|
|
},
|
|
},
|
|
|
tabClick(tab) {
|
|
tabClick(tab) {
|
|
|
|
|
+ this.dataList = []
|
|
|
this.activeName = tab.name
|
|
this.activeName = tab.name
|
|
|
this.goToTab(this.activeName)
|
|
this.goToTab(this.activeName)
|
|
|
},
|
|
},
|
|
@@ -276,37 +252,9 @@ export default {
|
|
|
if (this.activeName === 'video') {
|
|
if (this.activeName === 'video') {
|
|
|
this.userVideoListWrapper(this.currentPage, this.userId)
|
|
this.userVideoListWrapper(this.currentPage, this.userId)
|
|
|
} else if (this.activeName === 'image') {
|
|
} else if (this.activeName === 'image') {
|
|
|
|
|
+ this.userImageWrapper(this.currentPage, this.userId)
|
|
|
|
|
+ } else if (this.activeName === 'album') {
|
|
|
this.userAlbumWrapper(this.currentPage, this.userId)
|
|
this.userAlbumWrapper(this.currentPage, this.userId)
|
|
|
- } else if (this.activeName === 'audio') {
|
|
|
|
|
- getUserAudios(this.userId, this.currentPage).then(resp => {
|
|
|
|
|
- if (resp.code === 0) {
|
|
|
|
|
- const respData = resp.data.list
|
|
|
|
|
- if (respData.length !== 0) {
|
|
|
|
|
- this.showEmpty = false
|
|
|
|
|
- for (const item of respData) {
|
|
|
|
|
- this.dataList.push(item)
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- this.showEmpty = true
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- } else if (this.activeName === 'article') {
|
|
|
|
|
- getUserArticles(this.userId, this.currentPage).then(resp => {
|
|
|
|
|
- if (resp.code === 0) {
|
|
|
|
|
- const respData = resp.data.list
|
|
|
|
|
- if (respData.length !== 0) {
|
|
|
|
|
- this.showEmpty = false
|
|
|
|
|
- for (const item of respData) {
|
|
|
|
|
- this.dataList.push(item)
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- this.showEmpty = true
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- } else if (this.activeName === 'status') {
|
|
|
|
|
- this.userStatusListWrapper(this.currentPage, this.userId)
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
userVideoListWrapper(pageNumber, userId) {
|
|
userVideoListWrapper(pageNumber, userId) {
|
|
@@ -315,32 +263,26 @@ export default {
|
|
|
const respData = resp.data
|
|
const respData = resp.data
|
|
|
this.dataList = respData.list
|
|
this.dataList = respData.list
|
|
|
this.totalSize = respData.totalSize
|
|
this.totalSize = respData.totalSize
|
|
|
- if (this.dataList.length !== 0) {
|
|
|
|
|
- this.showEmpty = false
|
|
|
|
|
- } else {
|
|
|
|
|
- this.showEmpty = true
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.showEmpty = this.dataList.length === 0
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- userAlbumWrapper(pageNumber, userId) {
|
|
|
|
|
- getUserAlbums1(pageNumber, userId).then(resp => {
|
|
|
|
|
|
|
+ userImageWrapper(pageNumber, userId) {
|
|
|
|
|
+ getAlbumImage1(pageNumber, userId).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
const respData = resp.data
|
|
const respData = resp.data
|
|
|
this.dataList = respData.list
|
|
this.dataList = respData.list
|
|
|
this.totalSize = respData.totalSize
|
|
this.totalSize = respData.totalSize
|
|
|
- if (this.dataList.length !== 0) {
|
|
|
|
|
- this.showEmpty = false
|
|
|
|
|
- } else {
|
|
|
|
|
- this.showEmpty = true
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.showEmpty = this.dataList.length === 0
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- userStatusListWrapper(pageNumber, userId) {
|
|
|
|
|
- userStatus(userId, pageNumber).then(resp => {
|
|
|
|
|
|
|
+ userAlbumWrapper(pageNumber, userId) {
|
|
|
|
|
+ getPostAlbums(this.queryInfo).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
- this.dataList = resp.data.list
|
|
|
|
|
|
|
+ const respData = resp.data
|
|
|
|
|
+ this.dataList = respData.list
|
|
|
|
|
+ this.totalSize = respData.totalSize
|
|
|
this.showEmpty = this.dataList.length === 0
|
|
this.showEmpty = this.dataList.length === 0
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|