|
|
@ -138,11 +138,12 @@ export default { |
|
|
|
let minute = second * 60 |
|
|
|
let minute = second * 60 |
|
|
|
let hour = minute * 60 |
|
|
|
let hour = minute * 60 |
|
|
|
let now = new Date().getTime() |
|
|
|
let now = new Date().getTime() |
|
|
|
let signUpStartTime = new Date(that.core.dateCompatible(item.signUpStartTime)).getTime() |
|
|
|
let signUpStartTime = new Date(that.core.dateCompatible(item.signUpStartTime)).getTime() // 报名开始时间 |
|
|
|
let signUpEndTime = new Date(that.core.dateCompatible(item.signUpEndTime)).getTime() |
|
|
|
let signUpEndTime = new Date(that.core.dateCompatible(item.signUpEndTime)).getTime() // 报名结束时间 |
|
|
|
let playStartTime = new Date(that.core.dateCompatible(item.playStartTime)).getTime() |
|
|
|
let playStartTime = new Date(that.core.dateCompatible(item.playStartTime)).getTime() // 比赛开始时间 |
|
|
|
let playEndTime = new Date(that.core.dateCompatible(item.playEndTime)).getTime() |
|
|
|
let playEndTime = new Date(that.core.dateCompatible(item.playEndTime)).getTime() // 比赛结束时间 |
|
|
|
switch(item.status){ |
|
|
|
switch(item.status){ |
|
|
|
|
|
|
|
// status每个值的解释请看getData方法 |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
|
if(now > signUpStartTime){ |
|
|
|
if(now > signUpStartTime){ |
|
|
|
item.status = 1 |
|
|
|
item.status = 1 |
|
|
@ -233,29 +234,30 @@ export default { |
|
|
|
let covers = [] |
|
|
|
let covers = [] |
|
|
|
this.listData.forEach((n,k) => { |
|
|
|
this.listData.forEach((n,k) => { |
|
|
|
let now = new Date().getTime() |
|
|
|
let now = new Date().getTime() |
|
|
|
let signUpStartTime = new Date(this.core.dateCompatible(n.signUpStartTime)).getTime() |
|
|
|
let signUpStartTime = new Date(this.core.dateCompatible(n.signUpStartTime)).getTime() // 报名开始时间 |
|
|
|
let signUpEndTime = new Date(this.core.dateCompatible(n.signUpEndTime)).getTime() |
|
|
|
let signUpEndTime = new Date(this.core.dateCompatible(n.signUpEndTime)).getTime() // 报名结束时间 |
|
|
|
let playStartTime = new Date(this.core.dateCompatible(n.playStartTime)).getTime() |
|
|
|
let playStartTime = new Date(this.core.dateCompatible(n.playStartTime)).getTime() // 比赛开始时间 |
|
|
|
let playEndTime = new Date(this.core.dateCompatible(n.playEndTime)).getTime() |
|
|
|
let playEndTime = new Date(this.core.dateCompatible(n.playEndTime)).getTime() // 比赛结束时间 |
|
|
|
|
|
|
|
|
|
|
|
if(now < signUpStartTime){ |
|
|
|
if(now < signUpStartTime){ // 报名没开始 |
|
|
|
n.status = 0 |
|
|
|
n.status = 0 |
|
|
|
n.end = Math.floor((signUpStartTime - now) / time) |
|
|
|
n.end = Math.floor((signUpStartTime - now) / time) |
|
|
|
}else if(now > signUpStartTime && now < signUpEndTime){ |
|
|
|
}else if(now > signUpStartTime && now < signUpEndTime){ // 报名进行中 |
|
|
|
n.status = 1 |
|
|
|
n.status = 1 |
|
|
|
n.end = Math.floor((signUpEndTime - now) / time) |
|
|
|
n.end = Math.floor((signUpEndTime - now) / time) |
|
|
|
}else if(now > signUpEndTime && now < playStartTime){ |
|
|
|
}else if(now > signUpEndTime && now < playStartTime){ // 报名结束了,但比赛没开始 |
|
|
|
n.status = 3 |
|
|
|
n.status = 3 |
|
|
|
n.end = Math.floor((playStartTime - now) / time) |
|
|
|
n.end = Math.floor((playStartTime - now) / time) |
|
|
|
}else if(now > playStartTime && now < playEndTime){ |
|
|
|
}else if(now > playStartTime && now < playEndTime){ // 比赛进行中 |
|
|
|
n.status = 4 |
|
|
|
n.status = 4 |
|
|
|
n.end = Math.floor((playEndTime - now) / time) |
|
|
|
n.end = Math.floor((playEndTime - now) / time) |
|
|
|
}else if(now > playEndTime){ |
|
|
|
}else if(now > playEndTime){ // 比赛结束 |
|
|
|
n.status = 5 |
|
|
|
n.status = 5 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 判断该用户已报名的比赛id集合中有没有该比赛id |
|
|
|
let isInclude = contestIds.includes(n.id) |
|
|
|
let isInclude = contestIds.includes(n.id) |
|
|
|
if(n.status == 1 && !isInclude){ |
|
|
|
if(n.status == 1 && !isInclude){ // 如果报名在进行中,而且该用户没报名,则显示报名按钮,必须status为2,并且signup为true才能报名,下面报名的方法中有做判断 |
|
|
|
n.status = 2 |
|
|
|
n.status = 2 |
|
|
|
n.signup = true |
|
|
|
n.signup = true |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|