From 58b3b2392c4b16ce0a7a97a40a3d2afefca2c389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E8=BE=89?= <814457906@qq.com> Date: Wed, 26 Apr 2023 16:46:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ordervideolearning/Ordervideolearning.vue | 21 ++++++++++++------- pages/Videolearning/Videolearning.vue | 19 ++++++++++------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/pages/Ordervideolearning/Ordervideolearning.vue b/pages/Ordervideolearning/Ordervideolearning.vue index 80871ff..7043ed7 100644 --- a/pages/Ordervideolearning/Ordervideolearning.vue +++ b/pages/Ordervideolearning/Ordervideolearning.vue @@ -78,7 +78,8 @@ videoitem: { watchTime: 0, }, //视频对象 - trainingOrderStatus: undefined + trainingOrderStatus: undefined, + videoerroshow: true, }; }, methods: { @@ -89,14 +90,16 @@ }, //关闭播放弹出框 videoshowfalse() { - if (this.videoitem.watchTime) { - this.videoitem.watchTime = this.formatSeconds(this.videoitem.watchTime) + if (this.videoerroshow) { + if (this.videoitem.watchTime) { + this.videoitem.watchTime = this.formatSeconds(this.videoitem.watchTime) + } + insertTrainingItemWatchRecord(this.videoitem).then(res => { + this.videoitem.watchTime = 0 + this.info(); + this.videoshow = false + }) } - insertTrainingItemWatchRecord(this.videoitem).then(res => { - this.videoitem.watchTime = 0 - this.info(); - this.videoshow = false - }) }, //视频播放出错 videoerror(e) { @@ -105,6 +108,7 @@ type: 'error', duration: '2000' }) + this.videoerroshow = false setTimeout(e => { this.videoshow = false }, 1000) @@ -119,6 +123,7 @@ }, //视频播放 videoplay(item) { + this.videoerroshow = true if (item.itemDirectoryUrl) { if (!item.watchTime) { this.videoitem.watchTime = 0 diff --git a/pages/Videolearning/Videolearning.vue b/pages/Videolearning/Videolearning.vue index e453736..934555e 100644 --- a/pages/Videolearning/Videolearning.vue +++ b/pages/Videolearning/Videolearning.vue @@ -77,6 +77,7 @@ videoitem: { watchTime: 0, }, //视频对象 + videoerroshow: true, }; }, methods: { @@ -87,14 +88,16 @@ }, //关闭播放弹出框 videoshowfalse() { - if (this.videoitem.watchTime) { - this.videoitem.watchTime = this.formatSeconds(this.videoitem.watchTime) + if (this.videoerroshow) { + if (this.videoitem.watchTime) { + this.videoitem.watchTime = this.formatSeconds(this.videoitem.watchTime) + } + insertTrainingItemWatchRecord(this.videoitem).then(res => { + this.videoitem.watchTime = 0 + this.info(); + this.videoshow = false + }) } - insertTrainingItemWatchRecord(this.videoitem).then(res => { - this.videoitem.watchTime = 0 - this.info(); - this.videoshow = false - }) }, //视频播放出错 videoerror(e) { @@ -103,12 +106,14 @@ type: 'error', duration: '2000' }) + this.videoerroshow = false setTimeout(e => { this.videoshow = false }, 1000) }, //视频播放 videoplay(item) { + this.videoerroshow = true if (item.itemDirectoryUrl) { if (!item.watchTime) { this.videoitem.watchTime = 0