export default {
data() {
return {
orderlist:[],
merchant_id:'',
loading:false,
hasMore:false,
page:1,
pageSize:10,
orderno:''
}
},
onLoad() {
this.merchant_id = uni.getStorageSync('merchant_id');
},
onReachBottom() {
if (this.hasMore) {
this.loadMore();
}
},
mounted() {
this.getMerchantOrderlist();
},
methods: {
async getMerchantOrderlist(type = true){
this.loading = true;
let info = await api.getMerchantOrderlist({
merchant_id:this.merchant_id,
page:this.page,
pageSize:this.pageSize,
order_no:this.orderno
})
// this.orderlist = this.orderlist.concat(info.data.list);
if(type){
this.orderlist = this.orderlist ? [...this.orderlist,...info.data.lists]:info.data.lists;
} else {
this.orderlist = info.data.lists;
}
console.log(this.orderlist,'数据');
this.hasMore = info.data.hasMore
this.loading = false;
},
loadMore() {
this.page += 1;
this.getMerchantOrderlist();
},
onSearchInput(event){
this.orderno = event.target.value
this.getMerchantOrderlist(false)
}
}
}
uni-app瀑布式分页
最新推荐文章于 2024-11-12 11:57:06 发布