BUG 28058

This commit is contained in:
aixianling
2022-03-07 10:55:26 +08:00
parent d59b695ae0
commit 3259431133

View File

@@ -31,7 +31,7 @@
</div> </div>
</div> </div>
</div> </div>
<AiEmpty v-if="!list.length && !isMore"/> <AiEmpty v-if="list.length==0"/>
</div> </div>
<div class="btn-wrapper"> <div class="btn-wrapper">
<div class="btn" @click="toReport" hover-class="text-hover">添加返乡记录</div> <div class="btn" @click="toReport" hover-class="text-hover">添加返乡记录</div>
@@ -48,10 +48,8 @@ export default {
data() { data() {
return { return {
list: [], list: [],
pageShow: false,
current: 1, current: 1,
total: 0, total: 0
isMore: false
} }
}, },
@@ -61,14 +59,10 @@ export default {
onLoad() { onLoad() {
this.$loading() this.$loading()
this.$dict.load(['villageActivityStatus']).then(() => { this.getList()
this.getList() this.$dict.load('villageActivityStatus')
})
uni.$on('update', () => { uni.$on('update', () => {
this.current = 1 this.current = 1
this.isMore = false
this.$nextTick(() => { this.$nextTick(() => {
this.getList() this.getList()
}) })
@@ -79,10 +73,7 @@ export default {
toReport() { toReport() {
this.$linkTo('./Add') this.$linkTo('./Add')
}, },
getList() { getList() {
if (this.isMore) return uni.hideLoading()
this.$instance.post(`/app/appepidemicbackhomerecord/list`, null, { this.$instance.post(`/app/appepidemicbackhomerecord/list`, null, {
params: { params: {
openId: this.user.openId, openId: this.user.openId,
@@ -90,24 +81,14 @@ export default {
size: 15 size: 15
} }
}).then(res => { }).then(res => {
if (res.code == 0) { uni.hideLoading()
if (res?.data) {
this.total = res.data.total this.total = res.data.total
if (this.current > 1) { if (this.current > 1) {
this.list = [...this.list, ...res.data.records] this.list = [...this.list, ...res.data.records]
} else { } else {
this.list = res.data.records 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(() => { }).catch(() => {
uni.hideLoading() uni.hideLoading()
@@ -116,6 +97,7 @@ export default {
}, },
onReachBottom() { onReachBottom() {
this.current++
this.getList() this.getList()
} }
} }