|
@@ -169,7 +169,11 @@ export default defineComponent({
|
|
homeworkStatus: true, // 布置作业完成时
|
|
homeworkStatus: true, // 布置作业完成时
|
|
removeVisiable: false,
|
|
removeVisiable: false,
|
|
removeTitle: '',
|
|
removeTitle: '',
|
|
- removeContent: ''
|
|
|
|
|
|
+ removeContent: '',
|
|
|
|
+
|
|
|
|
+ videoState: 'init' as 'init' | 'play',
|
|
|
|
+ videoItemRef: null as any,
|
|
|
|
+ animationState: 'start' as 'start' | 'end'
|
|
});
|
|
});
|
|
const activeData = reactive({
|
|
const activeData = reactive({
|
|
// isAutoPlay: false, // 是否自动播放
|
|
// isAutoPlay: false, // 是否自动播放
|
|
@@ -219,6 +223,9 @@ export default defineComponent({
|
|
isRender: false // 是否渲染了
|
|
isRender: false // 是否渲染了
|
|
};
|
|
};
|
|
});
|
|
});
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ data.animationState = 'end'
|
|
|
|
+ }, 500)
|
|
} catch {
|
|
} catch {
|
|
//
|
|
//
|
|
}
|
|
}
|
|
@@ -537,8 +544,11 @@ export default defineComponent({
|
|
const handleSwipeChange = (index: number) => {
|
|
const handleSwipeChange = (index: number) => {
|
|
// 如果是当前正在播放 或者是视频最后一个
|
|
// 如果是当前正在播放 或者是视频最后一个
|
|
if (popupData.activeIndex == index) return;
|
|
if (popupData.activeIndex == index) return;
|
|
|
|
+ data.animationState = 'start'
|
|
|
|
+ data.videoState = 'init'
|
|
handleStop();
|
|
handleStop();
|
|
clearTimeout(acitveTimer.value);
|
|
clearTimeout(acitveTimer.value);
|
|
|
|
+ activeData.model = true;
|
|
checkedAnimation(popupData.activeIndex, index);
|
|
checkedAnimation(popupData.activeIndex, index);
|
|
popupData.activeIndex = index;
|
|
popupData.activeIndex = index;
|
|
|
|
|
|
@@ -569,6 +579,7 @@ export default defineComponent({
|
|
item.error = false;
|
|
item.error = false;
|
|
// item.videoEle?.onPlay();
|
|
// item.videoEle?.onPlay();
|
|
}
|
|
}
|
|
|
|
+ data.animationState = 'end'
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -861,6 +872,7 @@ export default defineComponent({
|
|
const closeStudyTool = () => {
|
|
const closeStudyTool = () => {
|
|
studyData.type = 'init';
|
|
studyData.type = 'init';
|
|
toggleModel();
|
|
toggleModel();
|
|
|
|
+ setModelOpen();
|
|
};
|
|
};
|
|
|
|
|
|
const startShowModal = (
|
|
const startShowModal = (
|
|
@@ -1016,7 +1028,13 @@ export default defineComponent({
|
|
|
|
|
|
return false;
|
|
return false;
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+ const activeVideoItem = computed(() => {
|
|
|
|
+ const item = data.itemList[popupData.activeIndex]
|
|
|
|
+ if (item && item.type && item.type.toLocaleUpperCase() === 'VIDEO') {
|
|
|
|
+ return item
|
|
|
|
+ }
|
|
|
|
+ return {}
|
|
|
|
+ })
|
|
return () => (
|
|
return () => (
|
|
<div id="playContent" class={[styles.playContent, 'wrap']}>
|
|
<div id="playContent" class={[styles.playContent, 'wrap']}>
|
|
<div
|
|
<div
|
|
@@ -1032,13 +1050,43 @@ export default defineComponent({
|
|
}}>
|
|
}}>
|
|
<div
|
|
<div
|
|
class={styles.coursewarePlay}
|
|
class={styles.coursewarePlay}
|
|
- style={{ width: parentContainer.width }}
|
|
|
|
- onClick={(e: Event) => {
|
|
|
|
- e.stopPropagation();
|
|
|
|
- setModelOpen();
|
|
|
|
- }}>
|
|
|
|
|
|
+ style={{ width: parentContainer.width }}>
|
|
{!popupData.chapterLoading ? (
|
|
{!popupData.chapterLoading ? (
|
|
<div class={styles.wraps}>
|
|
<div class={styles.wraps}>
|
|
|
|
+ <div
|
|
|
|
+ style={
|
|
|
|
+ activeVideoItem.value.type &&
|
|
|
|
+ data.animationState === 'end' &&
|
|
|
|
+ data.videoState === 'play'
|
|
|
|
+ ? {
|
|
|
|
+ zIndex: 15,
|
|
|
|
+ opacity: 1
|
|
|
|
+ }
|
|
|
|
+ : { opacity: 0, zIndex: -1 }
|
|
|
|
+ }
|
|
|
|
+ class={styles.itemDiv}
|
|
|
|
+ >
|
|
|
|
+ <VideoPlay
|
|
|
|
+ ref={(el: any) => data.videoItemRef = el}
|
|
|
|
+ item={activeVideoItem.value}
|
|
|
|
+ showModel={activeData.model}
|
|
|
|
+ onClose={setModelOpen}
|
|
|
|
+
|
|
|
|
+ onCanplay={() => {
|
|
|
|
+ data.videoState = 'play'
|
|
|
|
+ }}
|
|
|
|
+ onPause={() => {
|
|
|
|
+ clearTimeout(activeData.timer)
|
|
|
|
+ activeData.model = true
|
|
|
|
+ }}
|
|
|
|
+ onEnded={() => {
|
|
|
|
+ const _index = popupData.activeIndex + 1
|
|
|
|
+ if (_index < data.itemList.length) {
|
|
|
|
+ handleSwipeChange(_index);
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
{data.itemList.map((m: any, mIndex: number) => {
|
|
{data.itemList.map((m: any, mIndex: number) => {
|
|
const isRender = Math.abs(popupData.activeIndex - mIndex) < 2;
|
|
const isRender = Math.abs(popupData.activeIndex - mIndex) < 2;
|
|
const isEmtry = Math.abs(popupData.activeIndex - mIndex) > 4;
|
|
const isEmtry = Math.abs(popupData.activeIndex - mIndex) > 4;
|
|
@@ -1087,7 +1135,10 @@ export default defineComponent({
|
|
}}>
|
|
}}>
|
|
{m.type === 'VIDEO' ? (
|
|
{m.type === 'VIDEO' ? (
|
|
<>
|
|
<>
|
|
- <VideoPlay
|
|
|
|
|
|
+ <img src={m.coverImg} onLoad={() => {
|
|
|
|
+ m.isprepare = true;
|
|
|
|
+ }} />
|
|
|
|
+ {/* <VideoPlay
|
|
ref={(v: any) => (data.videoRefs[mIndex] = v)}
|
|
ref={(v: any) => (data.videoRefs[mIndex] = v)}
|
|
item={m}
|
|
item={m}
|
|
isEmtry={isEmtry}
|
|
isEmtry={isEmtry}
|
|
@@ -1112,9 +1163,9 @@ export default defineComponent({
|
|
console.log('video error');
|
|
console.log('video error');
|
|
m.error = true;
|
|
m.error = true;
|
|
}}
|
|
}}
|
|
- />
|
|
|
|
|
|
+ /> */}
|
|
<Transition name="van-fade">
|
|
<Transition name="van-fade">
|
|
- {!m.isprepare && (
|
|
|
|
|
|
+ { (
|
|
<div class={styles.loadWrap}>
|
|
<div class={styles.loadWrap}>
|
|
<Vue3Lottie
|
|
<Vue3Lottie
|
|
animationData={playLoadData}></Vue3Lottie>
|
|
animationData={playLoadData}></Vue3Lottie>
|
|
@@ -1184,6 +1235,9 @@ export default defineComponent({
|
|
<div
|
|
<div
|
|
onClick={(e: any) => {
|
|
onClick={(e: any) => {
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
|
|
+ if (activeData.timer){
|
|
|
|
+ setModelOpen();
|
|
|
|
+ }
|
|
}}
|
|
}}
|
|
class={[
|
|
class={[
|
|
styles.switchDisplaySection,
|
|
styles.switchDisplaySection,
|