26316
This commit is contained in:
@@ -29,7 +29,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
current: 1,
|
current: 1,
|
||||||
list: []
|
list: [],
|
||||||
|
isMore: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {...mapState(['user'])},
|
computed: {...mapState(['user'])},
|
||||||
@@ -57,13 +58,17 @@ export default {
|
|||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
|
if (res.data.records.length < 10) {
|
||||||
|
this.isMore = true
|
||||||
|
}
|
||||||
|
|
||||||
res.data.records.forEach(e => {
|
res.data.records.forEach(e => {
|
||||||
e.cellName = `${e.communityName + e.buildingNumber}栋`
|
e.cellName = `${e.communityName + e.buildingNumber}栋`
|
||||||
})
|
})
|
||||||
if (this.current > 1 && this.current > res.data.pages) {
|
if (this.current > 1 && this.current > res.data.pages) {
|
||||||
return
|
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
|
this.pages = res.data.pages
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -77,14 +82,20 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.current++;
|
if (this.isMore) return
|
||||||
|
|
||||||
|
this.current++
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.list {
|
.list {
|
||||||
|
padding-bottom: 20px;
|
||||||
.list-content {
|
.list-content {
|
||||||
padding: 32px 32px 0;
|
padding: 32px 32px 0;
|
||||||
background-color: #F5F5F5;
|
background-color: #F5F5F5;
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ uni-page-body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.map {
|
.map {
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
|
|
||||||
.build-btn {
|
.build-btn {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
|
|||||||
Reference in New Issue
Block a user