From f189e1319579bc977e82679f300ea20d6aa7fc6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E6=9C=89=E6=B8=85=E9=A6=99=E6=9C=88=E6=9C=89?= =?UTF-8?q?=E9=98=B4?= <185154740@qq.com> Date: Fri, 18 Feb 2022 15:45:31 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=9D=91=E6=B0=91=E5=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mods/AppVillager/AppVillager.vue | 100 ++++++++++++++++++++------- src/mods/AppVillager/detail.vue | 83 +++++++++++----------- 2 files changed, 120 insertions(+), 63 deletions(-) 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; From 9221b97d913ea70e1274b63f2550151b13d832c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E6=9C=89=E6=B8=85=E9=A6=99=E6=9C=88=E6=9C=89?= =?UTF-8?q?=E9=98=B4?= <185154740@qq.com> Date: Fri, 18 Feb 2022 16:03:18 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=82=B9=E8=B5=9Ebug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mods/AppVillager/detail.vue | 35 +++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/mods/AppVillager/detail.vue b/src/mods/AppVillager/detail.vue index 5426af0..8e6927f 100644 --- a/src/mods/AppVillager/detail.vue +++ b/src/mods/AppVillager/detail.vue @@ -43,21 +43,37 @@
- + +
-
+
- {{ items.replyUserName }} - 等{{ detail.villagerCircleInfo ? detail.villagerCircleInfo.comments.length : detail.comments.length }}人{{ items.replyUserName }} + 等{{ detail.comments.length }}人
-
+
+ {{ item.replyUserName }} : + {{ item.content }} +
+
+ +
+
+ + + {{ items.replyUserName }} + 等{{ detail.villagerCircleInfo.comments.length }}人 +
+ +
{{ item.replyUserName }} : {{ item.content }}
@@ -172,7 +188,7 @@ export default { .then((res) => { this.$hideLoading() if (res.code === 0) { - this.$u.toast(detail.upFlag == 0 ? '点赞成功' : '取消点赞成功') + this.$u.toast(this.detail.upFlag == 0 ? '点赞成功' : '取消点赞成功') this.getDetail() setTimeout(() => { this.flagLike = false @@ -189,10 +205,10 @@ export default { this.$instance .post(`/app/appvillagercirclecomment/delete?ids=${this.deleId}`) .then((res) => { - if (res?.data) { + if (res.code == 0) { this.deleShow = false - this.modalShow = false this.deleId = '' + this.modalShow = false this.getDetail() } }) @@ -203,8 +219,7 @@ export default { }, deleShowBtn(item) { - // this.deleId = item.id - this.deleId = '999' + this.deleId = item.id this.deleShow = true }, From e0ddc13369408630106d9863842a8a7dda5f8288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E6=9C=89=E6=B8=85=E9=A6=99=E6=9C=88=E6=9C=89?= =?UTF-8?q?=E9=98=B4?= <185154740@qq.com> Date: Fri, 18 Feb 2022 17:51:56 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9D=91=E6=B0=91=E5=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mods/AppVillager/AppVillager.vue | 72 +++++++++++++++++++++------- src/mods/AppVillager/add.vue | 20 ++++---- src/mods/AppVillager/detail.vue | 11 ++++- 3 files changed, 76 insertions(+), 27 deletions(-) diff --git a/src/mods/AppVillager/AppVillager.vue b/src/mods/AppVillager/AppVillager.vue index b0c8078..599eaac 100644 --- a/src/mods/AppVillager/AppVillager.vue +++ b/src/mods/AppVillager/AppVillager.vue @@ -35,11 +35,12 @@
{{ $dict.getLabel('auditStatus', item.status) }}
-
+ +
--> + +
@@ -91,12 +92,16 @@
- -
发起审核
+ + + +
+
编辑
+
删除
+
+
@@ -160,6 +165,8 @@ export default { TopicValue: '0', TopicName: '美丽庭院', flag: false, + delAndEdit: false, + editId: '', } }, computed: { ...mapState(['user']) }, @@ -225,9 +232,10 @@ export default { this.$linkTo(`./detail?id=${item.id}&avatarUrl=${item.avatarUrl ? item.avatarUrl : ''}&tabCurrent1=${this.tabCurrent1}`) }, - toAdd(item) { - if (item) { - this.$linkTo(`./add?id=${item.id}`) + toAdd(index) { + this.delAndEdit = false + if (index == 0) { + this.$linkTo(`./add?id=${this.editId}`) } else { this.$linkTo(`./add`) } @@ -235,17 +243,20 @@ export default { confirmDel() { this.$instance - .post(`/app/appvillagercircleinfo/delete?ids=${this.deleId}`) + .post(this.tabIndex0 == 3 && this.tabCurrent1 == 1 ? '/app/appvillagercirclecomment/delete' : '/app/appvillagercircleinfo/delete', null, { + params: { + ids: this.deleId, + }, + }) .then((res) => { - if (res?.data) { + if (res.code == 0) { this.deleShow = false this.modalShow = false this.deleId = '' - this.getDetail() + this.init() } }) .catch((e) => { - this.$hideLoading() this.$u.toast(e) }) }, @@ -285,6 +296,8 @@ export default { this.flag = false }) }, + + toDel() {}, }, onReachBottom() { this.current = this.current + 1 @@ -318,10 +331,12 @@ export default { } .top { - padding: 0 0 32px 16px; + padding: 0 16px 32px 16px; background: #fff; border-radius: 32px 32px 0px 0px; margin-top: -30px; + overflow: hidden; + .tabIndex012 { padding-top: 32px; display: flex; @@ -414,9 +429,10 @@ export default { flex-direction: column; align-items: center; .dels { + position: relative; margin-left: 20px; - // width: 68px; - // height: 68px; + width: 68px; + height: 68px; } } } @@ -537,5 +553,27 @@ export default { border-radius: 50%; box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); } + + ::v-deep .u-mask { + .warp { + position: absolute; + top: 251px; + right: 70px; + display: flex; + flex-direction: column; + align-items: center; + width: 45%; + height: 22%; + box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); + border-radius: 5%; + .rect { + height: 50%; + width: 100%; + text-align: center; + line-height: 4; + background: #fff; + } + } + } } diff --git a/src/mods/AppVillager/add.vue b/src/mods/AppVillager/add.vue index 3831875..7d34f86 100644 --- a/src/mods/AppVillager/add.vue +++ b/src/mods/AppVillager/add.vue @@ -2,8 +2,8 @@
- - + + @@ -60,6 +60,7 @@ export default { onLoad(o) { this.$dict.load('villagerCircleTopic').then(() => { this.id = o.id + this.getDetail() }) }, onShow() {}, @@ -89,14 +90,15 @@ export default { this.flag = true this.$instance .post(`/app/appvillagercircleinfo/addOrUpdate`, { - topic: this.forms.topicValue, + topic: this.forms.topic, content: this.forms.content, pictures: imgs || [], createUserResidentId: this.user.id, areaId: this.$areaId, - gpsDesc: this.gpsDesc, + gpsDesc: this.forms.gpsDesc, lat: this.forms.lat, lng: this.forms.lng, + id: this.id, }) .then((res) => { if (res.code == 0) { @@ -122,22 +124,24 @@ export default { if (this.id) { this.$instance.post(`/app/appvillagercircleinfo/queryDetailById?id=${this.id}`).then((res) => { if (res.code == 0) { - // this.forms = res.data + this.forms = res.data + console.log(this.form) + this.forms.topicValue = this.$dict.getLabel('villagerCircleTopic', this.forms.topic) } }) } }, selectStatus(e) { - this.forms.topic = e[0].label - this.forms.topicValue = e[0].value + this.forms.topic = e[0].value + this.forms.topicValue = e[0].label }, chooseAddress() { uni.chooseLocation({ success: (res) => { console.log(res) - this.forms.gpsDesc = res.gpsDesc + this.forms.gpsDesc = res.name this.forms.lat = res.latitude this.forms.lng = res.longitude }, diff --git a/src/mods/AppVillager/detail.vue b/src/mods/AppVillager/detail.vue index 8e6927f..1cf6b2f 100644 --- a/src/mods/AppVillager/detail.vue +++ b/src/mods/AppVillager/detail.vue @@ -10,9 +10,12 @@
- {{ detail.createUserName }} + {{ detail.createUserName || detail.replyUserName }} - {{ $dict.getLabel('villagerCircleTopic', detail.topic) }} | {{ detail.createTime }} + + {{ $dict.getLabel('villagerCircleTopic', detail.topic) }} | + {{ detail.createTime }} +
@@ -125,6 +128,7 @@ export default { deleId: '', flagLike: false, tabCurrent1: '', + delAndEdit: '', } }, computed: { ...mapState(['user']) }, @@ -280,6 +284,9 @@ export default { font-size: 26px; color: #6e727a; margin-top: 6px; + .topics { + margin-right: 8px; + } } } From b0c57fbc6ed94d3f967a18bfc2c9bbf24a66716a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E6=9C=89=E6=B8=85=E9=A6=99=E6=9C=88=E6=9C=89?= =?UTF-8?q?=E9=98=B4?= <185154740@qq.com> Date: Fri, 18 Feb 2022 18:34:57 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mods/AppVillager/AppVillager.vue | 20 ++++++++++++++++---- src/mods/AppVillager/add.vue | 3 +++ src/mods/AppVillager/detail.vue | 3 ++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/mods/AppVillager/AppVillager.vue b/src/mods/AppVillager/AppVillager.vue index 599eaac..8dd5a19 100644 --- a/src/mods/AppVillager/AppVillager.vue +++ b/src/mods/AppVillager/AppVillager.vue @@ -1,5 +1,5 @@