From 4ea78acc5c2aa8042dfbce46ea1612aaf5a9c61a 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, 24 Dec 2021 18:26:31 +0800 Subject: [PATCH] 25939 --- src/apps/AppResidentActivitie/Add.vue | 28 ++++++++++++++---------- src/apps/AppResidentActivitie/Detail.vue | 8 +++---- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/apps/AppResidentActivitie/Add.vue b/src/apps/AppResidentActivitie/Add.vue index 1eb6edba..63381ef9 100644 --- a/src/apps/AppResidentActivitie/Add.vue +++ b/src/apps/AppResidentActivitie/Add.vue @@ -66,6 +66,7 @@ export default { data() { return { id: '', + indexDetail: '', forms: { title: '', content: '', @@ -97,17 +98,18 @@ export default { }, computed: { ...mapState(['user']) }, onLoad(o) { + this.indexDetail = o.index this.id = o.id ? o.id : '' this.$dict.load('realityStatus').then(() => { this.areaId = this.user.areaId this.forms.areaId = this.user.areaId - this.user.phone = this.forms.contactPhone - this.user.name = this.forms.contactPerson this.getDetail() }) - - console.log(this.user) + if (!this.indexDetail) { + this.forms.contactPhone = this.user.phone + this.forms.contactPerson = this.user.name + } }, onShow() { document.title = '发布活动' @@ -116,16 +118,18 @@ export default { mounted() {}, methods: { getDetail() { - this.$http.post(`/app/appvillageactivityinfo/queryDetailById?id=${this.id}`).then((res) => { - if (res?.data) { - this.forms = res.data - if (res.data) { - if (res.data.url) { - this.forms.url = JSON.parse(res.data.url || '[]') + if (this.indexDetail) { + this.$http.post(`/app/appvillageactivityinfo/queryDetailById?id=${this.id}`).then((res) => { + if (res?.data) { + this.forms = res.data + if (res.data) { + if (res.data.url) { + this.forms.url = JSON.parse(res.data.url || '[]') + } } } - } - }) + }) + } }, submit() { diff --git a/src/apps/AppResidentActivitie/Detail.vue b/src/apps/AppResidentActivitie/Detail.vue index a426edba..265afffa 100644 --- a/src/apps/AppResidentActivitie/Detail.vue +++ b/src/apps/AppResidentActivitie/Detail.vue @@ -13,9 +13,9 @@