diff --git a/src/mods/AppVillager/AppVillager.vue b/src/mods/AppVillager/AppVillager.vue index 00635b8..754977b 100644 --- a/src/mods/AppVillager/AppVillager.vue +++ b/src/mods/AppVillager/AppVillager.vue @@ -1,5 +1,5 @@ @@ -103,6 +115,7 @@ export default { props: {}, data() { return { + showPage: false, tabs: [ { name: '本村', @@ -152,6 +165,10 @@ export default { show: false, TopicValue: '0', TopicName: '美丽庭院', + flag: false, + delAndEdit: false, + editId: '', + statDisabled: '', } }, computed: { ...mapState(['user']) }, @@ -174,8 +191,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' : '', }, }) @@ -184,30 +202,50 @@ export default { this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records } }) + .finally(() => { + this.showPage = true + }) }, - 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) { - if (item) { - this.$linkTo(`./add?id=${item.id}`) + toAdd(index) { + if (this.statDisabled == 0 && index == 0) { + this.delAndEdit = false + return this.$u.toast('该数据未审核') + } + + this.delAndEdit = false + if (index == 0) { + this.$linkTo(`./add?id=${this.editId}`) } else { this.$linkTo(`./add`) } @@ -215,17 +253,22 @@ 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.statDisabled = '' + this.$u.toast('删除成功') + this.init() } }) .catch((e) => { - this.$hideLoading() this.$u.toast(e) }) }, @@ -233,6 +276,9 @@ export default { conTopic(e) { this.TopicValue = e[0].value this.TopicName = e[0].label + this.$nextTick(() => { + this.init() + }) }, previewImage(images, img) { @@ -241,6 +287,29 @@ 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 + }) + }, + + toDel() {}, }, onReachBottom() { this.current = this.current + 1 @@ -274,10 +343,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; @@ -344,6 +415,9 @@ export default { font-size: 26px; color: #6e727a; margin-top: 6px; + .topics { + margin-right: 8px; + } } } @@ -362,10 +436,16 @@ export default { .status2 { color: #ff883c; } - .dels { - margin-left: 20px; - width: 68px; - height: 68px; + .statusRight { + display: flex; + flex-direction: column; + align-items: center; + .dels { + position: relative; + margin-left: 20px; + width: 68px; + height: 68px; + } } } } @@ -431,7 +511,7 @@ export default { padding: 24px; background: #f3f6f9; border-radius: 16px; - margin: 24px; + margin-top: 24px; .toReply { font-size: 26px; color: #999999; @@ -485,5 +565,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..e0bdf03 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() {}, @@ -75,6 +76,9 @@ export default { if (!this.forms.content) { return this.$u.toast('请输入内容') } + if (!this.forms.gpsDesc) { + return this.$u.toast('请选择所在位置') + } if (!this.forms.lat && !this.forms.lng) { return this.$u.toast('请选择所在位置') } @@ -89,14 +93,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 +127,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 1e689d4..5dedcb6 100644 --- a/src/mods/AppVillager/detail.vue +++ b/src/mods/AppVillager/detail.vue @@ -6,20 +6,23 @@
- +
- {{ detail.createUserName }} + {{ detail.createUserName || detail.replyUserName }} - {{ $dict.getLabel('villagerCircleTopic', detail.topic) }} | {{ detail.status }} + + {{ $dict.getLabel('villagerCircleTopic', detail.topic) }} | + {{ detail.createTime }} +
{{ $dict.getLabel('auditStatus', detail.status) }}
删除
- +
@@ -38,30 +41,44 @@
- +
- - + + +
-
+
- - 张三、李四、陶白白等12人 + + + {{ items.replyUserName }} + 等{{ detail.comments.length }}人
-
- 张三: - 非常不错! +
+ {{ item.replyUserName }} : + {{ item.content }} +
+
+ +
+
+ + + {{ items.replyUserName }} + 等{{ detail.villagerCircleInfo.comments.length }}人
-
- 张三: - 为什么不带上我呢!为什么不带上我呢!为什么不带上我呢! +
+ {{ item.replyUserName }} : + {{ item.content }}
@@ -101,7 +118,7 @@ export default { return { id: '', avatarUrl: '', - data: {}, + detail: {}, poupShow: false, content: '', flag: false, @@ -109,34 +126,36 @@ export default { deleShow: false, modalShow: false, deleId: '', + flagLike: false, + tabCurrent1: '', + delAndEdit: '', } }, 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,32 +170,38 @@ 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) { - this.$u.toast('留言成功') + this.$u.toast('发送成功') 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(this.detail.upFlag == 0 ? '点赞成功' : '取消点赞成功') this.getDetail() + setTimeout(() => { + this.flagLike = false + }, 600) } }) .catch((err) => { this.$u.toast(err) + this.flagLike = false }) }, @@ -184,10 +209,11 @@ 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.$u.toast('删除成功') this.getDetail() } }) @@ -198,8 +224,7 @@ export default { }, deleShowBtn(item) { - // this.deleId = item.id - this.deleId = '999' + this.deleId = item.id this.deleShow = true }, @@ -235,10 +260,9 @@ export default { } .middle { - padding-bottom: 48px; + padding: 32px 0 48px 0; .cardTop { display: flex; - margin-top: 32px; img { width: 96px; height: 96px; @@ -261,6 +285,9 @@ export default { font-size: 26px; color: #6e727a; margin-top: 6px; + .topics { + margin-right: 8px; + } } } @@ -282,7 +309,7 @@ export default { .dels { margin-left: 20px; width: 68px; - height: 68px; + // height: 68px; } } } @@ -363,6 +390,7 @@ export default { font-weight: 500; .nameLeft { color: #485d87; + margin-right: 12px; } .contRight { color: #485d87;