diff --git a/src/saas/AppCountryAlbum/AddAlbum.vue b/src/saas/AppCountryAlbum/AddAlbum.vue index 8a0f8dd3..4fa6841b 100644 --- a/src/saas/AppCountryAlbum/AddAlbum.vue +++ b/src/saas/AppCountryAlbum/AddAlbum.vue @@ -92,7 +92,7 @@ }, remove () { - this.$confirm('确定删除该相册?').then(() => { + this.$confirm('确定删除该相册?相册删除后,相册内的照片会同步删除!').then(() => { this.$http.post(`/api/appalbum/delete?ids=${this.id}`).then(res => { if (res.code == 0) { this.$u.toast('删除成功') diff --git a/src/saas/AppCountryAlbum/Message.vue b/src/saas/AppCountryAlbum/Message.vue index bfcc1d84..ef9c661d 100644 --- a/src/saas/AppCountryAlbum/Message.vue +++ b/src/saas/AppCountryAlbum/Message.vue @@ -1,9 +1,10 @@ @@ -14,16 +15,83 @@ data () { return { - + size: 15, + current: 1, + isMore: false, + list: [] } }, onLoad () { - + this.getList() }, methods: { + mapType (type) { + return { + '0': '照片查看', + '1': '照片上传', + '2': '打卡统计' + }[type] + }, + getList () { + if (this.isMore) return + + this.$loading() + this.$http.post(`/api/sysmessage/list`, null, { + params: { + size: 10, + current: this.current + } + }).then(res => { + if (res.code === 0) { + if (this.current > 1) { + this.list = [...this.list, ...res.data.records].map(v => { + let msg = v.content + if (v.channel === '2') { + msg = '' + JSON.parse(v.content).forEach((item, index) => { + msg = msg + `${item.key}:${item.value}人` + (JSON.parse(v.content).length === index + 1 ? '' : ',') + }) + } + return { + ...v, + msg, + typeName: this.mapType(v.channel) + } + }) + } else { + this.list = res.data.records.map(v => { + let msg = v.content + if (v.channel === '2') { + msg = '' + JSON.parse(v.content).forEach((item, index) => { + msg = msg + `${item.key}:${item.value}人` + (JSON.parse(v.content).length === index + 1 ? '' : ',') + }) + } + return { + ...v, + msg, + typeName: this.mapType(v.channel) + } + }) + } + + if (res.data.records.length < 10) { + this.isMore = true + + return false + } + + this.current = this.current + 1 + } + }) + } + }, + + onReachBottom () { + this.getList() } } diff --git a/src/saas/AppCountryAlbum/components/Home.vue b/src/saas/AppCountryAlbum/components/Home.vue index f4918bc2..16054ceb 100644 --- a/src/saas/AppCountryAlbum/components/Home.vue +++ b/src/saas/AppCountryAlbum/components/Home.vue @@ -1,7 +1,7 @@