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