Преглед на файлове

修改课程播放重复记录

zaijin преди 1 година
родител
ревизия
89b9638f3a
променени са 3 файла, в които са добавени 22 реда и са изтрити 15 реда
  1. 2 2
      src/api/AdaptiveTraining/index.js
  2. 19 13
      src/components/CourseVideo/index.vue
  3. 1 0
      vue.config.js

+ 2 - 2
src/api/AdaptiveTraining/index.js

@@ -3,7 +3,7 @@
  * @Author: 空白格
  * @Date: 2022-08-12 17:34:57
  * @LastEditors: 空白格
- * @LastEditTime: 2022-09-20 09:10:17
+ * @LastEditTime: 2023-04-19 11:23:14
  * @FilePath: \veterans_client_web\src\api\AdaptiveTraining\index.js
  * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
  */
@@ -67,7 +67,7 @@ export function addComment(data) {
  */
 export function submitClassesDuration(data) {
   return request({
-    url: "/app/record/duration/",
+    url: "/app/record/duration",
     method: "post",
     data,
   });

+ 19 - 13
src/components/CourseVideo/index.vue

@@ -3,7 +3,7 @@
  * @Author: 空白格
  * @Date: 2022-08-24 13:48:47
  * @LastEditors: 空白格
- * @LastEditTime: 2022-12-16 11:53:22
+ * @LastEditTime: 2023-04-19 11:26:38
  * @FilePath: \veterans_client_web\src\components\CourseVideo\index.vue
  * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
 -->
@@ -104,12 +104,12 @@ export default {
       this.videoInfo.playedTime =
         this.courseDetails.chapterList[0].playDuration;
       this.isPay = true;
-      this.$nextTick(() => {
-        let video = document.getElementById("myVideo");
-        video.onpause = () => {
-          this.submitVideoDuration();
-        };
-      });
+      // this.$nextTick(() => {
+      //   let video = document.getElementById("myVideo");
+      //   video.onpause = () => {
+      //     this.submitVideoDuration();
+      //   };
+      // });
     },
   },
   methods: {
@@ -204,15 +204,21 @@ export default {
               this.isPay = true;
               this.videoInfo.playedTime = item.playDuration;
               this.videoInfo.initial_time = item.currentDuration;
-              this.$nextTick(() => {
-                let video = document.getElementById("myVideo");
-                video.onpause = () => {
-                  this.submitVideoDuration();
-                };
-              });
+              // this.$nextTick(() => {
+              //   let video = document.getElementById("myVideo");
+              //   video.onpause = () => {
+              //     this.submitVideoDuration();
+              //   };
+              // });
             }
           }
         });
+      } else {
+        this.$emit("changeClasses", item);
+        this.currentClasses = item;
+        this.isPay = true;
+        this.videoInfo.playedTime = item.playDuration;
+        this.videoInfo.initial_time = item.currentDuration;
       }
     },
   },

+ 1 - 0
vue.config.js

@@ -13,6 +13,7 @@ module.exports = defineConfig({
       // 开发模式请求基础api反代理
       [process.env.VUE_APP_BASE_API]: {
         target: `https://wx.hw.hongweisoft.com/veterans`,
+        // target: `http://gateway.veterans.hongweisoft.com/veterans-prod-api`,
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",