diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue index ce9e7b1..208235f 100644 --- a/src/pages/account/login/index.vue +++ b/src/pages/account/login/index.vue @@ -587,11 +587,13 @@ export default { this.queryClient(data.token) } } else { + form.code = '' util.errorMsg(message) } }).catch(res => { - this.getVerImg() form.code = '' + console.log("🚀 ~ file: index.vue:594 ~ this.$post ~ form:", form) + this.getVerImg() }) } }); diff --git a/src/pages/match/details/index.vue b/src/pages/match/details/index.vue index 67ccd99..a5d4630 100644 --- a/src/pages/match/details/index.vue +++ b/src/pages/match/details/index.vue @@ -94,7 +94,7 @@ <p>团队参赛人数限制:{{ rule.teamNumLimit || '不限制' }}</p> <p>团队成绩计算方式:{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p> </template> - <p>阶段比赛结束后{{ rule.resultAnnouncementTime }}小时,公布阶段比赛成绩。</p> + <p v-if="rule.resultAnnouncementTime != 0">阶段比赛结束后{{ rule.resultAnnouncementTime }}小时,公布阶段比赛成绩。</p> <div v-if="form.rule === 1" class="flex"> <p>晋级规则:</p> @@ -367,13 +367,14 @@ @click="selectPar(item)"></i> </td> </template> + <!-- 积分赛才需要显示总分这个字段,直接第一行合并表格(填了成绩公布时间才显示分数,不然为空) --> <td v-if="form.rule === 0 && !i" - :rowspan="info.stages.length">{{ info.totalScore || 0 }}</td> + :rowspan="info.stages.length">{{ item.resultAnnouncementTime ? info.totalScore || 0 : '' }}</td> <td> - <span v-if="item.score >= 0" + <span v-if="item.score >= 0 && item.resultAnnouncementTime" class="m-r-10">分数{{item.score}}</span> - <el-button type="text" - :disabled="item.showDetail && item.resultsDetails === 1 || (form.completeCompetitionSetup.competitionType && !item.reportId) || (form.completeCompetitionSetup.competitionType === 0 && !item.reportId)" + <el-button v-if="item.showDetail && item.resultAnnouncementTime && item.resultsDetails === 0 && item.reportId" + type="text" @click="show(item)">查看成绩详情</el-button> </td> </tr> @@ -839,7 +840,7 @@ export default { if (stages) { this.playingStages = [] form.competitionRegistration && stages.forEach(e => { - if (now >= new Date(e.startTime) && now <= new Date(e.endTime) && e.method !== 2) this.playingStages.push(e) + if (now >= new Date(e.startTime) && now <= new Date(e.endTime) && (e.method !== 2 || this.isLink(e))) this.playingStages.push(e) }) let endText = '' for (const i in stages) { @@ -850,11 +851,16 @@ export default { 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) { + } else if (now >= startTime && now <= endTime && (e.method !== 2 || this.isLink(e))) { // 阶段比赛进行中,显示进入比赛按钮 + 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 { this.statusList[4] = '进入' + e.stageName curStage = e } @@ -899,6 +905,10 @@ export default { } }, 1000) }, + isLink (stage) { + console.log("🚀 ~ file: index.vue:904 ~ isLink ~ stage:", stage) + return stage.method === 2 && /[a-zA-Z\d]+\.[a-zA-Z]+/.test(stage.offlineAddress) + }, // 获取竞赛信息 getInfo () { this.$post(`${this.api.entryInformation}?competitionId=${this.id}`).then(res => { @@ -935,8 +945,6 @@ export default { this.form.competitionStage && this.form.competitionStage.map(e => { // 如果公布成绩详情勾选的是 if (!e.resultsDetails) { - console.log(44, endTime - now < 86400000) - const endTime = new Date(e.endTime).getTime() + e.resultAnnouncementTime * 3600000 // 阶段结束时间+成绩公布时间(成绩公布时间单位是小时,所以要转化为毫秒) if (now > endTime) { // 如果到了公布时间 info.stages.find(n => n.stageId == e.stageId).showDetail = 1 @@ -946,8 +954,6 @@ export default { } }) this.info = info - console.log("🚀 ~ file: index.vue:752 ~ this.$post ~ info", info) - }).catch(err => { }); }, // 编辑保存 @@ -1370,20 +1376,25 @@ export default { if (util.local.get(Setting.tokenKey)) { const { competitionType } = form.completeCompetitionSetup if (status == 4) { // 进入比赛 - // 参加过比赛不让参加 - if (this.curStage && this.curStage.count) return util.errorMsg('您已经参加过该阶段竞赛!') - if (form.competitionRegistration.isDisable === 1) return util.errorMsg('当前用户已被禁赛,如有疑问,请联系平台管理员。') // 被禁用的用户不能进入大赛 - // 团队赛,则判断是否为参赛人员 - if (competitionType) { - this.$post(this.api.isParticipant, { - competitionId: this.id, - stageId: this.curStage.stageId, - teamId: form.competitionRegistration.teamId, - }).then(res => { - this.getAllow() - }).catch(res => { }) + // 线下 + if (this.curStage.method == 2) { + window.open(this.curStage.offlineAddress) } else { - this.getAllow() + // 参加过比赛不让参加 + if (this.curStage && this.curStage.count) return util.errorMsg('您已经参加过该阶段竞赛!') + if (form.competitionRegistration.isDisable === 1) return util.errorMsg('当前用户已被禁赛,如有疑问,请联系平台管理员。') // 被禁用的用户不能进入大赛 + // 团队赛,则判断是否为参赛人员 + if (competitionType) { + this.$post(this.api.isParticipant, { + competitionId: this.id, + stageId: this.curStage.stageId, + teamId: form.competitionRegistration.teamId, + }).then(res => { + this.getAllow() + }).catch(res => { }) + } else { + this.getAllow() + } } } else if (status == 2) { // 报名 // 团队赛报名 @@ -1422,6 +1433,10 @@ export default { }).catch(() => { }) } }, + // 线下比赛方式点击进入跳转<比赛地点> + toOffline () { + window.open(this.curStage.offlineAddress) + }, // 进入python系统 toPython () { const form = this.curStage diff --git a/src/pages/match/list/index.vue b/src/pages/match/list/index.vue index c26be62..7b239d1 100644 --- a/src/pages/match/list/index.vue +++ b/src/pages/match/list/index.vue @@ -494,7 +494,7 @@ export default { item.playingStages = [] // 报了名才算作可以进入的阶段 item.whetherToSignUp === 0 && stages.forEach(e => { - if (now >= new Date(e.startTime) && now <= new Date(e.endTime) && e.method !== 2) item.playingStages.push(e) + if (now >= new Date(e.startTime) && now <= new Date(e.endTime) && (e.method !== 2 || this.isLink(e))) item.playingStages.push(e) }) for (const i in stages) { const e = stages[i] @@ -506,7 +506,7 @@ export default { 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) // 报名了并且没参加比赛才能进入比赛 + if (item.whetherToSignUp === 0 && (e.method !== 2 || this.isLink(e))) this.$set(item, 'stageName', (!this.isLink(e) && e.count) ? '已提交' : '进入' + e.stageName) // 报名了并且没参加比赛才能进入比赛 this.$set(item, 'endText', '阶段结束') curStage = e total = endTime - now @@ -553,6 +553,9 @@ export default { } }) }, + isLink (stage) { + return stage.method === 2 && /[a-zA-Z\d]+\.[a-zA-Z]+/.test(stage.offlineAddress) + }, // 清除定时器 clearTimer () { this.timerList.forEach(n => { @@ -706,20 +709,25 @@ export default { if (util.local.get(Setting.tokenKey)) { this.curItem = item if (status == 4) { // 进入比赛 - // 参加过比赛不让参加 - if (item.curStage.count) return util.errorMsg('您已经参加过该阶段竞赛!') - if (item.isDisable === 1) return util.errorMsg('当前用户已被禁赛,如有疑问,请联系平台管理员。') // 被禁用的用户不能进入大赛 - // 团队赛,则判断是否为参赛人员 - if (competitionType) { - this.$post(this.api.isParticipant, { - competitionId: id, - stageId: item.curStage.stageId, - teamId: item.teamId, - }).then(res => { - this.getAllow(item) - }).catch(res => { }) + // 线下 + if (item.curStage.method == 2) { + window.open(item.curStage.offlineAddress) } else { - this.getAllow(item) + // 参加过比赛不让参加 + if (item.curStage.count) return util.errorMsg('您已经参加过该阶段竞赛!') + if (item.isDisable === 1) return util.errorMsg('当前用户已被禁赛,如有疑问,请联系平台管理员。') // 被禁用的用户不能进入大赛 + // 团队赛,则判断是否为参赛人员 + if (competitionType) { + this.$post(this.api.isParticipant, { + competitionId: id, + stageId: item.curStage.stageId, + teamId: item.teamId, + }).then(res => { + this.getAllow(item) + }).catch(res => { }) + } else { + this.getAllow(item) + } } } else if (status == 2) { // 报名 // 团队赛报名 diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue index 2c06cff..8d0f2d1 100644 --- a/src/pages/station/preview/index.vue +++ b/src/pages/station/preview/index.vue @@ -605,7 +605,7 @@ export default { }, // 获取最高分列表 async getMaximumScore () { - let { message } = await this.$post(`${this.api.maximumPracticeScoreList}?projectId=${this.archProject}&pageNum=1&pageSize=1000`); + let { message } = await this.$post(`${this.api.maximumPracticeScoreList}?projectId=${this.archProject}&pageNum=1&pageSize=1000&mallId=${this.mallId}&cid=${this.courseId}`); const list = message.records list.forEach(e => { if (!e.userAvatars) e.userAvatars = 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'