From c3b0a1f12e8daea8fa10e3d76edbfd2178d3c324 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Fri, 26 Apr 2024 11:23:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E8=AF=BEbug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/exam.vue | 43 ++++++++++++++++++---------- src/components/VideoPlayer/index.vue | 4 ++- src/views/study/coursenew.vue | 2 +- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/components/Course/exam.vue b/src/components/Course/exam.vue index dc1f10b4..b6af69f4 100644 --- a/src/components/Course/exam.vue +++ b/src/components/Course/exam.vue @@ -72,7 +72,7 @@
上一题 - 提 交 + 提 交 下一题
@@ -408,24 +408,34 @@ export default { this.curIndex++; this.curItem=this.paper.items[this.curIndex]; }, + debounce(func, delay) { + let timerId; + return function (...args) { + if (timerId) clearTimeout(timerId); + timerId = setTimeout(() => { + func.apply(this, args); + timerId = null; + }, delay); + }; + }, present(){ //提交前处理 let $this=this; let score=this.countTest(); console.log('score='+score); - if(this.noAnswers.length>0){ - this.$confirm('还有未答试题,您确定要提交吗?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - showClose:false, - type: 'warning' - }).then(() => { - this.submitTest(score); - }).catch(()=>{ + // if(this.noAnswers.length>0){ + // this.$confirm('还有未答试题,您确定要提交吗?', '提示', { + // confirmButtonText: '确定', + // cancelButtonText: '取消', + // showClose:false, + // type: 'warning' + // }).then(() => { + // this.submitTest(score); + // }).catch(()=>{ - }) - }else{ - this.submitTest(score); - } + // }) + // }else{ + // this.submitTest(score); + // } }, countTest(){ //计算考试的分数 //console.log(this.paper.items); @@ -588,7 +598,10 @@ export default { }); }, - } + }, + created() { + this.debouncedPresent = this.debounce(this.present, 500); + }, } diff --git a/src/components/VideoPlayer/index.vue b/src/components/VideoPlayer/index.vue index 95bd36d5..f9dc221a 100644 --- a/src/components/VideoPlayer/index.vue +++ b/src/components/VideoPlayer/index.vue @@ -40,7 +40,7 @@ :biBarrageXml="biBarrageXml" /> -
+
loading
@@ -274,6 +274,7 @@ export default { }, data() { return { + isShowPlayer: true,//增加一个状态,判断加载动画 timeFastBack : 15, //单位秒,每次增减15秒 videoDom: null, //视频dom isShowCover: true, // 是否显示封面 @@ -568,6 +569,7 @@ export default { }, currentProgress: function () { // 进度条到终点时修改播放状态 + this.isShowPlayer = false this.$emit('onPlayerPlaying', this.videoDom.currentTime,this.videoDom.duration) if (this.currentProgress === 1) { this.isPlaying = false; diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index 5b8a3ac2..1e039fe7 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -1607,7 +1607,7 @@ //height: 100%; border: 1px solid #ffffff; padding-right: 20px; - overflow: auto; + // overflow: auto; } .course-control{ //内容控制区域 width: 420px;