|
@ -31,24 +31,29 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onPullDownRefresh() { |
|
|
onPullDownRefresh() { |
|
|
|
|
|
this.refreshList() |
|
|
}, |
|
|
}, |
|
|
onReachBottom() { |
|
|
onReachBottom() { |
|
|
|
|
|
this.loadMore() |
|
|
}, |
|
|
}, |
|
|
onShow() { |
|
|
|
|
|
|
|
|
onLoad() { |
|
|
|
|
|
this.refreshList() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 刷新列表
|
|
|
// 刷新列表
|
|
|
refreshList() { |
|
|
refreshList() { |
|
|
this.pageNo = 1; |
|
|
|
|
|
|
|
|
this.queryParams.pageNo = 1; |
|
|
this.hasMore = true; |
|
|
this.hasMore = true; |
|
|
this.orderList = []; |
|
|
|
|
|
|
|
|
this.List = []; |
|
|
this.loadList(); |
|
|
this.loadList(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 加载更多
|
|
|
// 加载更多
|
|
|
loadMore() { |
|
|
loadMore() { |
|
|
|
|
|
console.log(this.hasMore , this.loading); |
|
|
|
|
|
|
|
|
if (!this.hasMore || this.loading) return; |
|
|
if (!this.hasMore || this.loading) return; |
|
|
this.pageNo++; |
|
|
|
|
|
|
|
|
this.queryParams.pageNo++; |
|
|
this.loadList(); |
|
|
this.loadList(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -67,8 +72,7 @@ export default { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$api(this.mixinsListApi, query(this, params)) |
|
|
|
|
|
.then(res => { |
|
|
|
|
|
|
|
|
this.$api(this.mixinsListApi, query(this, params), res => { |
|
|
this.loading = false; |
|
|
this.loading = false; |
|
|
uni.stopPullDownRefresh(); |
|
|
uni.stopPullDownRefresh(); |
|
|
|
|
|
|
|
@ -88,7 +92,7 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 判断是否还有更多数据
|
|
|
// 判断是否还有更多数据
|
|
|
this.hasMore = newList.length >= this.pageSize; |
|
|
|
|
|
|
|
|
this.hasMore = newList.length >= this.queryParams.pageSize; |
|
|
} else { |
|
|
} else { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: res.message || '加载失败', |
|
|
title: res.message || '加载失败', |
|
|