uniapp实现分页功能
效果图

<!-- 列表数据 -->
<view class="homecenter">
<template v-if="progitlist && progitlist.length > 0">
<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="toLowerLoad">
<view class="conlists" v-for="(item, index) in progitlist" :key="index">
<view class="content" style="width: 340rpx">{
{
item.payTime }}</view>
<view class="content">{
{
item.classificationName || '-' }}</view>
<view class="content">{
{
item.money }}</view>
</view>
<uni-load-more :status="status"></uni-load-more>
</scroll-view>
</template>
<view class="noResult" v-else>
<image class="noImg" src="/static/imgs/noResult2.png">
<template>
<view class="line1">暂无内容</view>
</template>
</view>
</view>
data(){
return{
page: 1,
row: 10,
total: 0,
classificationId:'',
progitlist: [],
status: 'empty',
}
},
onLoad(option) {
this.getlist(1);
},
methods:{
async getlist(page) {
let data = {
page: page,
row: 10,
classificationId: this.classificationId,
};
this.status = 'loading';
let res = await appService.AgencyRevenue(data);
if (res.code == 200) {
this.page = page
this.total = res.data.data.myFinanceIPage.total * 1
if(page == 1){
this.progitlist = res.data.data.myFinanceIPage.records;
}else{
this.progitlist = this.progitlist.concat(res.data.data.myFinanceIPage.records)