lex 8 месяцев назад
Родитель
Сommit
3e2fbba076

+ 5 - 1
src/views/exercise-after-class/index.module.less

@@ -350,10 +350,14 @@
         font-weight: 400;
       }
 
+      .van-button {
+        font-size: 16px;
+        --van-button-default-height: 40px;
+      }
+
       .van-button+.van-button {
         margin-left: 15px;
         font-weight: 500;
-        font-size: 16px;
         color: #FFFFFF;
       }
     }

+ 8 - 12
src/views/exercise-after-class/index.tsx

@@ -1,4 +1,4 @@
-import { Button, Icon, Popup, showConfirmDialog, Swipe, SwipeItem } from 'vant';
+import { Button, Icon, Popup, Swipe, SwipeItem } from 'vant';
 import {
   defineComponent,
   onMounted,
@@ -22,7 +22,6 @@ import playLoadData from '../coursewarePlay/datas/data.json';
 import VideoClass from './video-class';
 import { usePageVisibility } from '@vant/use';
 import { useInterval, useIntervalFn } from '@vueuse/core';
-import deepClone from '@/helpers/deep-clone';
 
 // const materialType = {
 //   视频: 'VIDEO',
@@ -282,7 +281,11 @@ export default defineComponent({
       ) {
         let isLastIndex = false;
         let itemIndex = 0;
-        // console.log(data.isPlayBaseStatus, data.isPlayAll, data.trainings);
+        // console.log(
+        //   data.isPlayBaseStatus,
+        //   data.isPlayAll,
+        //   data.trainings,
+        // );
         if (data.isPlayBaseStatus) {
           itemIndex = data.trainings.findIndex(
             (n: any) => n.id == data.videoData?.id
@@ -300,13 +303,13 @@ export default defineComponent({
             }
           });
           itemIndex = i != -1 ? i - 1 : -1;
-          // console.log(status, itemIndex);
           isLastIndex = status;
         }
 
         data.visiableConfirmText = isLastIndex ? '完成' : '下一题';
         data.visiableStatus = true;
         data.itemIndex = itemIndex;
+        console.log(itemIndex, 'index');
         data.isLastIndex = isLastIndex;
       }
     };
@@ -329,8 +332,7 @@ export default defineComponent({
     const dialogCancel = () => {
       try {
         data.trainings[data.itemIndex].currentTime = 0;
-        data.trainings[data.itemIndex]?.videoEle?.currentTime(0);
-      } catch {
+      } catch (e) {
         //
       }
       data.visiableStatus = false;
@@ -390,12 +392,6 @@ export default defineComponent({
                       }}
                       onTimeupdate={() => {
                         const activeVideoRef = m.videoEle;
-                        // console.log(
-                        //   videoIntervalRef.isActive.value,
-                        //   activeVideoRef?.currentTime(),
-                        //   activeVideoRef?.paused(),
-                        //   'activeVideoRef?.paused()'
-                        // );
                         if (
                           !videoIntervalRef.isActive.value &&
                           activeVideoRef?.currentTime() > 0 &&

+ 0 - 9
src/views/exercise-after-class/video-class.tsx

@@ -67,15 +67,6 @@ export default defineComponent({
 
         // 初步加载时
         videoItem.value.one('loadedmetadata', () => {
-          // if (item.value.autoplay && videoItem.value) {
-          //   videoItem.value?.play()
-          // } else {
-          //   item.value.muted = false
-          //   item.value.videoEle?.muted(false)
-          //   item.value.videoEle?.volume(1)
-          //   item.value.videoEle?.pause()
-          // }
-
           // 获取时长
           const videoEle = videoItem.value;
           item.value.duration = videoEle.duration();