|
|
|
@ -83,8 +83,8 @@ |
|
|
|
|
<p>比赛时间:{{ rule.startTime && rule.startTime + ' ~ ' + rule.endTime }}</p> |
|
|
|
|
<p>比赛方式:{{ methods.find(e => e.id == rule.method) && methods.find(e => e.id == rule.method).name }}</p> |
|
|
|
|
<p v-if="rule.method != 2">课程系统:{{ rule.systemName }}</p> |
|
|
|
|
<p v-if="rule.onlineButton && rule.method != 2">线下地点:{{ rule.onlineAddress }}</p> |
|
|
|
|
<p v-if="rule.offlineButton">比赛地点:{{ rule.offlineAddress }}</p> |
|
|
|
|
<p v-if="rule.onlineButton && rule.method != 2">线上地点:{{ rule.onlineAddress }}</p> |
|
|
|
|
<p v-if="rule.offlineButton">线下地点:{{ rule.offlineAddress }}</p> |
|
|
|
|
<template v-if="rule.method === 2"> |
|
|
|
|
<p>比赛地点:{{ rule.offlineAddress }}</p> |
|
|
|
|
<p>比赛内容:{{ rule.contentDescription }}</p> |
|
|
|
@ -624,7 +624,8 @@ |
|
|
|
|
width="600px" |
|
|
|
|
@close="stageClose"> |
|
|
|
|
<template v-if="curStage && curStage.competitionStageContentSetting"> |
|
|
|
|
<div v-if="curStage.competitionStageContentSetting.systemLink"> |
|
|
|
|
<div v-if="curStage.competitionStageContentSetting.systemLink" |
|
|
|
|
class="m-b-20"> |
|
|
|
|
<span class="fs-14">进入比赛:</span> |
|
|
|
|
<el-button type="danger" |
|
|
|
|
style="font-size: 13px" |
|
|
|
@ -768,6 +769,7 @@ export default { |
|
|
|
|
whetherSignUp: 1 |
|
|
|
|
}, |
|
|
|
|
curStage: null, |
|
|
|
|
choosing: false, |
|
|
|
|
originInfo: {}, |
|
|
|
|
info: { |
|
|
|
|
isCaption: 0, |
|
|
|
@ -897,99 +899,99 @@ export default { |
|
|
|
|
let signUpEndTime = new Date(this.core.dateCompatible(form.signUpEndTime)) // 报名结束时间 |
|
|
|
|
let playStartTime = new Date(this.core.dateCompatible(form.playStartTime)) // 比赛开始时间 |
|
|
|
|
let playEndTime = new Date(this.core.dateCompatible(form.playEndTime)) // 比赛结束时间 |
|
|
|
|
// this.timer = setInterval(() => { |
|
|
|
|
const now = new Date() |
|
|
|
|
if (now < signUpStartTime) { // 报名没开始 |
|
|
|
|
status = 0 |
|
|
|
|
total = signUpStartTime - now |
|
|
|
|
} else if (now > signUpStartTime && now < signUpEndTime) { // 报名进行中 |
|
|
|
|
// 1已报名,2立即报名(没登录的情况下,直接显示立即报名,登录了则取报名信息,有则已报名,无则立即报名) |
|
|
|
|
status = this.token ? |
|
|
|
|
(form.competitionRegistration ? |
|
|
|
|
1 : |
|
|
|
|
2) : |
|
|
|
|
2 |
|
|
|
|
total = signUpEndTime - now |
|
|
|
|
} else if (now > signUpEndTime && now < playStartTime) { // 报名结束了,但比赛没开始 |
|
|
|
|
status = 3 |
|
|
|
|
total = playStartTime - now |
|
|
|
|
} else if (now > playStartTime && now < playEndTime) { // 比赛进行中 |
|
|
|
|
// 如果是完整比赛 |
|
|
|
|
if (form.releaseType) { |
|
|
|
|
// 进行中的赛事,则遍历每个阶段的开始结束时间,看阶段比赛是否开始 |
|
|
|
|
let curStage = null |
|
|
|
|
const stages = form.competitionStage |
|
|
|
|
if (stages) { |
|
|
|
|
this.playingStages = [] |
|
|
|
|
form.competitionRegistration && stages.forEach(e => { |
|
|
|
|
if (now >= new Date(e.startTime) && now <= new Date(e.endTime) && (e.method !== 2 || this.offlineCanEntry(e))) this.playingStages.push(e) |
|
|
|
|
}) |
|
|
|
|
let endText = '' |
|
|
|
|
for (const i in stages) { |
|
|
|
|
const e = stages[i] |
|
|
|
|
const startTime = new Date(e.startTime) |
|
|
|
|
const endTime = new Date(e.endTime) |
|
|
|
|
if (now < startTime) { // 阶段比赛未开始,不显示进入比赛按钮 |
|
|
|
|
endText = '阶段开始' |
|
|
|
|
total = startTime - now |
|
|
|
|
break |
|
|
|
|
} else if (now >= startTime && now <= endTime) { // 阶段比赛进行中,显示进入比赛按钮 |
|
|
|
|
// 非线下赛事 |
|
|
|
|
if (e.method !== 2) { |
|
|
|
|
if (form.competitionRegistration) { // 报名了才能进入比赛 |
|
|
|
|
this.statusList[4] = e.count ? '已提交' : '进入' + e.stageName |
|
|
|
|
curStage = e |
|
|
|
|
} else if (!this.token) { |
|
|
|
|
this.timer = setInterval(() => { |
|
|
|
|
const now = new Date() |
|
|
|
|
if (now < signUpStartTime) { // 报名没开始 |
|
|
|
|
status = 0 |
|
|
|
|
total = signUpStartTime - now |
|
|
|
|
} else if (now > signUpStartTime && now < signUpEndTime) { // 报名进行中 |
|
|
|
|
// 1已报名,2立即报名(没登录的情况下,直接显示立即报名,登录了则取报名信息,有则已报名,无则立即报名) |
|
|
|
|
status = this.token ? |
|
|
|
|
(form.competitionRegistration ? |
|
|
|
|
1 : |
|
|
|
|
2) : |
|
|
|
|
2 |
|
|
|
|
total = signUpEndTime - now |
|
|
|
|
} else if (now > signUpEndTime && now < playStartTime) { // 报名结束了,但比赛没开始 |
|
|
|
|
status = 3 |
|
|
|
|
total = playStartTime - now |
|
|
|
|
} else if (now > playStartTime && now < playEndTime) { // 比赛进行中 |
|
|
|
|
// 如果是完整比赛 |
|
|
|
|
if (form.releaseType) { |
|
|
|
|
// 进行中的赛事,则遍历每个阶段的开始结束时间,看阶段比赛是否开始 |
|
|
|
|
let curStage = null |
|
|
|
|
const stages = form.competitionStage |
|
|
|
|
if (stages) { |
|
|
|
|
this.playingStages = [] |
|
|
|
|
form.competitionRegistration && stages.forEach(e => { |
|
|
|
|
if (now >= new Date(e.startTime) && now <= new Date(e.endTime) && (e.method !== 2 || this.offlineCanEntry(e))) this.playingStages.push(e) |
|
|
|
|
}) |
|
|
|
|
let endText = '' |
|
|
|
|
for (const i in stages) { |
|
|
|
|
const e = stages[i] |
|
|
|
|
const startTime = new Date(e.startTime) |
|
|
|
|
const endTime = new Date(e.endTime) |
|
|
|
|
if (now < startTime) { // 阶段比赛未开始,不显示进入比赛按钮 |
|
|
|
|
endText = '阶段开始' |
|
|
|
|
total = startTime - now |
|
|
|
|
break |
|
|
|
|
} else if (now >= startTime && now <= endTime) { // 阶段比赛进行中,显示进入比赛按钮 |
|
|
|
|
// 非线下赛事 |
|
|
|
|
if (e.method !== 2) { |
|
|
|
|
if (form.competitionRegistration) { // 报名了才能进入比赛 |
|
|
|
|
this.statusList[4] = e.count ? '已提交' : '进入' + e.stageName |
|
|
|
|
curStage = e |
|
|
|
|
} else if (!this.token) { |
|
|
|
|
this.statusList[4] = '进入' + e.stageName |
|
|
|
|
curStage = e |
|
|
|
|
} |
|
|
|
|
} else if (this.offlineCanEntry(e)) { // 线下(输入了系统链接或者上传文件选择了是,才需要显示进入按钮) |
|
|
|
|
// 当系统链接为空,且上传文件为否时,无需展示入口 |
|
|
|
|
// 当系统链接不为空,且上传文件为否时,点击入口,直接跳转到链接页面,无需弹窗 |
|
|
|
|
// 当上传文件为是时,点击入口需弹窗,共两种样式 |
|
|
|
|
this.statusList[4] = '进入' + e.stageName |
|
|
|
|
curStage = e |
|
|
|
|
} |
|
|
|
|
} else if (this.offlineCanEntry(e)) { // 线下(输入了系统链接或者上传文件选择了是,才需要显示进入按钮) |
|
|
|
|
// 当系统链接为空,且上传文件为否时,无需展示入口 |
|
|
|
|
// 当系统链接不为空,且上传文件为否时,点击入口,直接跳转到链接页面,无需弹窗 |
|
|
|
|
// 当上传文件为是时,点击入口需弹窗,共两种样式 |
|
|
|
|
this.statusList[4] = '进入' + e.stageName |
|
|
|
|
curStage = e |
|
|
|
|
endText = '阶段结束' |
|
|
|
|
total = endTime - now |
|
|
|
|
break |
|
|
|
|
} else if (stages[i + 1] && now > endTime && now < new Date(stages[i + 1].startTime)) { // 过了该阶段的结束时间,但是没到下个阶段的开始时间,不显示进入比赛按钮 |
|
|
|
|
endText = '阶段开始' |
|
|
|
|
total = new Date(stages[i + 1].startTime) - now |
|
|
|
|
break |
|
|
|
|
} else if (i === stages.length - 1) { // 当前时间在比赛开始结束时间之间,并且是最后一个阶段结束时间之后 |
|
|
|
|
this.$set(form, 'stageName', '') |
|
|
|
|
endText = '竞赛结束' |
|
|
|
|
total = playEndTime - now |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
endText = '阶段结束' |
|
|
|
|
total = endTime - now |
|
|
|
|
break |
|
|
|
|
} else if (stages[i + 1] && now > endTime && now < new Date(stages[i + 1].startTime)) { // 过了该阶段的结束时间,但是没到下个阶段的开始时间,不显示进入比赛按钮 |
|
|
|
|
endText = '阶段开始' |
|
|
|
|
total = new Date(stages[i + 1].startTime) - now |
|
|
|
|
break |
|
|
|
|
} else if (i === stages.length - 1) { // 当前时间在比赛开始结束时间之间,并且是最后一个阶段结束时间之后 |
|
|
|
|
this.$set(form, 'stageName', '') |
|
|
|
|
endText = '竞赛结束' |
|
|
|
|
total = playEndTime - now |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
this.endList[4] = endText |
|
|
|
|
} |
|
|
|
|
this.endList[4] = endText |
|
|
|
|
if (!this.choosing) this.curStage = curStage |
|
|
|
|
} else { // 仅发布信息 |
|
|
|
|
total = playEndTime - now |
|
|
|
|
} |
|
|
|
|
this.curStage = curStage |
|
|
|
|
} else { // 仅发布信息 |
|
|
|
|
total = playEndTime - now |
|
|
|
|
status = 4 |
|
|
|
|
} else if (now > playEndTime) { // 比赛结束 |
|
|
|
|
status = 5 |
|
|
|
|
} |
|
|
|
|
status = 4 |
|
|
|
|
} else if (now > playEndTime) { // 比赛结束 |
|
|
|
|
status = 5 |
|
|
|
|
} |
|
|
|
|
this.status = status |
|
|
|
|
total = total / 1000 |
|
|
|
|
--total |
|
|
|
|
if (total > 86400) { // 超过一天则显示天数 |
|
|
|
|
// clearInterval(this.timer) |
|
|
|
|
this.end = Math.floor(total / 86400) + '天' |
|
|
|
|
} else if (total > 0) { // 一天之内,显示时分秒 |
|
|
|
|
let hours = Math.floor(total / (60 * 60)) |
|
|
|
|
let minutes = Math.floor(total % (60 * 60) / 60) |
|
|
|
|
let seconds = Math.floor(total % (60 * 60) % 60) |
|
|
|
|
time = `${this.core.formateTime(hours)}:${this.core.formateTime(minutes)}:${this.core.formateTime(seconds)}` |
|
|
|
|
if (total > 0) this.end = time |
|
|
|
|
} else if (this.status === 5) { // 竞赛结束,清除定时器 |
|
|
|
|
clearInterval(this.timer) |
|
|
|
|
} |
|
|
|
|
// }, 1000) |
|
|
|
|
this.status = status |
|
|
|
|
total = total / 1000 |
|
|
|
|
--total |
|
|
|
|
if (total > 86400) { // 超过一天则显示天数 |
|
|
|
|
// clearInterval(this.timer) |
|
|
|
|
this.end = Math.floor(total / 86400) + '天' |
|
|
|
|
} else if (total > 0) { // 一天之内,显示时分秒 |
|
|
|
|
let hours = Math.floor(total / (60 * 60)) |
|
|
|
|
let minutes = Math.floor(total % (60 * 60) / 60) |
|
|
|
|
let seconds = Math.floor(total % (60 * 60) % 60) |
|
|
|
|
time = `${this.core.formateTime(hours)}:${this.core.formateTime(minutes)}:${this.core.formateTime(seconds)}` |
|
|
|
|
if (total > 0) this.end = time |
|
|
|
|
} else if (this.status === 5) { // 竞赛结束,清除定时器 |
|
|
|
|
clearInterval(this.timer) |
|
|
|
|
} |
|
|
|
|
}, 1000) |
|
|
|
|
}, |
|
|
|
|
// 该阶段是否符合线下能进入比赛的条件 |
|
|
|
|
offlineCanEntry (stage) { |
|
|
|
@ -1468,7 +1470,7 @@ export default { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.uploading = false |
|
|
|
|
const url = 'http://huoran.oss-cn-shenzhen.aliyuncs.com/' + name |
|
|
|
|
const url = 'https://huoran.oss-cn-shenzhen.aliyuncs.com/' + name |
|
|
|
|
this.fileList = [{ |
|
|
|
|
name: name, |
|
|
|
|
url |
|
|
|
@ -1517,12 +1519,14 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 阶段弹框关闭回调 |
|
|
|
|
stageClose () { |
|
|
|
|
this.choosing = false |
|
|
|
|
this.fileList = [] |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 选择要进入的阶段 |
|
|
|
|
chooseStage (e) { |
|
|
|
|
this.choosing = true |
|
|
|
|
this.curStage = e |
|
|
|
|
this.signup() |
|
|
|
|
}, |
|
|
|
@ -1650,6 +1654,7 @@ export default { |
|
|
|
|
util.cookies.set('curriculumName', encodeURIComponent(form.systemName)) |
|
|
|
|
util.cookies.set('systemId', form.systemId) |
|
|
|
|
util.cookies.set('isSubmit', '', -1) |
|
|
|
|
util.cookies.set('className', '', -1) |
|
|
|
|
util.cookies.set('competitionId', this.form.id) |
|
|
|
|
util.cookies.set('stageId', form.stageId) |
|
|
|
|
util.cookies.set('teamId', this.form.competitionRegistration.teamId) |
|
|
|
|