diff --git a/src/mods/service/AppReturnHomeRegister/AppReturnHomeRegister.vue b/src/mods/service/AppReturnHomeRegister/AppReturnHomeRegister.vue index fefb132..a783973 100644 --- a/src/mods/service/AppReturnHomeRegister/AppReturnHomeRegister.vue +++ b/src/mods/service/AppReturnHomeRegister/AppReturnHomeRegister.vue @@ -31,7 +31,7 @@ - +
添加返乡记录
@@ -48,10 +48,8 @@ export default { data() { return { list: [], - pageShow: false, current: 1, - total: 0, - isMore: false + total: 0 } }, @@ -61,14 +59,10 @@ export default { onLoad() { this.$loading() - this.$dict.load(['villageActivityStatus']).then(() => { - this.getList() - }) - + this.getList() + this.$dict.load('villageActivityStatus') uni.$on('update', () => { this.current = 1 - this.isMore = false - this.$nextTick(() => { this.getList() }) @@ -79,10 +73,7 @@ export default { toReport() { this.$linkTo('./Add') }, - getList() { - if (this.isMore) return uni.hideLoading() - this.$instance.post(`/app/appepidemicbackhomerecord/list`, null, { params: { openId: this.user.openId, @@ -90,24 +81,14 @@ export default { size: 15 } }).then(res => { - if (res.code == 0) { + uni.hideLoading() + if (res?.data) { this.total = res.data.total if (this.current > 1) { this.list = [...this.list, ...res.data.records] } else { this.list = res.data.records } - uni.hideLoading() - this.pageShow = true - if (res.data.records.length < 15) { - this.isMore = true - - return false - } - - this.current = this.current + 1 - } else { - uni.hideLoading() } }).catch(() => { uni.hideLoading() @@ -116,6 +97,7 @@ export default { }, onReachBottom() { + this.current++ this.getList() } }