瀏覽代碼

Merge branch 'iteration-20240515-video' into online

lex 1 年之前
父節點
當前提交
948c3ecbab
共有 1 個文件被更改,包括 13 次插入12 次删除
  1. 13 12
      src/views/student-register/index.tsx

+ 13 - 12
src/views/student-register/index.tsx

@@ -1192,17 +1192,6 @@ export default defineComponent({
       schoolId?: string
     ) => {
       try {
-        const videoBrowseData =
-          moreTime.value.length > 0 ? formatEffectiveTime(moreTime.value) : [];
-        const time =
-          videoBrowseData.length > 0 ? formatTimer(videoBrowseData) : 0;
-        // console.log(moreTime.value, videoBrowseData, 'video', time);
-        // const videoCountTime = videoIntervalRef?.counter.value
-        // 判断 视屏播放时间大于视屏播放有效时间则说明数据有问题,进行重置数据
-        const rate = Math.floor(
-          (time / Math.floor(videoForms.player.duration())) * 100
-        );
-
         const params = {
           id: forms.saveId,
           useTime: pageBrowseTime, // 固定5秒
@@ -1211,7 +1200,19 @@ export default defineComponent({
           schoolId
         };
         let otherParams = {};
-        if (!userId) {
+        if (!userId && videoForms.player.duration() > 0) {
+          const videoBrowseData =
+            moreTime.value.length > 0
+              ? formatEffectiveTime(moreTime.value)
+              : [];
+          const time =
+            videoBrowseData.length > 0 ? formatTimer(videoBrowseData) : 0;
+          // console.log(moreTime.value, videoBrowseData, 'video', time);
+          // const videoCountTime = videoIntervalRef?.counter.value
+          // 判断 视屏播放时间大于视屏播放有效时间则说明数据有问题,进行重置数据
+          const rate = Math.floor(
+            (time / Math.floor(videoForms.player.duration())) * 100
+          );
           otherParams = {
             videoBrowseData: JSON.stringify(videoBrowseData), // 视屏播放数据
             videoBrowseDataTime: time || 0, // 有效的视频观看时长