|
|
@@ -76,7 +76,7 @@
|
|
|
import VideoCard from 'components/card/VideoCard'
|
|
|
import HotVideo from '@/components/card/HotVideo'
|
|
|
|
|
|
-import { videoCategory, videoPage} from '@/api/video'
|
|
|
+import { videoCategory, categoryVideos} from '@/api/video'
|
|
|
|
|
|
export default {
|
|
|
name: 'Video',
|
|
|
@@ -133,7 +133,7 @@ export default {
|
|
|
duration: 3000
|
|
|
})
|
|
|
})
|
|
|
- this.videoPageWrapper(this.currentPage, this.prevId, this.nextId, this.categoryId)
|
|
|
+ this.videoPageWrapper(this.categoryId, this.nextId)
|
|
|
},
|
|
|
mounted() {
|
|
|
// 当窗口宽度改变时获取屏幕宽度
|
|
|
@@ -147,31 +147,28 @@ export default {
|
|
|
methods: {
|
|
|
prevClick(pageNumber) {
|
|
|
this.currentPage = pageNumber
|
|
|
- this.videoPageWrapper(this.currentPage, this.prevId, this.prevId, this.categoryId)
|
|
|
+ this.videoPageWrapper(this.categoryId, this.prevId)
|
|
|
// 回到顶部
|
|
|
scrollTo(0, 0)
|
|
|
},
|
|
|
nextClick(pageNumber) {
|
|
|
this.currentPage = pageNumber
|
|
|
- this.videoPageWrapper(this.currentPage, this.prevId, this.nextId, this.categoryId)
|
|
|
+ this.videoPageWrapper(this.categoryId, this.nextId)
|
|
|
// 回到顶部
|
|
|
scrollTo(0, 0)
|
|
|
},
|
|
|
- videoPageWrapper(pageNumber, prevId, nextId, categoryId) {
|
|
|
- videoPage(pageNumber, prevId, nextId, categoryId).then(res => {
|
|
|
+ videoPageWrapper(categoryId, nextId) {
|
|
|
+ categoryVideos(categoryId, nextId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
const resData = res.data
|
|
|
- if (resData.list.length > 0) {
|
|
|
- this.showEmpty = false
|
|
|
- } else {
|
|
|
- this.showEmpty = true
|
|
|
- }
|
|
|
+ this.showEmpty = resData.list.length <= 0;
|
|
|
|
|
|
this.videoList = resData.list
|
|
|
this.totalPages = resData.totalPages
|
|
|
this.totalSize = resData.totalSize
|
|
|
- this.prevId = resData.prevId
|
|
|
this.nextId = resData.nextId
|
|
|
+
|
|
|
+ this.prevId = nextId
|
|
|
} else {
|
|
|
this.$notify({
|
|
|
title: '提示',
|
|
|
@@ -201,7 +198,7 @@ export default {
|
|
|
this.currentPage = 1
|
|
|
|
|
|
this.videoList = []
|
|
|
- this.videoPageWrapper(this.currentPage, this.prevId, this.nextId, this.categoryId)
|
|
|
+ this.videoPageWrapper(this.categoryId, this.nextId)
|
|
|
}
|
|
|
}
|
|
|
}
|