谢杰标 2 年 前
コミット
9d450076c9
1 ファイル変更16 行追加26 行削除
  1. 16 26
      pages3/polyv/detail.vue

+ 16 - 26
pages3/polyv/detail.vue

@@ -490,9 +490,22 @@ export default {
     }
   },
   onUnload() {
-    console.log("onUnloadonUnloadonUnloadonUnload");
-    this.originUnload();
-    clearInterval(this.lockTimer);
+    console.log("onUnload");
+    if (this.sectionId > 0 && this.isPlaying) {
+      //退出提交记录
+      this.postStudyRecord();
+    }
+    this.refPlv = null;
+    //移除所有的事件监听器
+    uni.$off();
+    this.clearPauseTimer();
+    if (this.lockTimer) {
+      clearInterval(this.lockTimer);
+      this.$api.lockDelLock({
+        action: "jxjy",
+        uuid: this.$method.getUuid(),
+      });
+    }
     uni.removeInterceptor("navigateTo");
   },
   onHide() {
@@ -761,28 +774,6 @@ export default {
         this.pauseTimer = null;
       }
     },
-    // 原来onUnload里面的内容
-    originUnload() {
-      if (this.sectionId > 0 && this.isPlaying) {
-        //退出提交记录
-        this.postStudyRecord();
-      }
-      this.refPlv = null;
-      //移除所有的事件监听器
-      uni.$off();
-      this.clearPauseTimer();
-      if (this.lockTimer) {
-        clearInterval(this.lockTimer);
-        this.$api
-          .lockDelLock({
-            action: "jxjy",
-            uuid: this.$method.getUuid(),
-          })
-          .then((res) => {
-            uni.hideLoading();
-          });
-      }
-    },
     changeCourses() {
       this.toggleCourseShow = true;
     },
@@ -843,7 +834,6 @@ export default {
       this.originOnShow();
     },
     clickLeft() {
-      // uni.navigateBack()
       uni.switchTab({
         url: "/pages/learn/index",
       });