Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aixianling
2022-05-30 15:38:55 +08:00
3 changed files with 75 additions and 7 deletions

View File

@@ -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('删除成功')

View File

@@ -1,9 +1,10 @@
<template>
<div class="message">
<div class="message-item" v-for="(item, index) in 10" :key="index">
<h2>2022-2-14 10:02</h2>
<div>您于2月13日发布的打卡相册的照片已被XXX查看</div>
<div class="message-item" v-for="(item, index) in list" :key="index">
<h2>{{ item.createTime }}</h2>
<div>{{ item.msg }}</div>
</div>
<AiEmpty v-if="!list.length && isMore"></AiEmpty>
</div>
</template>
@@ -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()
}
}
</script>

View File

@@ -1,7 +1,7 @@
<template>
<div class="album-home" ref="home">
<div class="userinfo">
<image src="https://pica.zhimg.com/v2-abed1a8c04700ba7d72b45195223e0ff_is.jpg?source=32738c0c" />
<image :src="$cdn + 'avatar.png'" />
<div class="right">
<h2><AiOpenData v-if="user.wxOpenUserId" type="userName" :openid="user.wxOpenUserId"></AiOpenData></h2>
<p>欢迎使用工作相册</p>