26316
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user