From e0d4b02b712256fe6cb8ec50899d4961d5806682 Mon Sep 17 00:00:00 2001 From: daihh Date: Thu, 27 Oct 2022 12:23:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=97=8F=E4=B8=AD=E6=A1=88=E4=BE=8B?= =?UTF-8?q?=EF=BC=8C=E6=96=87=E7=AB=A0=E7=AD=89=E5=A4=B4=E5=83=8F=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E7=82=B9=E5=87=BB=E8=BF=9B=E5=85=A5=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Article/collectList.vue | 10 +++++----- src/components/Case/collectList.vue | 12 ++++++------ src/components/Course/exam.vue | 17 +++++++++++++---- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/components/Article/collectList.vue b/src/components/Article/collectList.vue index af97905d..3b983ce1 100644 --- a/src/components/Article/collectList.vue +++ b/src/components/Article/collectList.vue @@ -2,24 +2,24 @@
-
+
diff --git a/src/components/Case/collectList.vue b/src/components/Case/collectList.vue index abe2f2ff..62686d94 100644 --- a/src/components/Case/collectList.vue +++ b/src/components/Case/collectList.vue @@ -5,14 +5,14 @@
- +
- +
@@ -142,7 +142,7 @@ } .article-info { - + .article-info-title { font-size: 16px; font-weight: 400; diff --git a/src/components/Course/exam.vue b/src/components/Course/exam.vue index e380f203..a235855e 100644 --- a/src/components/Course/exam.vue +++ b/src/components/Course/exam.vue @@ -179,9 +179,14 @@ export default { this.loadExamInfo(); } }, + destroyed() { + if(this.timer){ + window.clearInterval(this.timer); + } + }, methods: { changeTimer(){ - if(this.timerValue==0){ + if(this.timerValue<=0){ window.clearInterval(this.timer); //系统自动提交 this.confirmStop(); @@ -298,7 +303,7 @@ export default { confirmButtonText: '确定', showClose:false, callback: action => { - this.submitTest(); + this.submitTest(); } }); @@ -332,7 +337,7 @@ export default { }).then(() => { this.submitTest() }).catch(()=>{ - + }) }else{ this.submitTest() @@ -397,6 +402,10 @@ export default { return this.lastScore; }, submitTest(){ //提交处理 + //清空提示 + if(this.timer){ + window.clearInterval(this.timer); + } let now=new Date(); let testScore=this.countTest(); let postData={ @@ -419,7 +428,7 @@ export default { var dateDiff = now.getTime() - this.startTime.getTime();//时间差的毫秒数 var minutes=Math.floor(dateDiff/(1000))//计算相差秒数,分钟记录的太大,经常为0 postData.testDuration=minutes; - + apiStudy.saveExam(postData).then(res=>{ if(res.status == 200) { this.records.push(res.result);