mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-21 21:46:44 +08:00
海报列表加分页
This commit is contained in:
@@ -11,13 +11,21 @@
|
||||
<van-grid :border="false" :column-num="3">
|
||||
<van-grid-item v-for="(item, index) in posterList" :key="index">
|
||||
<img :src="item.posterNarrowUrl | urlFormat" @click="posterPreview(item.posterId)" />
|
||||
<!-- <img src="@/assets/images/banner.png" @click="posterPreview(item.posterId)" /> -->
|
||||
</van-grid-item>
|
||||
</van-grid>
|
||||
<van-pagination
|
||||
v-model="pageNum"
|
||||
:page-count="pageCount"
|
||||
@change="change"
|
||||
v-if="pageCount-1"
|
||||
:class="posterList.length<7?'bottom-btn':''"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Tab, Tabs, Sticky, Grid, GridItem } from 'vant'
|
||||
import { Tab, Tabs, Sticky, Grid, GridItem,Pagination } from 'vant'
|
||||
import { getPosterType, getPosterList } from '@/api/ebiz/poster/poster'
|
||||
import config from '@/config'
|
||||
export default {
|
||||
@@ -27,7 +35,8 @@ export default {
|
||||
[Tabs.name]: Tabs,
|
||||
[Sticky.name]: Sticky,
|
||||
[Grid.name]: Grid,
|
||||
[GridItem.name]: GridItem
|
||||
[GridItem.name]: GridItem,
|
||||
[Pagination.name]: Pagination,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -36,8 +45,9 @@ export default {
|
||||
posterType: '',
|
||||
srcUrl: '@/images/u10199.png',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
posterList: [] // 海报列表
|
||||
pageSize: 9,
|
||||
posterList: [], // 海报列表
|
||||
pageCount: 1
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -68,6 +78,7 @@ export default {
|
||||
console.log(param)
|
||||
let res = await getPosterList(param)
|
||||
if (res.result == 0) {
|
||||
this.pageCount = Math.ceil(res.pageInfo.total/9)
|
||||
this.posterList = res.pageInfo.list
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
@@ -76,11 +87,15 @@ export default {
|
||||
tabChange(name, title) {
|
||||
this.posterType = this.posterTypeList[name].code
|
||||
this.pageNum= 1,
|
||||
this.pageSize= 10,
|
||||
this.posterList=[]
|
||||
this.posterList=[],
|
||||
this.pageCount = 1
|
||||
this.getPosterList()
|
||||
console.log(name, title)
|
||||
},
|
||||
change(){
|
||||
this.getPosterList()
|
||||
console.log(this.pageNum)
|
||||
},
|
||||
posterPreview(id) {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
|
||||
Reference in New Issue
Block a user