From 74e6ef1dd18c5323a086d66b2584ca3c402cb370 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Wed, 25 May 2022 17:07:45 +0800 Subject: [PATCH] 29812 --- src/saas/AppCountryAlbum/AlbumDetail.vue | 42 +++++++++++++++++++++--- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/src/saas/AppCountryAlbum/AlbumDetail.vue b/src/saas/AppCountryAlbum/AlbumDetail.vue index 50280817..5a790f19 100644 --- a/src/saas/AppCountryAlbum/AlbumDetail.vue +++ b/src/saas/AppCountryAlbum/AlbumDetail.vue @@ -78,7 +78,9 @@ hideStatus: false, pageShow: false, id: '', - totalInfo: {} + current: 1, + totalInfo: {}, + isMore: false } }, @@ -126,6 +128,12 @@ onChange (e) { this.date = e.detail.value + this.isMore = false + this.current = 1 + + this.$nextTick(() => { + this.getList() + }) }, getInfo (id) { @@ -163,16 +171,40 @@ }, getList () { - this.$http.post(`/api/appalbumphoto/DetailByAlbumID?albumId=${this.id}&size=1000`).then(res => { + if (this.isMore) return + this.$http.post(`/api/appalbumphoto/DetailByAlbumID`, null, { + params: { + albumId: this.id, + pageSize: 10, + queryTime: this.date, + pageNum: this.current + } + }).then(res => { if (res.code === 0) { - this.list = res.data.records + if (this.current > 1) { + this.list = [...this.list, ...res.data.records] + } else { + this.list = res.data.records + } - if (res.data.length) { - this.coverImg = res.data[0].photoUrl + if (res.data.records.length < 10) { + this.isMore = true + + return false + } + + this.current = this.current + 1 + + if (res.data.records.length) { + this.coverImg = res.data.records[0].photoUrl } } }) } + }, + + onReachBottom () { + this.getList() } }