From 4bac09a1a398c3e851a098ab28d4282a81bfb920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E8=BE=89?= <814457906@qq.com> Date: Thu, 4 May 2023 15:27:43 +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 --- pages/Ordervideolearning/Ordervideolearning.vue | 10 +++++++++- pages/Videolearning/Videolearning.vue | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pages/Ordervideolearning/Ordervideolearning.vue b/pages/Ordervideolearning/Ordervideolearning.vue index f4ea610..51edd6c 100644 --- a/pages/Ordervideolearning/Ordervideolearning.vue +++ b/pages/Ordervideolearning/Ordervideolearning.vue @@ -110,7 +110,15 @@ videoContext: undefined, }; }, - onLaunch: function() { + onUnload() { + if (this.videoerroshow) { + if (this.videoitem.watchTime) { + this.videoitem.watchTime = this.formatSeconds(this.videoitem.watchTime) + } + insertTrainingItemWatchRecord(this.videoitem).then(res => {}) + } + }, + onLaunch() { // 锁定横屏 // plus.screen.lockOrientation("landscape-primary"); // 锁定竖屏 diff --git a/pages/Videolearning/Videolearning.vue b/pages/Videolearning/Videolearning.vue index c008e8c..6fe4ce8 100644 --- a/pages/Videolearning/Videolearning.vue +++ b/pages/Videolearning/Videolearning.vue @@ -104,6 +104,14 @@ videoerroshow: true, }; }, + onUnload() { + if (this.videoerroshow) { + if (this.videoitem.watchTime) { + this.videoitem.watchTime = this.formatSeconds(this.videoitem.watchTime) + } + insertTrainingItemWatchRecord(this.videoitem).then(res => {}) + } + }, onHide() { var that = this uni.getSystemInfo({