diff --git a/src/mods/AppVillager/AppVillager.vue b/src/mods/AppVillager/AppVillager.vue index 00635b8..b0c8078 100644 --- a/src/mods/AppVillager/AppVillager.vue +++ b/src/mods/AppVillager/AppVillager.vue @@ -20,30 +20,35 @@
- +
- {{ item.createUserName }} + {{ item.createUserName || user.realName }} - {{ $dict.getLabel('villagerCircleTopic', item.topic) }} | {{ item.createTime }} + + {{ $dict.getLabel('villagerCircleTopic', item.topic) }} | + {{ item.createTime }} +
{{ $dict.getLabel('auditStatus', item.status) }}
-
编辑
-
删除
- +
+
编辑
+
删除
+
+
-
+
{{ item.content }}
- +
@@ -54,28 +59,30 @@
- +
- - + + + +
-
针不戳!
+
{{ item.content }}
- 回复的话 - + 回复的话题 : + {{ item.villagerCircleInfo.content }}
-
+
未通过理由: - 请勿带情绪进行评论 + {{ item.auditOpinion }}
@@ -152,6 +159,7 @@ export default { show: false, TopicValue: '0', TopicName: '美丽庭院', + flag: false, } }, computed: { ...mapState(['user']) }, @@ -174,8 +182,9 @@ export default { size: 6, current: this.current, topic: this.tabIndex0 != 3 ? this.TopicValue : '', + status: this.tabIndex0 == 3 && this.indexTab2 == 0 ? '' : this.tabIndex0 == 3 && this.indexTab2 == 1 ? 1 : this.tabIndex0 == 3 && this.indexTab2 == 2 ? 2 : this.tabIndex0 == 3 && this.indexTab2 == 3 ? 0 : '', + areaId: this.tabIndex0 != 3 ? this.user.areaId : '', - residentId: this.tabIndex0 != 3 ? this.user.residentId : '', listType: this.tabIndex0 == 3 && this.tabCurrent1 == 0 ? '0' : this.tabIndex0 == 3 && this.tabCurrent1 == 1 ? '1' : this.tabIndex0 == 0 ? '0' : this.tabIndex0 == 1 ? '1' : this.tabIndex0 == 2 ? '2' : '', }, }) @@ -186,23 +195,34 @@ export default { }) }, - change(index) { + init() { this.data = [] - this.tabIndex0 = index this.current = 1 this.getList() }, + change(index) { + this.tabIndex0 = index + this.init() + }, + changetabIndex(e) { this.tabCurrent1 = e + this.$nextTick(() => { + this.indexTab2 = 0 + this.init() + }) }, hander(i) { this.indexTab2 = i + this.$nextTick(() => { + this.init() + }) }, toDetail(item) { - this.$linkTo(`./detail?id=${item.id}&avatarUrl=${item.avatarUrl}`) + this.$linkTo(`./detail?id=${item.id}&avatarUrl=${item.avatarUrl ? item.avatarUrl : ''}&tabCurrent1=${this.tabCurrent1}`) }, toAdd(item) { @@ -233,6 +253,9 @@ export default { conTopic(e) { this.TopicValue = e[0].value this.TopicName = e[0].label + this.$nextTick(() => { + this.init() + }) }, previewImage(images, img) { @@ -241,6 +264,27 @@ export default { current: img, }) }, + + like(item) { + if (this.flag) return + + this.flag = true + this.$instance + .post(`/app/appvillagercircleinfo/up?id=${item.id}`) + .then((res) => { + if (res.code === 0) { + this.$u.toast(item.upFlag == 0 ? '点赞成功' : '取消点赞成功') + this.init() + setTimeout(() => { + this.flag = false + }, 600) + } + }) + .catch((err) => { + this.$u.toast(err) + this.flag = false + }) + }, }, onReachBottom() { this.current = this.current + 1 @@ -344,6 +388,9 @@ export default { font-size: 26px; color: #6e727a; margin-top: 6px; + .topics { + margin-right: 8px; + } } } @@ -362,10 +409,15 @@ export default { .status2 { color: #ff883c; } - .dels { - margin-left: 20px; - width: 68px; - height: 68px; + .statusRight { + display: flex; + flex-direction: column; + align-items: center; + .dels { + margin-left: 20px; + // width: 68px; + // height: 68px; + } } } } diff --git a/src/mods/AppVillager/detail.vue b/src/mods/AppVillager/detail.vue index 1e689d4..5426af0 100644 --- a/src/mods/AppVillager/detail.vue +++ b/src/mods/AppVillager/detail.vue @@ -6,20 +6,20 @@
- +
{{ detail.createUserName }} - {{ $dict.getLabel('villagerCircleTopic', detail.topic) }} | {{ detail.status }} + {{ $dict.getLabel('villagerCircleTopic', detail.topic) }} | {{ detail.createTime }}
{{ $dict.getLabel('auditStatus', detail.status) }}
删除
- +
@@ -38,30 +38,28 @@
- +
- - + +
- - 张三、李四、陶白白等12人 + + + {{ items.replyUserName }} + 等{{ detail.villagerCircleInfo ? detail.villagerCircleInfo.comments.length : detail.comments.length }}人
-
- 张三: - 非常不错! -
- -
- 张三: - 为什么不带上我呢!为什么不带上我呢!为什么不带上我呢! +
+ {{ item.replyUserName }} : + {{ item.content }}
@@ -101,7 +99,7 @@ export default { return { id: '', avatarUrl: '', - data: {}, + detail: {}, poupShow: false, content: '', flag: false, @@ -109,34 +107,35 @@ export default { deleShow: false, modalShow: false, deleId: '', + flagLike: false, + tabCurrent1: '', } }, computed: { ...mapState(['user']) }, watch: {}, onLoad(o) { this.$dict.load('villagerCircleTopic').then(() => { + console.log(o) this.id = o.id this.avatarUrl = o.avatarUrl + this.tabCurrent1 = o.tabCurrent1 this.getDetail() }) }, onShow() {}, methods: { getDetail() { - this.$instance.post(`/app/appvillagercircleinfo/queryDetailById?id=${this.id}`).then((res) => { - if (res.code == 0) { - this.detail = res.data - this.getReplyList() - } - }) - }, - - getReplyList() { - this.$instance.post(`/app/appvillagercirclecomment/list?id=${detail.id}&size=999`).then((res) => { - if (res.code == 0) { - this.replylist = res.data.records - } - }) + this.$instance + .post(this.tabCurrent1 == 0 ? '/app/appvillagercircleinfo/queryDetailById' : '/app/appvillagercirclecomment/queryDetailById', null, { + params: { + id: this.id, + }, + }) + .then((res) => { + if (res.code == 0) { + this.detail = res.data + } + }) }, send() { @@ -151,7 +150,7 @@ export default { replyUserResidentId: this.user.id, replyUserName: this.user.name, areaId: this.$areaId, - id: '888', + vcId: this.detail.id, }) .then((res) => { if (res?.code == 0) { @@ -159,24 +158,30 @@ export default { this.flag = false this.content = '' this.poupShow = false - // this.getDetail() + this.getDetail() } }) }, like() { - var id = '88' + if (this.flagLike) return + + this.flagLike = true this.$instance - .post(`/app/appvillagediscussmessage/suport?id=${id}&userId=${this.user.id}`) + .post(`/app/appvillagercircleinfo/up?id=${this.detail.id}&userId=${this.user.id}`) .then((res) => { this.$hideLoading() if (res.code === 0) { - this.$u.toast('点赞成功') + this.$u.toast(detail.upFlag == 0 ? '点赞成功' : '取消点赞成功') this.getDetail() + setTimeout(() => { + this.flagLike = false + }, 600) } }) .catch((err) => { this.$u.toast(err) + this.flagLike = false }) }, @@ -235,10 +240,9 @@ export default { } .middle { - padding-bottom: 48px; + padding: 32px 0 48px 0; .cardTop { display: flex; - margin-top: 32px; img { width: 96px; height: 96px; @@ -282,7 +286,7 @@ export default { .dels { margin-left: 20px; width: 68px; - height: 68px; + // height: 68px; } } } @@ -363,6 +367,7 @@ export default { font-weight: 500; .nameLeft { color: #485d87; + margin-right: 12px; } .contRight { color: #485d87;