This commit is contained in:
花有清香月有阴
2022-01-07 17:30:54 +08:00
5 changed files with 120 additions and 97 deletions

View File

@@ -41,6 +41,7 @@
<div class="content" v-text="op.content" @click="adddeleShow(op.id)" />
<div class="content" v-text="op.content" />
<div class="content color-999" v-text="op.createTime" />
</div>
<AiEmpty v-if="!data.messages.length"></AiEmpty>
@@ -111,6 +112,7 @@ export default {
deleShow: false,
modalShow: false,
deleId: '',
isAnnouncer: false,
}
},
computed: {
@@ -157,7 +159,7 @@ export default {
this.timestamp = discussTime - nowTime
}
if (res.data.voteType === '1') {
if (res.data.type === '1') {
const total = Object.values(res.data.statistic).reduce((x, y) => {
return x + y
})
@@ -183,40 +185,39 @@ export default {
like(id) {
this.$loading()
this.$http
.post(`/app/appvillagediscussmessage/suport?id=${id}&userId=${this.user.id}`)
.then((res) => {
this.$hideLoading()
if (res.code === 0) {
this.$u.toast('点赞成功')
this.$http.post(`/app/appvillagediscussmessage/suport?id=${id}&userId=${this.user.id}`).then((res) => {
this.$hideLoading()
if (res.code === 0) {
this.$u.toast('点赞成功')
this.$nextTick(() => {
this.getDetail()
})
} else {
this.$u.toast(res.msg)
}
})
.catch((e) => {
this.$hideLoading()
this.$u.toast(e)
})
this.$nextTick(() => {
this.getDetail()
})
} else {
this.$u.toast(res.msg)
}
})
},
adddeleShow(id) {
this.deleId = id
this.deleShow = true
},
confirmDelete() {
this.$http.post(`/app/appvillagediscussmessage/delete?ids=${this.deleId}`).then((res) => {
if (res?.data) {
this.deleShow = false
this.modalShow = false
this.deleId = ''
this.getDetail()
}
})
this.$http
.post(`/app/appvillagediscussmessage/delete?ids=${this.deleId}`)
.then((res) => {
if (res?.data) {
this.deleShow = false
this.modalShow = false
this.deleId = ''
this.getDetail()
}
})
.catch((e) => {
this.$hideLoading()
this.$u.toast(e)
})
},
publish() {
@@ -293,7 +294,7 @@ export default {
})
.then((res) => {
if (res?.code == 0) {
this.$u.toast('结束公示!')
this.$u.toast('结束公示成功!')
this.getDetail()
}
})