This commit is contained in:
yanran200730
2022-01-14 16:14:40 +08:00
parent c944d6dcec
commit dc5a400ec9
2 changed files with 16 additions and 5 deletions

View File

@@ -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()
})
},
}
</script>
<style lang="scss" scoped>
.list {
padding-bottom: 20px;
.list-content {
padding: 32px 32px 0;
background-color: #F5F5F5;