mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-22 09:26:44 +08:00
大榜单分页调整
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<van-list v-model="loading" :finished="finished" @load="getPostList" :immediate-check="false" finished-text="没有更多了..." class="post-container">
|
||||
<div class="post" v-for="(item, index) in posterList" :key="index" @click="previewImg(index)">
|
||||
<div class="wrapper">
|
||||
<van-grid :column-num="3" :gutter="10">
|
||||
<van-grid-item v-for="(item, index) in posterList" :key="index" @click="previewImg(index)">
|
||||
<img :src="item.realUrl" />
|
||||
</div>
|
||||
</van-list>
|
||||
</van-grid-item>
|
||||
</van-grid>
|
||||
<div class="pageWrapper">
|
||||
<van-pagination class="bottom-btn" v-model="pageNum" :page-count="totalPage" @change="pageChange" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -23,17 +26,14 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
active: '0',
|
||||
posterType: 'hb',
|
||||
srcUrl: '@/images/u10199.png',
|
||||
pageNum: 1,
|
||||
pageSize: 9,
|
||||
posterList: [], // 贺报列表
|
||||
imgUrls: [],
|
||||
show: false,
|
||||
index: 0,
|
||||
loading: true,
|
||||
finished: false
|
||||
totalPage: 0
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -54,12 +54,8 @@ export default {
|
||||
}
|
||||
let res = await getPosterList(param)
|
||||
if (res.result == 0) {
|
||||
if (res.pageInfo.pages === this.pageNum) {
|
||||
this.finished = true
|
||||
}
|
||||
this.loading = false
|
||||
this.pageNum++
|
||||
this.posterList.push(...res.pageInfo.list)
|
||||
this.totalPage = res.pageInfo.pages
|
||||
this.posterList = res.pageInfo.list
|
||||
for (let item of this.posterList) {
|
||||
let url = (config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${item.posterNarrowUrl}`).replace(/\+/g, '%2B')
|
||||
item.realUrl = url
|
||||
@@ -74,12 +70,21 @@ export default {
|
||||
images: this.imgUrls,
|
||||
startPosition: index
|
||||
})
|
||||
},
|
||||
pageChange(pageNum) {
|
||||
this.pageNum = pageNum
|
||||
this.getPostList()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wrapper {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
.post-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@@ -102,11 +107,13 @@ img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.grid-box {
|
||||
margin-bottom: 10px;
|
||||
/deep/ .van-pagination__item {
|
||||
color: #ff4040;
|
||||
}
|
||||
|
||||
.poster-list-container {
|
||||
display: flex;
|
||||
/deep/.van-pagination__item:active,
|
||||
/deep/.van-pagination__item--active {
|
||||
background-color: #ff4040;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user