From 8497f0238a403ed0e4693224c31031b4829d5b40 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: Thu, 23 Dec 2021 11:54:21 +0800 Subject: [PATCH] tabIndex --- src/apps/AppResidentActivitie/Add.vue | 137 +++++-------- .../AppResidentActivities.vue | 1 + src/apps/AppResidentActivitie/Detail.vue | 190 +++--------------- src/apps/AppResidentFile/AppResidentFile.vue | 4 +- 4 files changed, 82 insertions(+), 250 deletions(-) diff --git a/src/apps/AppResidentActivitie/Add.vue b/src/apps/AppResidentActivitie/Add.vue index 07467382..484a600d 100644 --- a/src/apps/AppResidentActivitie/Add.vue +++ b/src/apps/AppResidentActivitie/Add.vue @@ -12,30 +12,20 @@
- - + +
- - - - - - - - - - - - + +
- - + + @@ -46,24 +36,18 @@ - - - - - - - - + +
- - + + - - + + @@ -87,32 +71,28 @@ export default { forms: { title: '', content: '', - fileIds: [], - status: '', - statusValue: '', + url: [], + areaId: '', - fanwe: '', - nums: '', - startTime: '', + beginTime: '', endTime: '', + address: '', + contactPerson: '', - deadTime: '', - areaNmae: '', - people: '', - phone: '', + contactPhone: '', }, - showStstus: false, + showStartTime: false, showEndTime: false, - showDeadTime: false, flag: false, + areaId: '', params: { year: true, month: true, day: true, hour: true, minute: true, - second: true, + second: false, timestamp: true, }, } @@ -120,9 +100,11 @@ export default { computed: { ...mapState(['user']) }, onLoad(o) { console.log(o) - this.id = o.id + this.id = o.id ? o.id : '' this.$dict.load('realityStatus').then(() => { // this.getDetail() + this.areaId = this.user.areaId + this.forms.areaId = this.user.areaId }) }, @@ -132,11 +114,7 @@ export default { // this.$http.post(`/app/appvisitvondolence/queryDetailById?id=${this.id}`).then((res) => { // if (res?.data) { // this.forms = res.data - // this.forms.statusValue = res.data.status - // this.forms.status = this.$dict.getLabel('realityStatus', res.data.status) - // if (res.data.images) { - // this.forms.images = JSON.parse(res.data.images || '[]') - // } + // // } // }) // }, @@ -152,40 +130,28 @@ export default { if (!this.forms.content) { return this.$u.toast('请输入活动详情') } - if (this.forms.fileIds.length == 0) { + if (this.forms.url.length == 0) { return this.$u.toast('请选择活动封面图') } - if (!this.forms.status) { - return this.$u.toast('请选择活动类型') - } - if (!this.forms.fanwe) { - return this.$u.toast('请选择报名范围') - } - if (!this.forms.nums) { - return this.$u.toast('请输入活动名额') - } - if (!this.forms.startTime) { + if (!this.forms.beginTime) { return this.$u.toast('请选择开始时间') } if (!this.forms.endTime) { return this.$u.toast('请选择结束时间') } - if (!this.forms.deadTime) { - return this.$u.toast('请选择报名截止时间') - } - if (!this.forms.areaNmae) { + if (!this.forms.address) { return this.$u.toast('请输入活动地点') } - if (!this.forms.people) { + if (!this.forms.contactPerson) { return this.$u.toast('请输入联系人') } - if (!this.forms.phone) { + if (!this.forms.contactPhone) { return this.$u.toast('请输入联系方式') } const imgs = [] - if (this.forms.fileIds) { - this.forms.fileIds.map((e) => { + if (this.forms.url) { + this.forms.url.map((e) => { imgs.push({ url: e.url, id: e.id }) }) } @@ -195,20 +161,15 @@ export default { .post(`/app/appvillageactivityinfo/addOrUpdate`, { title: this.forms.title, content: this.forms.content, - images: JSON.stringify(imgs) || [], - // images: imgs || [], + url: JSON.stringify(imgs) || [], + areaId: this.forms.areaId, - status: this.forms.statusValue ? this.forms.statusValue : this.forms.status, - fanwe: this.forms.fanwe, - nums: this.forms.fanumsnwe, - - startTime: this.forms.startTime, + beginTime: this.forms.beginTime, endTime: this.forms.endTime, - deadTime: this.forms.deadTime, - areaNmae: this.forms.areaNmae, + address: this.forms.address, + contactPerson: this.forms.contactPerson, - people: this.forms.people, - phone: this.forms.phone, + contactPhone: this.forms.contactPhone, id: this.id, }) .then((res) => { @@ -226,22 +187,22 @@ export default { confirm(e) { if (this.showStartTime == true) { - console.log(1, e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second) - this.forms.startTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second + console.log(1, e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + '00') + this.forms.beginTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + '00' } if (this.showEndTime == true) { - console.log(2, e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second) - this.forms.endTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second - } - if (this.showDeadTime == true) { - console.log(3, e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second) - this.forms.deadTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second + console.log(2, e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + '00') + this.forms.endTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + '00' } }, - selectStatus(e) { - this.forms.status = e[0].label - this.forms.statusValue = e[0].value + areaSelect(e) { + if (e.type == 5) { + this.forms.areaId = e.id + } + if (e.type == 4) { + this.forms.areaId = e.id + } }, }, } diff --git a/src/apps/AppResidentActivitie/AppResidentActivities.vue b/src/apps/AppResidentActivitie/AppResidentActivities.vue index c8ad98fa..488c283e 100644 --- a/src/apps/AppResidentActivitie/AppResidentActivities.vue +++ b/src/apps/AppResidentActivitie/AppResidentActivities.vue @@ -96,6 +96,7 @@ export default { this.datas.map((item) => { if (item.url) { item.url = JSON.parse(item.url || '[]') + console.log(item.url) } return item }) diff --git a/src/apps/AppResidentActivitie/Detail.vue b/src/apps/AppResidentActivitie/Detail.vue index 765ba0fd..f409bf37 100644 --- a/src/apps/AppResidentActivitie/Detail.vue +++ b/src/apps/AppResidentActivitie/Detail.vue @@ -2,7 +2,7 @@
- +
@@ -10,7 +10,7 @@
-
{{ $dict.getLabel('newActivityStatus', detail.status) }}
+
{{ $dict.getLabel('villageActivityStatus', detail.status) }}
@@ -20,7 +20,7 @@
活动时间
-
{{ detail.beginTime }}-{{ detail.endTime }}
+
{{ detail.beginTime && detail.beginTime.substring(0, detail.beginTime.length - 2) }}
@@ -54,7 +54,7 @@