diff --git a/src/apps/AppBuilding/list.vue b/src/apps/AppBuilding/list.vue index cc6c0fed..03711b9f 100644 --- a/src/apps/AppBuilding/list.vue +++ b/src/apps/AppBuilding/list.vue @@ -29,7 +29,8 @@ export default { return { title: '', current: 1, - list: [] + list: [], + isMore: false } }, computed: {...mapState(['user'])}, @@ -57,13 +58,17 @@ export default { } }).then(res => { if (res?.data) { + if (res.data.records.length < 10) { + this.isMore = true + } + res.data.records.forEach(e => { e.cellName = `${e.communityName + e.buildingNumber}栋` }) if (this.current > 1 && this.current > res.data.pages) { return } - this.list = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records + this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records this.pages = res.data.pages } }) @@ -77,14 +82,20 @@ export default { }, onReachBottom() { - this.current++; - this.getList() + if (this.isMore) return + + this.current++ + + this.$nextTick(() => { + this.getList() + }) }, }