diff --git a/src/mods/conv/AppPhotoReport/AppPhotoReport.vue b/src/mods/conv/AppPhotoReport/AppPhotoReport.vue index f01b8af..b8847d4 100644 --- a/src/mods/conv/AppPhotoReport/AppPhotoReport.vue +++ b/src/mods/conv/AppPhotoReport/AppPhotoReport.vue @@ -47,10 +47,8 @@ export default { data() { return { list: [], - pageShow: false, current: 1, total: 0, - isMore: false, itemOptions: [ {text: '删除', style: {backgroundColor: '#f46'}} ] @@ -63,59 +61,34 @@ export default { onShow() { this.current = 1 - this.isMore = false this.getList() }, onLoad() { - this.$loading() this.$dict.load(['clapEventStatus']) }, methods: { toReport() { this.$linkTo('./PhotoForm') }, - getList() { - if (this.isMore) return - + if (this.current == 1) { + //当current=1时,意味着重新刷新数据 + } else if (this.list.length >= this.total && this.total > 0) { + return //当数据总量和列表总量一样时,不用再加载数据 + } + this.$loading() this.$instance.post(`/app/appclapeventinfo/listByWxApplet`, null, { params: { - current: this.current, - size: 15 + current: this.current, size: 15 } }).then(res => { - if (res.code == 0) { + if (res?.data) { + const list = res.data.records.map(v => ({...v, statusName: this.$dict.getLabel('clapEventStatus', v.eventStatus)})) + this.list = this.current == 1 ? list : [this.list, list].flat() this.total = res.data.total - if (this.current > 1) { - this.list = [...this.list, ...res.data.records].map(v => { - return { - ...v, - statusName: this.$dict.getLabel('clapEventStatus', v.eventStatus) - } - }) - } else { - this.list = res.data.records.map(v => { - return { - ...v, - statusName: this.$dict.getLabel('clapEventStatus', v.eventStatus) - } - }) - } - uni.hideLoading() - this.pageShow = true - if (res.data.records.length < 15) { - this.isMore = true - - return false - } - - this.current += 1 - } else { - uni.hideLoading() + this.current++ } - }).catch(() => { - uni.hideLoading() - }) + }).finally(() => uni.hideLoading()) }, handleDelete(ids) { this.$dialog.confirm({content: "是否要进行删除?"}).then(() => { @@ -125,7 +98,6 @@ export default { if (res?.code == 0) { this.$u.toast("删除成功!") this.current = 1 - this.isMore = false this.getList() } }) diff --git a/src/mods/conv/AppPhotoReport/PhotoDetail.vue b/src/mods/conv/AppPhotoReport/PhotoDetail.vue index 66b363e..d48d83e 100644 --- a/src/mods/conv/AppPhotoReport/PhotoDetail.vue +++ b/src/mods/conv/AppPhotoReport/PhotoDetail.vue @@ -1,5 +1,5 @@