uni-app 小程序数据列表进行分页
作者:互联网
// 上拉加载更多
moreData() { var that = this; that.page += 1; var parm = { rows:that.rows, page:that.page } this.requestToken('接口路径?statusList='+ that.statusList, 'POST', parm, (res) => { var array = res.data.Data.rows var listValue = [] listValue = array.map((item)=>{ return item }) if(res.data.Data.total<that.rows) { console.log('res.data.Data.tatal:',res.data.Data.total) that.showNext = true return } listValue.map(function(item){ that.repairlist.push(item) }) // console.log(res) }) },
//原本的数据列表
var parm = { rows:that.rows, page:that.page, } console.log(that.statusList) this.requestToken('接口路径?statusList='+that.statusList, 'POST', parm, (res) => { that.repairlist = res.data.Data.rows console.log(that.repairlist) console.log('报修单', res) }, () => { that.loading = false })
return { page:1, rows:30, statusList:'' }
标签:statusList,rows,res,app,parm,列表,var,uni,page 来源: https://www.cnblogs.com/funing-z/p/14852858.html