Commit 1e655978 authored by LiZongLin's avatar LiZongLin

答题成绩可能多次提交的bug

parent 3d00432c
...@@ -62,8 +62,8 @@ ...@@ -62,8 +62,8 @@
</view> </view>
<view class="answer-bottom"> <view class="answer-bottom">
<button v-if="questionNumber<total-1" @click="nextQuestion"><text>下一题</text></button> <button v-if="questionNumber<total-1" @click="nextQuestion">下一题</button>
<button v-else @click="pause()"><text>完成</text></button> <button v-else :disabled="pauseFlag" @click="pause()">完成</button>
</view> </view>
<uni-popup ref="popup" background-color="#ffffff" :isMaskClick="false"> <uni-popup ref="popup" background-color="#ffffff" :isMaskClick="false">
...@@ -95,11 +95,14 @@ ...@@ -95,11 +95,14 @@
<view v-else>万名以上</view> <view v-else>万名以上</view>
</view> </view>
</view> </view>
<view class="cumulative-time">*截止到{{nowTime}},排名仅供参考</view> <view class="cumulative-time">
<view>*截止到{{nowTime}}</view>
<view>排名仅供参考</view>
</view>
<view class="result-button"> <view class="result-button">
<button @click="gotoActivity('返回答题')">继续答题</button> <button class="button-item" @click="gotoActivity('返回答题')">继续答题</button>
<button @click="gotoActivity('返回活动')">返回活动</button> <button class="button-item" @click="gotoActivity('返回活动')">返回活动</button>
<button @click="gotoRank()">更多排行</button> <button class="button-item" @click="gotoRank()">更多排行</button>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
...@@ -134,6 +137,7 @@ ...@@ -134,6 +137,7 @@
export default { export default {
data() { data() {
return { return {
pauseFlag: false, //完成按钮禁用
nowTime: '', //排行截止时间 nowTime: '', //排行截止时间
signupScoreInfo: { signupScoreInfo: {
activityId: '', activityId: '',
...@@ -178,13 +182,15 @@ ...@@ -178,13 +182,15 @@
}, },
methods: { methods: {
//跳转到该活动排行页面 //跳转到该活动排行页面
gotoRank(){ gotoRank() {
this.pauseFlag = false
uni.redirectTo({ uni.redirectTo({
url:`/pages_daily_answer/tjt_rank/tjt_rank?activityId=${this.activityId}` url: `/pages_daily_answer/tjt_rank/tjt_rank?activityId=${this.activityId}`
}) })
}, },
//答题完成返回赛事活动页面 //答题完成返回赛事活动页面
gotoActivity(back) { gotoActivity(back) {
this.pauseFlag = false
console.log("时间标志", this.flagTime); console.log("时间标志", this.flagTime);
let today = new Date().toISOString().substring(0, 10) let today = new Date().toISOString().substring(0, 10)
let flag = this.getDaysBetween(this.flagTime, today) let flag = this.getDaysBetween(this.flagTime, today)
...@@ -205,14 +211,6 @@ ...@@ -205,14 +211,6 @@
this.getFinishSituation().then(() => { this.getFinishSituation().then(() => {
console.log("finishSituationList", this.finishSituationList); console.log("finishSituationList", this.finishSituationList);
let i = 0; let i = 0;
if (i === this.day - 1) {
console.log("所有答题已完成");
uni.showToast({
title: '所有答题已完成,请退出答题页面',
icon: 'none'
})
return
}
for (i = 0; i < this.day; i++) { for (i = 0; i < this.day; i++) {
console.log('i', i); console.log('i', i);
console.log('this.day', this.day); console.log('this.day', this.day);
...@@ -225,6 +223,14 @@ ...@@ -225,6 +223,14 @@
} }
} }
} }
if (i === this.day) {
console.log("所有答题已完成");
uni.showToast({
title: '所有答题已完成,请退出答题页面',
icon: 'none'
})
return
}
}) })
} }
}, },
...@@ -340,7 +346,14 @@ ...@@ -340,7 +346,14 @@
this.minutes) + ':' + (this.seconds < 10 ? '0' + this.seconds : this.seconds); this.minutes) + ':' + (this.seconds < 10 ? '0' + this.seconds : this.seconds);
}, },
// 结束计时,并显示弹出层 // 结束计时,并显示弹出层
pauseChange() {
return new Promise((resolve, reject) => {
this.pauseFlag = true
resolve();
})
},
pause() { pause() {
this.pauseChange().then(()=>{
this.signupScoreInfo.score = this.cumulativeScore this.signupScoreInfo.score = this.cumulativeScore
console.log("hehe"); console.log("hehe");
if (this.timer) { if (this.timer) {
...@@ -368,6 +381,7 @@ ...@@ -368,6 +381,7 @@
}) })
}) })
}) })
})
console.log("本次用时", this.ti) console.log("本次用时", this.ti)
}, },
//得到考试时间 //得到考试时间
...@@ -901,18 +915,19 @@ ...@@ -901,18 +915,19 @@
height: 88rpx; height: 88rpx;
background: #3b7cde; background: #3b7cde;
border-radius: 16px; border-radius: 16px;
line-height: 2; // line-height: 2;
text {
position: relative;
top: 10%;
color: #ffffff; color: #ffffff;
font-size: 18px; margin: 0 auto;
font-family: Source Han Sans CN, Source Han Sans CN-Regular; // text {
font-weight: 400; // position: relative;
text-align: center; // top: 10%;
line-height: 25px; // color: #ffffff;
} // font-size: 18px;
// font-family: Source Han Sans CN, Source Han Sans CN-Regular;
// font-weight: 400;
// text-align: center;
// line-height: 25px;
// }
} }
} }
...@@ -921,7 +936,7 @@ ...@@ -921,7 +936,7 @@
left: 10%; left: 10%;
position: fixed; position: fixed;
z-index: 99; z-index: 99;
height: 70%; height: 65%;
width: 80%; width: 80%;
background: #ffffff; background: #ffffff;
border-radius: 20px; border-radius: 20px;
...@@ -1016,13 +1031,15 @@ ...@@ -1016,13 +1031,15 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
button { .button-item {
border-radius: 16px; border-radius: 16px;
background: #3b7cde; background: #3b7cde;
width: 30%; width: 30%;
color: #ffffff; color: #ffffff;
font-size: 25rpx; font-size: 25rpx;
padding-top: 2.5%; height: 70rpx;
line-height: 70rpx;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment