This commit is contained in:
zhaoxinyu
2024-11-13 09:02:04 +08:00
parent f6176e4997
commit 067e533a3c
7 changed files with 277 additions and 38 deletions
@@ -250,7 +250,7 @@ layout("/mobile/platform.html"){
<van-button type="info" block @click="submit()">提交</van-button>
</div>
<div class="page-control" style="grid-template-columns: auto"
v-if="canAnswerAgain && finishAnswer && moment().format('YYYY-MM-DD') === vue.currentDate">
v-if="canAnswerAgain && finishAnswer && moment().format('YYYY-MM-DD') === currentDate">
<van-button type="info" block @click="answerAgain">
再答一次
</van-button>
@@ -572,14 +572,19 @@ layout("/mobile/platform.html"){
},
answerAgain() {
this.finishAnswer = false
setTimeout(() => {
this.questionData.issues.forEach(issue => {
issue.wors.forEach(wor => {
this.$refs['checkboxes' + wor.wid][0].toggle(false)
if(this.questionData.ctMode===3){
location.reload()
}else{
this.finishAnswer = false
setTimeout(() => {
this.questionData.issues.forEach(issue => {
issue.wors.forEach(wor => {
this.$refs['checkboxes' + wor.wid][0].toggle(false)
})
})
})
}, 0)
}, 0)
this.checkTimer()
}
},
async getUserHasAnswerRandomNum() {
@@ -608,19 +613,22 @@ layout("/mobile/platform.html"){
this.currentScore = resp.data
},
checkTimer() {
if (this.timerInterval) {
clearInterval(this.timerInterval)
}
if (!this.finishAnswer) {
this.$dialog.alert({
title: '提示',
message: '本次答题时间' + this.questionData.timerMinute + '分钟,请尽快完成!'
}).then(() => {
this.countDownSeconds = this.questionData.timerMinute * 60
this.timerInterval = setInterval(() => {
if(this.questionData.enableTimer){
if (this.timerInterval) {
clearInterval(this.timerInterval)
}
if (!this.finishAnswer) {
this.$dialog.alert({
title: '提示',
message: '本次答题时间' + this.questionData.timerMinute + '分钟,请尽快完成!'
}).then(() => {
this.countDownSeconds = this.questionData.timerMinute * 60
this.updateCountdown()
}, 1000)
});
this.timerInterval = setInterval(() => {
this.updateCountdown()
}, 1000)
});
}
}
},