From cde41558c7717c61d6494d0e089e30156059ce95 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Tue, 16 Jul 2024 10:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E8=AF=A6=E6=83=85=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/activity/detail.vue | 42 +++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/src/views/activity/detail.vue b/src/views/activity/detail.vue index d8846ea..d3d59e6 100644 --- a/src/views/activity/detail.vue +++ b/src/views/activity/detail.vue @@ -47,7 +47,7 @@ 转发 - 立即报名 + 立即报名 @@ -124,29 +124,35 @@ export default { this.isPast = specifiedTimestamp < currentTimestamp; }, async detail(id, delId) { - if (delId) { - this.signUp = this.signUp.filter(item => item.id != delId) - } else { - let res = await detail(id) + const handleResponse = (res) => { if (res.code === 0) { - this.info = res.data; - if (res.data.recordList.length != 0) { - this.signUp = res.data.recordList - } - if (res.data.cutOffTime) { - this.checkIfPast() - } + this.info = res.data; + this.info.participants = res.data.participants; + this.info.currentParticipants = res.data.currentParticipants; + if (res.data.recordList && res.data.recordList.length > 0) { + this.signUp = res.data.recordList; + } + if (res.data.cutOffTime) { + this.checkIfPast(); } + } + }; + if (delId) { + this.signUp = this.signUp.filter(item => item.id != delId); } + + let res = await detail(id); + handleResponse(res); }, handelAddResi() { this.signUp.push({ name: "", mobile: "", remark: "", }) }, handelDelResi(item, index) { if (item.id) { + let than = this communityActivityApplicationRecordDelete([item.id]).then(res => { if (res.code === 0) { - this.detail(this.$route.query.id, item.id); + than.detail(this.$route.query.id, item.id); } }).catch(err => { console.log(err); @@ -186,7 +192,15 @@ export default { }, }, components: { Share, registerDialog }, - computed: {}, + computed: { + disabledRecord() { + return (item) => { + if (!item.cutOffTime || item.online != 1) return true + let flag = new Date(item.cutOffTime.replace(/-/g, '/')).getTime() < Date.now() || item.currentParticipants >= item.participants || item.currentParticipants >= item.participants; + return flag || false + } + }, + }, watch: {}, }