From a24d69b7e2add4d0681a1eb1e90c802ab6dd9a48 Mon Sep 17 00:00:00 2001 From: fengachen <373943794@qq.com> Date: Wed, 20 Oct 2021 15:46:22 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90bug=E3=80=91=E6=8A=A5=E5=90=8D?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=20=E4=BC=9A=E8=AE=AE=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E6=8A=A5=E5=90=8D=E6=8C=89=E9=92=AE=E6=B6=88=E5=A4=B1=20?= =?UTF-8?q?=E7=BB=99=E5=87=BA=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/signUp/SignUpEntrance.vue | 54 +++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/src/views/signUp/SignUpEntrance.vue b/src/views/signUp/SignUpEntrance.vue index 6928e82..f60f157 100644 --- a/src/views/signUp/SignUpEntrance.vue +++ b/src/views/signUp/SignUpEntrance.vue @@ -36,7 +36,7 @@ - {{holdtime}} + {{ holdtime }} @@ -46,7 +46,7 @@ - {{holdAddress}} + {{ holdAddress }} @@ -60,7 +60,8 @@ - + @@ -69,7 +70,8 @@ - 立即报名 + 立即报名 + @@ -84,7 +86,7 @@ import {getMeetInfoById} from '@api/incomeMeetingApi' export default { name: 'SignUpEntrance', - components:{ + components: { PreviewFile }, data() { @@ -97,11 +99,13 @@ export default { // 会议费用 meetingMoney: '', // 召开时间 - holdtime:'', + holdtime: '', // 召开地点 - holdAddress:'', + holdAddress: '', // 会议id - meetingId:'' + meetingId: '', + // 当前时间是否超过报名截止时间 + invalidationBool: false } }, created() { @@ -109,7 +113,7 @@ export default { let id = this.GetQueryString('id') this.meetingId = id document.title = '报名入口' - if(id){ + if (id) { this.getMeetingInfo(id) } }, @@ -141,7 +145,7 @@ export default { this.$router.push({ path: '/signUpPage', query: { - id:this.meetingId + id: this.meetingId } }) }, @@ -152,6 +156,14 @@ export default { getMeetInfoById({id: params}).then(res => { if (res.success) { this.currentMeetingInfo = res.result + // true超过了 false 未超过 + this.invalidationBool = this.compareCurrentTime(res.result.registerDeadline) + if (this.invalidationBool) { + this.$notification.error({ + message: '系统提示', + description: '当前会议超出报名时间,不可报名!' + }) + } // 初始化会议费用 if (this.currentMeetingInfo.meetingCostsVip) { this.meetingMoney = `普通会员(${this.currentMeetingInfo.meetingCosts}/人) 标协会员(${this.currentMeetingInfo.meetingCostsVip}/人)` @@ -159,11 +171,11 @@ export default { this.meetingMoney = `普通会员(${this.currentMeetingInfo.meetingCosts}/人)` } // 初始化召开时间 - if(this.currentMeetingInfo.startTime){ + if (this.currentMeetingInfo.startTime) { this.holdtime = this.currentMeetingInfo.startTime + '~' + this.currentMeetingInfo.endTime } // 初始化召开地点 - if(this.currentMeetingInfo.venue){ + if (this.currentMeetingInfo.venue) { this.holdAddress = this.currentMeetingInfo.venue + '/' + this.currentMeetingInfo.address } } else { @@ -172,6 +184,18 @@ export default { }) }, /* + * 当前时间是否超过会议报名时间 + * */ + compareCurrentTime(time) { + let date = new Date() + let compareTime = new Date(time) + if (date.getTime() > compareTime.getTime()) { + return true + } else { + return false + } + }, + /* * 会议类型 * */ initMeetingType(val) { @@ -193,9 +217,9 @@ export default { } }, /** - * 获取url的参数 - * @param name要获取的参数名 - * */ + * 获取url的参数 + * @param name要获取的参数名 + * */ GetQueryString(name) { var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)') var r = window.location.search.substr(1).match(reg)