首先在pages.json里将enablePullDownRefresh改为true,这句是下拉刷新
我这里是做了个判断,当分页大于等于2页的时候才显示
// 上拉刷新当前页 onPullDownRefresh() { this.imitateList = []; this.page = 1; setTimeout(() => { // 调用接口 this.dataLists() // 关闭上拉刷新 uni.stopPullDownRefresh(); }, 1000) }, // 下拉加载更多 onReachBottom() { // console.log('下拉加载更多') if (this.page >= this.total) { this.status = 'nomore' return } else { this.status = 'loading' this.page = ++this.page; setTimeout(() => { // 调用接口 this.dataLists() }, 1000) } },