This commit is contained in:
yanran200730
2022-11-08 19:00:14 +08:00
parent e29568c97d
commit 0bf5bbf217
3 changed files with 27 additions and 16 deletions

View File

@@ -20,6 +20,7 @@
export default {
appName: '文明广场',
name: 'AppSquare',
enablePullDownRefresh: true,
data () {
return {
@@ -58,7 +59,10 @@
},
getList () {
if (this.isMore) return
if (this.isMore) {
uni.stopPullDownRefresh()
return
}
this.$loading()
this.$instance.post(`/api/appwechatescalation/list`, null, {
@@ -72,6 +76,7 @@
}).then(res => {
if (res.code === 0) {
this.$hideLoading()
uni.stopPullDownRefresh()
if (this.current > 1) {
this.list = [...this.list, ...res.data.records]
} else {
@@ -89,6 +94,7 @@
this.isMore = true
}
}).catch(() => {
uni.stopPullDownRefresh()
this.$hideLoading()
})
}
@@ -96,7 +102,13 @@
onReachBottom () {
this.getList()
}
},
onPullDownRefresh() {
this.isMore = false
this.current = 1
this.getList()
},
}
</script>