|
|
@@ -5,11 +5,13 @@
|
|
|
class="bread"
|
|
|
separator-class="el-icon-arrow-right"
|
|
|
>
|
|
|
- <el-breadcrumb-item>搜索结果:共<span class="result">({{ total }}}</span>条</el-breadcrumb-item>
|
|
|
+ <el-breadcrumb-item>
|
|
|
+ 对 <span class="result">{{keyword}}</span> 的搜索结果共有<span class="result"> {{ total }} </span>条记录
|
|
|
+ </el-breadcrumb-item>
|
|
|
</el-breadcrumb>
|
|
|
|
|
|
- <el-row v-if="retList.length !== 0 " class="movie-list">
|
|
|
- <el-col v-for="(video,index) in retList" :key="index" :md="6" :sm="8" :xs="12">
|
|
|
+ <el-row v-if="dataList.length !== 0 " class="movie-list">
|
|
|
+ <el-col v-for="(video,index) in dataList" :key="index" :md="6" :sm="8" :xs="12">
|
|
|
<video-card :video="video" />
|
|
|
</el-col>
|
|
|
|
|
|
@@ -54,13 +56,15 @@ export default {
|
|
|
total: 0,
|
|
|
length: 0,
|
|
|
pageSize: 12,
|
|
|
- retList: []
|
|
|
+ dataList: []
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.keyword = this.$route.query.keyword
|
|
|
- this.currentPage = parseInt(this.$route.query.page)
|
|
|
+ this.currentPage = parseInt(this.$route.query.pageNumber)
|
|
|
this.videoQueryWrapper(this.keyword, this.currentPage)
|
|
|
+
|
|
|
+ document.title = '搜索 - ' + this.keyword
|
|
|
},
|
|
|
methods: {
|
|
|
handleCurrentChange(currentPage) {
|
|
|
@@ -68,22 +72,22 @@ export default {
|
|
|
path: '/search',
|
|
|
query: {
|
|
|
keyword: this.keyword,
|
|
|
- page: currentPage
|
|
|
+ pageNumber: currentPage
|
|
|
}
|
|
|
})
|
|
|
this.$router.go(0)
|
|
|
},
|
|
|
- videoQueryWrapper(keyword, page) {
|
|
|
- videoQuery(keyword, page)
|
|
|
+ videoQueryWrapper(keyword, pageNumber) {
|
|
|
+ videoQuery(keyword, pageNumber)
|
|
|
.then(res => {
|
|
|
if (res.code === 0) {
|
|
|
const resData = res.data
|
|
|
this.total = resData.totalSize
|
|
|
this.length = resData.totalPages
|
|
|
- this.retList = resData.list
|
|
|
+ this.dataList = resData.list
|
|
|
|
|
|
// 页面跳转后滚动到页面顶部
|
|
|
- this.$vuetify.goTo(0)
|
|
|
+ //this.$vuetify.goTo(0)
|
|
|
} else {
|
|
|
console.error(res.msg)
|
|
|
}
|