diff --git a/src/views/activity/detail.vue b/src/views/activity/detail.vue index bbf38ae..704bfed 100644 --- a/src/views/activity/detail.vue +++ b/src/views/activity/detail.vue @@ -46,7 +46,7 @@ 转发 - 立即报名 + 立即报名 @@ -113,29 +113,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); @@ -175,7 +181,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: {}, }