|
@@ -118,6 +118,7 @@ export default defineComponent({
|
|
|
|
|
|
const route = useRoute();
|
|
|
const headeRef = ref();
|
|
|
+ const loadingClass = ref(false); // 重新加载课件
|
|
|
const data = reactive({
|
|
|
knowledgePointList: [] as any,
|
|
|
courseDetails: [] as any,
|
|
@@ -361,183 +362,185 @@ export default defineComponent({
|
|
|
};
|
|
|
return () => (
|
|
|
<div id="playContent" class={styles.playContent}>
|
|
|
- <div>
|
|
|
- <div
|
|
|
- class={styles.coursewarePlay}
|
|
|
- style={{ width: parentContainer.width }}
|
|
|
- onClick={() => setModelOpen()}>
|
|
|
- <div class={styles.wraps}>
|
|
|
- {data.itemList.map((m: any, mIndex: number) => {
|
|
|
- const isRender =
|
|
|
- m.isRender || Math.abs(popupData.activeIndex - mIndex) < 2;
|
|
|
- const isEmtry = Math.abs(popupData.activeIndex - mIndex) > 4;
|
|
|
- if (isRender) {
|
|
|
- m.isRender = true;
|
|
|
- }
|
|
|
- return isRender ? (
|
|
|
- <div
|
|
|
- key={'index' + mIndex}
|
|
|
- class={[
|
|
|
- styles.itemDiv,
|
|
|
- popupData.activeIndex === mIndex && styles.itemActive,
|
|
|
- activeData.isAnimation && styles.acitveAnimation,
|
|
|
- Math.abs(popupData.activeIndex - mIndex) < 2
|
|
|
- ? styles.show
|
|
|
- : styles.hide
|
|
|
- ]}
|
|
|
- style={
|
|
|
- mIndex < popupData.activeIndex
|
|
|
- ? effects[effectIndex.value].prev
|
|
|
- : mIndex > popupData.activeIndex
|
|
|
- ? effects[effectIndex.value].next
|
|
|
- : {}
|
|
|
- }
|
|
|
- onClick={(e: Event) => {
|
|
|
- if (Date.now() - activeData.nowTime < 300) {
|
|
|
- handleDbClick(m);
|
|
|
- return;
|
|
|
+ {!loadingClass.value && (
|
|
|
+ <div>
|
|
|
+ <div
|
|
|
+ class={styles.coursewarePlay}
|
|
|
+ style={{ width: parentContainer.width }}
|
|
|
+ onClick={() => setModelOpen()}>
|
|
|
+ <div class={styles.wraps}>
|
|
|
+ {data.itemList.map((m: any, mIndex: number) => {
|
|
|
+ const isRender =
|
|
|
+ m.isRender || Math.abs(popupData.activeIndex - mIndex) < 2;
|
|
|
+ const isEmtry = Math.abs(popupData.activeIndex - mIndex) > 4;
|
|
|
+ if (isRender) {
|
|
|
+ m.isRender = true;
|
|
|
+ }
|
|
|
+ return isRender ? (
|
|
|
+ <div
|
|
|
+ key={'index' + mIndex}
|
|
|
+ class={[
|
|
|
+ styles.itemDiv,
|
|
|
+ popupData.activeIndex === mIndex && styles.itemActive,
|
|
|
+ activeData.isAnimation && styles.acitveAnimation,
|
|
|
+ Math.abs(popupData.activeIndex - mIndex) < 2
|
|
|
+ ? styles.show
|
|
|
+ : styles.hide
|
|
|
+ ]}
|
|
|
+ style={
|
|
|
+ mIndex < popupData.activeIndex
|
|
|
+ ? effects[effectIndex.value].prev
|
|
|
+ : mIndex > popupData.activeIndex
|
|
|
+ ? effects[effectIndex.value].next
|
|
|
+ : {}
|
|
|
}
|
|
|
- activeData.nowTime = Date.now();
|
|
|
- }}>
|
|
|
- {m.type === 'IMG' && <img src={m.content} />}
|
|
|
- {m.type === 'VIDEO' && (
|
|
|
- <VideoItem
|
|
|
- ref={(v: any) => (data.videoRefs[mIndex] = v)}
|
|
|
- item={m}
|
|
|
- show={popupData.activeIndex === mIndex}
|
|
|
- pageVisibility={pageVisibility.value}
|
|
|
- showModel={activeData.model}
|
|
|
- isEmtry={isEmtry}
|
|
|
- onLoadedmetadata={() => {
|
|
|
- m.isprepare = true;
|
|
|
- m.error = false;
|
|
|
- }}
|
|
|
- onEnded={() => {
|
|
|
- const _index = popupData.activeIndex + 1;
|
|
|
- if (_index < data.itemList.length) {
|
|
|
- handleSwipeChange(_index);
|
|
|
- }
|
|
|
- }}
|
|
|
- onReset={() => {
|
|
|
- m.error = false;
|
|
|
- }}
|
|
|
- onError={() => {
|
|
|
- m.isprepare = true;
|
|
|
- m.error = true;
|
|
|
- }}
|
|
|
- />
|
|
|
- )}
|
|
|
- {m.type === 'SONG' && (
|
|
|
- <AudioItem
|
|
|
- item={m}
|
|
|
- show={popupData.activeIndex === mIndex}
|
|
|
- pageVisibility={pageVisibility.value}
|
|
|
- showModel={activeData.model}
|
|
|
- isEmtry={isEmtry}
|
|
|
- onEnded={() => {
|
|
|
- const _index = popupData.activeIndex + 1;
|
|
|
- if (_index < data.itemList.length) {
|
|
|
- handleSwipeChange(_index);
|
|
|
- }
|
|
|
- }}
|
|
|
- onClose={() => {
|
|
|
- clearTimeout(activeData.timer);
|
|
|
- activeData.timer = setTimeout(() => {
|
|
|
- activeData.model = false;
|
|
|
- }, 4000);
|
|
|
- }}
|
|
|
- />
|
|
|
- )}
|
|
|
- {m.type === 'MUSIC' && (
|
|
|
- <MusicScore
|
|
|
- pageVisibility={pageVisibility.value}
|
|
|
- show={popupData.activeIndex === mIndex}
|
|
|
- activeModel={activeData.model}
|
|
|
- data-vid={m.id}
|
|
|
- music={m}
|
|
|
- />
|
|
|
- )}
|
|
|
+ onClick={(e: Event) => {
|
|
|
+ if (Date.now() - activeData.nowTime < 300) {
|
|
|
+ handleDbClick(m);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ activeData.nowTime = Date.now();
|
|
|
+ }}>
|
|
|
+ {m.type === 'IMG' && <img src={m.content} />}
|
|
|
+ {m.type === 'VIDEO' && (
|
|
|
+ <VideoItem
|
|
|
+ ref={(v: any) => (data.videoRefs[mIndex] = v)}
|
|
|
+ item={m}
|
|
|
+ show={popupData.activeIndex === mIndex}
|
|
|
+ pageVisibility={pageVisibility.value}
|
|
|
+ showModel={activeData.model}
|
|
|
+ isEmtry={isEmtry}
|
|
|
+ onLoadedmetadata={() => {
|
|
|
+ m.isprepare = true;
|
|
|
+ m.error = false;
|
|
|
+ }}
|
|
|
+ onEnded={() => {
|
|
|
+ const _index = popupData.activeIndex + 1;
|
|
|
+ if (_index < data.itemList.length) {
|
|
|
+ handleSwipeChange(_index);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ onReset={() => {
|
|
|
+ m.error = false;
|
|
|
+ }}
|
|
|
+ onError={() => {
|
|
|
+ m.isprepare = true;
|
|
|
+ m.error = true;
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {m.type === 'SONG' && (
|
|
|
+ <AudioItem
|
|
|
+ item={m}
|
|
|
+ show={popupData.activeIndex === mIndex}
|
|
|
+ pageVisibility={pageVisibility.value}
|
|
|
+ showModel={activeData.model}
|
|
|
+ isEmtry={isEmtry}
|
|
|
+ onEnded={() => {
|
|
|
+ const _index = popupData.activeIndex + 1;
|
|
|
+ if (_index < data.itemList.length) {
|
|
|
+ handleSwipeChange(_index);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ onClose={() => {
|
|
|
+ clearTimeout(activeData.timer);
|
|
|
+ activeData.timer = setTimeout(() => {
|
|
|
+ activeData.model = false;
|
|
|
+ }, 4000);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {m.type === 'MUSIC' && (
|
|
|
+ <MusicScore
|
|
|
+ pageVisibility={pageVisibility.value}
|
|
|
+ show={popupData.activeIndex === mIndex}
|
|
|
+ activeModel={activeData.model}
|
|
|
+ data-vid={m.id}
|
|
|
+ music={m}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {m.type === 'VIDEO' && (
|
|
|
- <Transition name="van-fade">
|
|
|
- {!m.isprepare && (
|
|
|
- <div class={styles.loadWrap}>
|
|
|
- <Vue3Lottie
|
|
|
- style={{ width: '100%', height: '100%' }}
|
|
|
- animationData={playLoadData}></Vue3Lottie>
|
|
|
- </div>
|
|
|
- )}
|
|
|
- </Transition>
|
|
|
- )}
|
|
|
- </div>
|
|
|
- ) : (
|
|
|
+ {m.type === 'VIDEO' && (
|
|
|
+ <Transition name="van-fade">
|
|
|
+ {!m.isprepare && (
|
|
|
+ <div class={styles.loadWrap}>
|
|
|
+ <Vue3Lottie
|
|
|
+ style={{ width: '100%', height: '100%' }}
|
|
|
+ animationData={playLoadData}></Vue3Lottie>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </Transition>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ ) : (
|
|
|
+ <div
|
|
|
+ key={'index' + mIndex}
|
|
|
+ class={[
|
|
|
+ styles.itemDiv,
|
|
|
+ popupData.activeIndex === mIndex && styles.itemActive,
|
|
|
+ activeData.isAnimation && styles.acitveAnimation,
|
|
|
+ Math.abs(popupData.activeIndex - mIndex) < 2
|
|
|
+ ? styles.show
|
|
|
+ : styles.hide
|
|
|
+ ]}
|
|
|
+ style={
|
|
|
+ mIndex < popupData.activeIndex
|
|
|
+ ? effects[effectIndex.value].prev
|
|
|
+ : mIndex > popupData.activeIndex
|
|
|
+ ? effects[effectIndex.value].next
|
|
|
+ : {}
|
|
|
+ }></div>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </div>
|
|
|
+ <Transition name="right">
|
|
|
+ {activeData.model && (
|
|
|
<div
|
|
|
- key={'index' + mIndex}
|
|
|
- class={[
|
|
|
- styles.itemDiv,
|
|
|
- popupData.activeIndex === mIndex && styles.itemActive,
|
|
|
- activeData.isAnimation && styles.acitveAnimation,
|
|
|
- Math.abs(popupData.activeIndex - mIndex) < 2
|
|
|
- ? styles.show
|
|
|
- : styles.hide
|
|
|
- ]}
|
|
|
- style={
|
|
|
- mIndex < popupData.activeIndex
|
|
|
- ? effects[effectIndex.value].prev
|
|
|
- : mIndex > popupData.activeIndex
|
|
|
- ? effects[effectIndex.value].next
|
|
|
- : {}
|
|
|
- }></div>
|
|
|
- );
|
|
|
- })}
|
|
|
- </div>
|
|
|
- <Transition name="right">
|
|
|
- {activeData.model && (
|
|
|
- <div
|
|
|
- class={styles.rightFixedBtns}
|
|
|
- onClick={(e: Event) => {
|
|
|
- e.stopPropagation();
|
|
|
- clearTimeout(activeData.timer);
|
|
|
- }}>
|
|
|
- <div
|
|
|
- class={[styles.fullBtn, styles.point]}
|
|
|
- onClick={() => (popupData.chapterOpen = true)}>
|
|
|
- <img src={iconChange} />
|
|
|
- <span>切换</span>
|
|
|
- </div>
|
|
|
+ class={styles.rightFixedBtns}
|
|
|
+ onClick={(e: Event) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ clearTimeout(activeData.timer);
|
|
|
+ }}>
|
|
|
+ <div
|
|
|
+ class={[styles.fullBtn, styles.point]}
|
|
|
+ onClick={() => (popupData.chapterOpen = true)}>
|
|
|
+ <img src={iconChange} />
|
|
|
+ <span>切换</span>
|
|
|
+ </div>
|
|
|
|
|
|
- <div
|
|
|
- class={[styles.fullBtn, styles.point]}
|
|
|
- onClick={() => (popupData.open = true)}>
|
|
|
- <img src={iconMenu} />
|
|
|
- <span>课件</span>
|
|
|
- </div>
|
|
|
+ <div
|
|
|
+ class={[styles.fullBtn, styles.point]}
|
|
|
+ onClick={() => (popupData.open = true)}>
|
|
|
+ <img src={iconMenu} />
|
|
|
+ <span>课件</span>
|
|
|
+ </div>
|
|
|
|
|
|
- <div
|
|
|
- class={[
|
|
|
- styles.fullBtn,
|
|
|
- popupData.activeIndex == 0 && styles.btnsDisabled
|
|
|
- ]}
|
|
|
- onClick={() => handlePreAndNext('up')}>
|
|
|
- <img src={iconUp} />
|
|
|
- <span style={{ textAlign: 'center' }}>上一个</span>
|
|
|
- </div>
|
|
|
+ <div
|
|
|
+ class={[
|
|
|
+ styles.fullBtn,
|
|
|
+ popupData.activeIndex == 0 && styles.btnsDisabled
|
|
|
+ ]}
|
|
|
+ onClick={() => handlePreAndNext('up')}>
|
|
|
+ <img src={iconUp} />
|
|
|
+ <span style={{ textAlign: 'center' }}>上一个</span>
|
|
|
+ </div>
|
|
|
|
|
|
- <div
|
|
|
- class={[
|
|
|
- styles.fullBtn,
|
|
|
- popupData.activeIndex == data.itemList.length - 1 &&
|
|
|
- styles.btnsDisabled
|
|
|
- ]}
|
|
|
- onClick={() => handlePreAndNext('down')}>
|
|
|
- <span style={{ textAlign: 'center' }}>下一个</span>
|
|
|
- <img src={iconDown} />
|
|
|
+ <div
|
|
|
+ class={[
|
|
|
+ styles.fullBtn,
|
|
|
+ popupData.activeIndex == data.itemList.length - 1 &&
|
|
|
+ styles.btnsDisabled
|
|
|
+ ]}
|
|
|
+ onClick={() => handlePreAndNext('down')}>
|
|
|
+ <span style={{ textAlign: 'center' }}>下一个</span>
|
|
|
+ <img src={iconDown} />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- )}
|
|
|
- </Transition>
|
|
|
+ )}
|
|
|
+ </Transition>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ )}
|
|
|
|
|
|
<div
|
|
|
style={{ transform: activeData.model ? '' : 'translateY(-100%)' }}
|
|
@@ -584,6 +587,7 @@ export default defineComponent({
|
|
|
active={activeData.lessonCoursewareDetailId as any}
|
|
|
onHandleSelect={async (item: any) => {
|
|
|
console.log(item, 'item');
|
|
|
+ loadingClass.value = true;
|
|
|
activeData.coursewareDetailKnowledgeId = item.itemActive;
|
|
|
activeData.lessonCoursewareDetailId = item.tabActive;
|
|
|
await getDetail();
|
|
@@ -591,6 +595,7 @@ export default defineComponent({
|
|
|
popupData.itemActive = item.itemActive;
|
|
|
popupData.itemName = item.itemName;
|
|
|
popupData.chapterOpen = false;
|
|
|
+ loadingClass.value = false;
|
|
|
}}
|
|
|
/>
|
|
|
</Popup>
|