Browse Source

Merge branch 'iteration-20240515-video' into online

lex 1 year ago
parent
commit
948c3ecbab
1 changed files with 13 additions and 12 deletions
  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
       schoolId?: string
     ) => {
     ) => {
       try {
       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 = {
         const params = {
           id: forms.saveId,
           id: forms.saveId,
           useTime: pageBrowseTime, // 固定5秒
           useTime: pageBrowseTime, // 固定5秒
@@ -1211,7 +1200,19 @@ export default defineComponent({
           schoolId
           schoolId
         };
         };
         let otherParams = {};
         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 = {
           otherParams = {
             videoBrowseData: JSON.stringify(videoBrowseData), // 视屏播放数据
             videoBrowseData: JSON.stringify(videoBrowseData), // 视屏播放数据
             videoBrowseDataTime: time || 0, // 有效的视频观看时长
             videoBrowseDataTime: time || 0, // 有效的视频观看时长