yujialong 2 years ago
parent 7e2ae10bf7
commit c6066fc6e4
  1. 9
      src/pages/account/login/index.vue
  2. 110
      src/pages/match/details/index.vue
  3. 172
      src/pages/match/list/index.vue
  4. 2
      src/pages/station/preview/index.vue
  5. 183
      src/pages/touristMatch/list/index.vue

@ -330,6 +330,9 @@ export default {
...mapActions("user", [
"setInfo"
]),
...mapMutations('match', [
'SET_SOURCE'
]),
// id
setSchool(list) {
this.schoolList = list
@ -417,10 +420,12 @@ export default {
util.cookies.remove('serverLogin')
this.reloadIndex()
util.successMsg('登录成功')
const { toMatch } = this
this.SET_SOURCE('')
this.$router.replace(this.courseId ?
`/preCourse/details?id=${this.courseId}` :
this.toMatch ?
`/touristMatch` :
toMatch ?
`/touristMatch/details?id=` + toMatch :
'/station')
},
//

@ -14,7 +14,15 @@
距离{{ endList[status] }}还有
<em>{{ end }}</em>
</p>
<a v-if="status != 4 || (status == 4 && curStage)" class="status" :class="{wait: status == 0,signing: status == 2,signed: status == 1,playing: status == 4,finish: status == 3 || status == 5}" :title="statusList[status]" @click.stop="signup">{{ statusList[status] }}</a>
<el-dropdown v-if="playingStages.length > 1" class="m-l-10" @command="chooseStage">
<el-button type="primary" style="background-color: #f96d6d;border: 0;">
选择竞赛<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(item, i) in playingStages" :key="i" :command="item">进入{{ item.stageName }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<a v-else-if="status != 4 || (status == 4 && curStage)" class="status" :class="{wait: status == 0,signing: status == 2,signed: status == 1,playing: status == 4,finish: status == 3 || status == 5}" :title="statusList[status]" @click.stop="signup">{{ statusList[status] }}</a>
</div>
</div>
<div class="info">
@ -246,7 +254,7 @@
<el-tag
v-for="tag in item.participants"
:key="tag.name"
class="m-r-5"
class="m-r-5 m-b-5"
:closable="info.team.captain === 0"
@close="removePar(tag, item)">
{{tag.name}}
@ -415,7 +423,7 @@ export default {
id: +this.$route.query.id,
end: '',
status: '',
statusList: ["等待报名", "取消报名", "立即报名", "报名截止", "进入赛", "已结束"],
statusList: ["等待报名", "取消报名", "立即报名", "报名截止", "进入赛", "已结束"],
endList: ["报名开始", "报名截止", "报名截止", "竞赛开始", "竞赛结束", ""],
rules: Const.rules,
methods: Const.methods,
@ -508,7 +516,8 @@ export default {
checkedMember: '',
checkedMembers: [],
chooses: [],
lastType: 1
lastType: 1,
playingStages: []
};
},
computed: {
@ -572,7 +581,7 @@ export default {
})
this.getInfo()
}
this.token() && this.getRank()
this.token && this.getRank()
} else {
this.typeList = this.typeList.slice(0, 3)
}
@ -596,48 +605,64 @@ export default {
status = 0
total = signUpStartTime - now
} else if (now > signUpStartTime && now < signUpEndTime) { //
status = form.competitionRegistration ? 1 : 2 // 12
// 12()
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) { //
//
let curStage = null
const stages = form.competitionStage
if (stages) {
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 && e.method !== 2) { //
if (form.competitionRegistration) { //
this.statusList[4] = e.count ? '已提交' : '进入' + e.stageName
curStage = e
//
if (form.releaseType) {
//
let curStage = null
const stages = form.competitionStage
if (stages) {
this.playingStages = []
stages.forEach(e => {
if (now >= new Date(e.startTime) && now <= new Date(e.endTime) && e.method !== 2) 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 && 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
}
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
this.curStage = curStage
} else { //
total = playEndTime - now
}
this.curStage = curStage
status = 4
} else if (now > playEndTime) { //
status = 5
@ -646,7 +671,7 @@ export default {
total = total / 1000
--total
if (total > 86400) { //
clearInterval(this.timer)
// clearInterval(this.timer)
this.end = Math.floor(total / 86400) + '天'
} else if (total > 0) { //
let hours = Math.floor(total / (60 * 60))
@ -1074,6 +1099,11 @@ export default {
}
},
//
chooseStage(e) {
this.curStage = e
this.signup()
},
//
getAllow() {
//
@ -1097,7 +1127,7 @@ export default {
if (util.local.get(Setting.tokenKey)) {
const { competitionType } = form.completeCompetitionSetup
if (status == 4) { //
if (this.curStage.count) return //
if (this.curStage && this.curStage.count) return //
if (form.competitionRegistration.isDisable === 1) return util.errorMsg('当前用户已被禁赛,如有疑问,请联系平台管理员。') //
//
if (competitionType) {

@ -100,8 +100,16 @@
</div>
</div>
<div class="right">
<el-dropdown v-if="item.playingStages && item.playingStages.length > 1" class="m-l-10" @command="e => chooseStage(e, item)">
<el-button type="primary" style="background-color: #f96d6d;border: 0;">
选择竞赛<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(stage, i) in item.playingStages" :key="i" :command="stage">进入{{ stage.stageName }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<p class="status"
v-if="item.status != 4 || (item.status == 4 && item.curStage)"
v-else-if="item.status != 4 || (item.status == 4 && item.curStage)"
:class="{wait: item.status == 0,signing: item.status == 2,signed: item.status == 1,playing: item.status == 4 && item.curStage,finish: item.status == 3 || item.status == 5}" :title="item.status == 4 ? item.stageName : statusList[item.status]"
@click.stop="signup(item)">{{ item.status == 4 ? item.stageName : statusList[item.status] }}</p>
<p class="end-text" v-if="item.end">
@ -316,6 +324,7 @@ export default {
'SET_TYPE'
]),
getList() {
this.clearTimer()
const { form } = this
const { eventType, competitionScope } = form
const data = {
@ -357,82 +366,93 @@ export default {
//
handleStatus() {
this.listData.map(item => {
let total = ''
let time = ''
let status = ''
let signUpStartTime = new Date(this.core.dateCompatible(item.signUpStartTime)) //
let signUpEndTime = new Date(this.core.dateCompatible(item.signUpEndTime)) //
let playStartTime = new Date(this.core.dateCompatible(item.playStartTime)) //
let playEndTime = new Date(this.core.dateCompatible(item.playEndTime)) //
let timer = setInterval(() => {
const now = new Date()
if (now < signUpStartTime) { //
status = 0
total = signUpStartTime - now
} else if (now > signUpStartTime && now < signUpEndTime) { //
// whetherToSignUp 01
status = item.whetherToSignUp ? 2 : 1 // 12
total = signUpEndTime - now
} else if (now > signUpEndTime && now < playStartTime) { // ,
status = 3
total = playStartTime - now
} else if (now > playStartTime && now < playEndTime) { //
//
let curStage = null
const stages = item.competitionStageList
if (stages) {
for (const i in stages) {
const e = stages[i]
const startTime = new Date(e.startTime)
const endTime = new Date(e.endTime)
if (now < startTime) { //
this.$set(item, 'stageName', '')
this.$set(item, 'endText', '阶段开始')
total = startTime - now
break
} else if (now >= startTime && now <= endTime) { //
if (item.whetherToSignUp === 0 && e.method !== 2) this.$set(item, 'stageName', e.count ? '已提交' : '进入' + e.stageName) //
this.$set(item, 'endText', '阶段结束')
curStage = e
total = endTime - now
break
} else if (stages[i + 1] && now > endTime && now < new Date(stages[i + 1].startTime)) { //
this.$set(item, 'stageName', '')
this.$set(item, 'endText', '阶段开始')
total = new Date(stages[i + 1].startTime) - now
break
} else if (i === stages.length - 1) { //
this.$set(item, 'stageName', '')
this.$set(item, 'endText', '竞赛结束')
total = playEndTime - now
break
if (item.signUpStartTime && item.signUpEndTime && item.playStartTime && item.playEndTime) {
let total = ''
let time = ''
let status = ''
let signUpStartTime = new Date(this.core.dateCompatible(item.signUpStartTime)) //
let signUpEndTime = new Date(this.core.dateCompatible(item.signUpEndTime)) //
let playStartTime = new Date(this.core.dateCompatible(item.playStartTime)) //
let playEndTime = new Date(this.core.dateCompatible(item.playEndTime)) //
let timer = setInterval(() => {
const now = new Date()
if (now < signUpStartTime) { //
status = 0
total = signUpStartTime - now
} else if (now > signUpStartTime && now < signUpEndTime) { //
// whetherToSignUp 01
status = item.whetherToSignUp ? 2 : 1 // 12
total = signUpEndTime - now
} else if (now > signUpEndTime && now < playStartTime) { // ,
status = 3
total = playStartTime - now
} else if (now > playStartTime && now < playEndTime) { //
//
if (item.releaseType) {
//
let curStage = null
const stages = item.competitionStageList
if (stages) {
item.playingStages = []
stages.forEach(e => {
if (now >= new Date(e.startTime) && now <= new Date(e.endTime) && e.method !== 2) item.playingStages.push(e)
})
for (const i in stages) {
const e = stages[i]
const startTime = new Date(e.startTime)
const endTime = new Date(e.endTime)
if (now < startTime) { //
this.$set(item, 'stageName', '')
this.$set(item, 'endText', '阶段开始')
total = startTime - now
break
} else if (now >= startTime && now <= endTime) { //
if (item.whetherToSignUp === 0 && e.method !== 2) this.$set(item, 'stageName', e.count ? '已提交' : '进入' + e.stageName) //
this.$set(item, 'endText', '阶段结束')
curStage = e
total = endTime - now
break
} else if (stages[i + 1] && now > endTime && now < new Date(stages[i + 1].startTime)) { //
this.$set(item, 'stageName', '')
this.$set(item, 'endText', '阶段开始')
total = new Date(stages[i + 1].startTime) - now
break
} else if (i === stages.length - 1) { //
this.$set(item, 'stageName', '')
this.$set(item, 'endText', '竞赛结束')
total = playEndTime - now
break
}
}
}
item.curStage = curStage
} else { //
this.$set(item, 'endText', '竞赛结束')
total = playEndTime - now
}
status = 4
} else if (now > playEndTime) { //
status = 5
}
item.curStage = curStage
status = 4
} else if (now > playEndTime) { //
status = 5
}
this.$set(item, 'status', status)
total = total / 1000
--total
if (total > 86400) { //
clearInterval(timer)
this.$set(item, '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.$set(item, 'end', time)
} else if (item.status === 5) { //
clearInterval(timer)
}
}, 1000)
this.timerList.push(timer)
this.$set(item, 'status', status)
total = total / 1000
--total
if (total > 86400) { //
// clearInterval(timer)
this.$set(item, '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.$set(item, 'end', time)
} else if (item.status === 5) { //
clearInterval(timer)
}
}, 1000)
this.timerList.push(timer)
}
})
console.log("🚀 ~ file: index.vue:434 ~ handleStatus ~ timerList", this.listData)
},
//
clearTimer() {
@ -492,7 +512,6 @@ export default {
this.$router.push(`/match/details?id=${item.id}`);
},
handleCurrentChange(val) {
this.clearTimer()
this.page = val;
this.getData();
},
@ -546,6 +565,11 @@ export default {
util.successMsg('报名成功!')
}).catch(res => {})
},
//
chooseStage(e, item) {
item.curStage = e
this.signup(item)
},
//
getAllow(item) {
//

@ -90,7 +90,7 @@
<ul class="projects">
<li v-for="(item, i) in projects" :key="i" :class="{active: curProject == item.projectId}" @click="selectProject(item)">
<img src="@/assets/img/project.png" alt="">
<span>{{ item.projectName }}</span>
<span>{{ i + 1 }}. {{ item.projectName }}</span>
</li>
</ul>

@ -83,8 +83,16 @@
</div>
</div>
<div class="right">
<el-dropdown v-if="item.playingStages && item.playingStages.length > 1" class="m-l-10" @command="e => chooseStage(e, item)">
<el-button type="primary" style="background-color: #f96d6d;border: 0;">
选择竞赛<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(stage, i) in item.playingStages" :key="i" :command="stage">进入{{ stage.stageName }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<p class="status"
v-if="item.status != 4 || (item.status == 4 && item.curStage)"
v-else-if="item.status != 4 || (item.status == 4 && item.curStage)"
:class="{wait: item.status == 0,signing: item.status == 2,signed: item.status == 1,playing: item.status == 4 && item.curStage,finish: item.status == 3 || item.status == 5}" :title="item.status == 4 ? item.stageName : statusList[item.status]"
@click.stop="signup(item)">{{ item.status == 4 ? item.stageName : statusList[item.status] }}</p>
<p class="end-text" v-if="item.end">
@ -279,6 +287,7 @@ export default {
'SET_SOURCE'
]),
getList() {
this.clearTimer()
const { form } = this
const scope = form.competitionScope
const data = {
@ -312,16 +321,6 @@ export default {
this.listData = records
this.totals = data.total
this.handleStatus()
// toMatchidscrollIntoView
const id = this.toMatch
if (id) {
this.$nextTick(() => {
this.SET_SOURCE('')
const item = records.find(e => e.id === id)
item && this.toDetail(item)
})
}
this.loadIns.close()
}).catch(res => {
this.loadIns.close()
@ -330,82 +329,92 @@ export default {
//
handleStatus() {
this.listData.map(item => {
let total = ''
let time = ''
let status = ''
let signUpStartTime = new Date(this.core.dateCompatible(item.signUpStartTime)) //
let signUpEndTime = new Date(this.core.dateCompatible(item.signUpEndTime)) //
let playStartTime = new Date(this.core.dateCompatible(item.playStartTime)) //
let playEndTime = new Date(this.core.dateCompatible(item.playEndTime)) //
let timer = setInterval(() => {
const now = new Date()
if (now < signUpStartTime) { //
status = 0
total = signUpStartTime - now
} else if (now > signUpStartTime && now < signUpEndTime) { //
// whetherToSignUp 01
status = item.whetherToSignUp === 0 ? 1 : 2 // 12
total = signUpEndTime - now
} else if (now > signUpEndTime && now < playStartTime) { // ,
status = 3
total = playStartTime - now
} else if (now > playStartTime && now < playEndTime) { //
//
let curStage = null
const stages = item.competitionStageList
if (stages) {
for (const i in stages) {
const e = stages[i]
const startTime = new Date(e.startTime)
const endTime = new Date(e.endTime)
if (now < startTime) { //
this.$set(item, 'stageName', '')
this.$set(item, 'endText', '阶段开始')
total = startTime - now
break
} else if (now >= startTime && now <= endTime) { //
if ((item.whetherToSignUp === 0 || !util.local.get(Setting.tokenKey)) && e.method !== 2) this.$set(item, 'stageName', e.count ? '已提交' : '进入' + e.stageName) //
this.$set(item, 'endText', '阶段结束')
curStage = e
total = endTime - now
break
} else if (stages[i + 1] && now > endTime && now < new Date(stages[i + 1].startTime)) { //
this.$set(item, 'stageName', '')
this.$set(item, 'endText', '阶段开始')
total = new Date(stages[i + 1].startTime) - now
break
} else if (i === stages.length - 1) { //
this.$set(item, 'stageName', '')
this.$set(item, 'endText', '竞赛结束')
total = playEndTime - now
break
if (item.signUpStartTime && item.signUpEndTime && item.playStartTime && item.playEndTime) {
let total = ''
let time = ''
let status = ''
let signUpStartTime = new Date(this.core.dateCompatible(item.signUpStartTime)) //
let signUpEndTime = new Date(this.core.dateCompatible(item.signUpEndTime)) //
let playStartTime = new Date(this.core.dateCompatible(item.playStartTime)) //
let playEndTime = new Date(this.core.dateCompatible(item.playEndTime)) //
let timer = setInterval(() => {
const now = new Date()
if (now < signUpStartTime) { //
status = 0
total = signUpStartTime - now
} else if (now > signUpStartTime && now < signUpEndTime) { //
// whetherToSignUp 01
status = item.whetherToSignUp === 0 ? 1 : 2 // 12
total = signUpEndTime - now
} else if (now > signUpEndTime && now < playStartTime) { // ,
status = 3
total = playStartTime - now
} else if (now > playStartTime && now < playEndTime) { //
//
if (item.releaseType) {
//
let curStage = null
const stages = item.competitionStageList
if (stages) {
item.playingStages = []
stages.forEach(e => {
if (now >= new Date(e.startTime) && now <= new Date(e.endTime) && e.method !== 2) item.playingStages.push(e)
})
for (const i in stages) {
const e = stages[i]
const startTime = new Date(e.startTime)
const endTime = new Date(e.endTime)
if (now < startTime) { //
this.$set(item, 'stageName', '')
this.$set(item, 'endText', '阶段开始')
total = startTime - now
break
} else if (now >= startTime && now <= endTime) { //
if ((item.whetherToSignUp === 0 || !util.local.get(Setting.tokenKey)) && e.method !== 2) this.$set(item, 'stageName', e.count ? '已提交' : '进入' + e.stageName) //
this.$set(item, 'endText', '阶段结束')
curStage = e
total = endTime - now
break
} else if (stages[i + 1] && now > endTime && now < new Date(stages[i + 1].startTime)) { //
this.$set(item, 'stageName', '')
this.$set(item, 'endText', '阶段开始')
total = new Date(stages[i + 1].startTime) - now
break
} else if (i === stages.length - 1) { //
this.$set(item, 'stageName', '')
this.$set(item, 'endText', '竞赛结束')
total = playEndTime - now
break
}
}
}
item.curStage = curStage
} else { //
this.$set(item, 'endText', '竞赛结束')
total = playEndTime - now
}
status = 4
} else if (now > playEndTime) { //
status = 5
}
item.curStage = curStage
status = 4
} else if (now > playEndTime) { //
status = 5
}
this.$set(item, 'status', status)
total = total / 1000
--total
if (total > 86400) { //
clearInterval(timer)
this.$set(item, '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.$set(item, 'end', time)
} else if (item.status === 5) { //
clearInterval(timer)
}
console.log(33, this.listData)
}, 1000)
this.timerList.push(timer)
this.$set(item, 'status', status)
total = total / 1000
--total
if (total > 86400) { //
// clearInterval(timer)
this.$set(item, '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.$set(item, 'end', time)
} else if (item.status === 5) { //
clearInterval(timer)
}
}, 1000)
this.timerList.push(timer)
}
})
},
//
@ -456,7 +465,6 @@ export default {
this.$router.push(`/touristMatch/details?id=${item.id}`);
},
handleCurrentChange(val) {
this.clearTimer()
this.page = val;
this.getData();
},
@ -509,6 +517,11 @@ export default {
util.successMsg('报名成功!')
}).catch(res => {})
},
//
chooseStage(e, item) {
item.curStage = e
this.signup(item)
},
//
getAllow(item) {
//

Loading…
Cancel
Save