|
|
@ -63,6 +63,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="text-align: center" v-if="isLoading">加载中...</view> |
|
|
|
<view style="text-align: center" v-else>没有更多了</view> |
|
|
|
<view v-else-if="listData.length <= 0" class="no-data"> 暂无数据~ </view> |
|
|
|
</scroll-view> |
|
|
|
</template> |
|
|
@ -122,7 +123,7 @@ export default { |
|
|
|
}, |
|
|
|
// 加载更多数据(分页) |
|
|
|
loadMore() { |
|
|
|
console.log("上拉加载"); |
|
|
|
console.log("上拉加载",this.isLoading,this.noMore); |
|
|
|
if (this.isLoading || this.noMore) return; // 新增 noMore 判断 |
|
|
|
this.isLoading = true; |
|
|
|
this.form.pageNum++; |
|
|
@ -142,12 +143,17 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
// 判断是否还有更多 |
|
|
|
if (tempList.length < this.form.pageSize) { |
|
|
|
console.log(res.total,this.form.pageSize,res.total <= this.form.pageSize * this.form.pageNum,'tempList.total'); |
|
|
|
|
|
|
|
if (res.total <= this.form.pageSize * this.form.pageNum) { |
|
|
|
this.noMore = true; |
|
|
|
console.log(this.noMore,'noM'); |
|
|
|
|
|
|
|
if (page !== 1) { |
|
|
|
uni.showToast({ |
|
|
|
content: "已经加载全部", |
|
|
|
}); |
|
|
|
// uni.showToast({ |
|
|
|
// title: "已经加载全部", |
|
|
|
// icon: "none", |
|
|
|
// }); |
|
|
|
} |
|
|
|
} |
|
|
|
this.isLoading = false; |
|
|
|