y595705120 1 week ago
parent
commit
2d0dce0f9c
1 changed files with 27 additions and 26 deletions
  1. 27 26
      src/containers/center/play/components/media.vue

+ 27 - 26
src/containers/center/play/components/media.vue

@@ -79,6 +79,7 @@
       },
       dialog(showDilog) {
         if (!showDilog) {
+          this.tick(true)
           this.doPause()
           this.isReady = false
         }
@@ -347,8 +348,7 @@
           console.log("curTimes")
           return;
         }
-
-        let isFinish = force ? 1 : 0
+        let isFinish = media.isFinish||0;
         if (curTimes >= media.duration-15) isFinish = 1;
         //  拉到后面
         if (!isFinish) {
@@ -364,35 +364,36 @@
         let param = {
           id: media.id,
           position: curTimes,
-          isFinish
+          isFinish,
+          force
         };
         httpServer("course.tick", param, true).then(res => {
-          if (res.code == 200) {
-            let {
-              skip,
-              position,
-              pause,
-              closed
-            } = res.data
-            if (pause || closed) {
-              this.doPause();
-              this.$emit("close")
-              if (closed) {
-                this.$message.errorMsg("禁止多处同时学习", 5);
-              } else if (pause) {
-                this.$message.errorMsg("禁止多处同时学习", 5);
-              }
-              return
+          if (res.code != 200) return;
+          let {
+            skip,
+            position,
+            pause,
+            closed
+          } = res.data
+          if (pause || closed) {
+            this.doPause();
+            this.$emit("close")
+            if (closed) {
+              this.$message.errorMsg("禁止多处同时学习", 5);
+            } else if (pause) {
+              this.$message.errorMsg("禁止多处同时学习", 5);
             }
-            if (!skip) {
-              let diff = Math.abs(position - curTimes);
-              if (diff > 3) {
-                this.setposition(position);
-              }
+            return
+          }
+          if (!skip) {
+            let diff = Math.abs(position - curTimes);
+            if (diff > 5) {
+              this.setposition(position);
             }
-            Object.assign(param, res.data)
-            this.$emit("update", param)
           }
+          Object.assign(param, res.data)
+          this.$emit("update", param)
+
         })
       }
     }