HTML
<scroll-view class="todaysDeal-scroll" :scroll-x="true" enable-flex="true" @scrolltolower="scorllClick">
<view class="todaysDeal-list" v-for="(item,index) in todaysDeal" :key='index'></view>
</scroll-view>
JS
data() {
return {
todaysDeal:[],
//默认传参的页数和个数 以及算总页数
scollorCurrent: 1,
scollorSize: 8,
}
},
methods:{
scorllClick() {
//每次触底增加页数
this.scollorCurrent++
this.jrtjClick()
},
jrtjClick() {
var that = this
var parms = {
current: that.scollorCurrent,
size: that.scollorSize,
}
that.$u.api.popular(parms).then(res => {
that.todaysDeal = that.todaysDeal.concat(res.records)
//后续还可以用总数除以个数,获取总共多少页,然后判断你当前翻到的页数大于总页数后做一些提示操作
})
},