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)