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 @@
{{ $dict.getLabel('villageActivityStatus', detail.status) }}
- - - {{ detail.contactPerson }} + + + {{ user.name }}
@@ -199,7 +199,7 @@ export default { }, toAdd() { - uni.navigateTo({ url: `./Add?id=${this.id}` }) + uni.navigateTo({ url: `./Add?id=${this.id}&index=11` }) }, AddPosts() {