BUG 28058
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length && !isMore"/>
|
||||
<AiEmpty v-if="list.length==0"/>
|
||||
</div>
|
||||
<div class="btn-wrapper">
|
||||
<div class="btn" @click="toReport" hover-class="text-hover">添加返乡记录</div>
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user