|
@@ -23,14 +23,15 @@ import {
|
|
|
listenerMessage
|
|
|
} from '@/helpers/native-message'
|
|
|
import MusicScore from './component/musicScore'
|
|
|
-import iconDian from './image/icon-dian.svg'
|
|
|
-import iconPoint from './image/icon-point.svg'
|
|
|
+// import iconDian from './image/icon-dian.svg'
|
|
|
+// import iconPoint from './image/icon-point.svg'
|
|
|
import { state as baseState } from '@/state'
|
|
|
import {
|
|
|
iconUp,
|
|
|
iconDown,
|
|
|
// iconPen,
|
|
|
iconTouping,
|
|
|
+ iconCourseType,
|
|
|
iconMenu
|
|
|
} from './image/icons.json'
|
|
|
import Points from './component/points'
|
|
@@ -46,6 +47,11 @@ import Pen from './component/tools/pen'
|
|
|
// import VideoItem from './component/video-item';
|
|
|
import VideoPlay from './component/video-play'
|
|
|
import { musicBuy } from '../music'
|
|
|
+import { penShow, whitePenShow } from '@/components/globalTools/globalTools'
|
|
|
+import CoursewareTips from './component/courseware-tips'
|
|
|
+import GlobalTools from '@/components/globalTools'
|
|
|
+import CoursewareType from './component/courseware-type'
|
|
|
+import { useNetwork } from '@vueuse/core'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'CoursewarePlay',
|
|
@@ -54,6 +60,7 @@ export default defineComponent({
|
|
|
baseState.platformType === 'STUDENT' ? '/api-student' : '/api-teacher'
|
|
|
)
|
|
|
const pageVisibility = usePageVisibility()
|
|
|
+ const { isOnline } = useNetwork()
|
|
|
/** 页面显示和隐藏 */
|
|
|
watch(
|
|
|
() => pageVisibility.value,
|
|
@@ -63,24 +70,33 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
+ // 白板的批注打开时暂停播放
|
|
|
+ watch(
|
|
|
+ () => [whitePenShow.value, penShow.value],
|
|
|
+ () => {
|
|
|
+ if (whitePenShow.value || penShow.value) {
|
|
|
+ handleStop()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
/** 设置播放容器 16:9 */
|
|
|
const parentContainer = reactive({
|
|
|
width: '100vw'
|
|
|
})
|
|
|
- const setContainer = () => {
|
|
|
- const min = Math.min(screen.width, screen.height)
|
|
|
- const max = Math.max(screen.width, screen.height)
|
|
|
- const width = min * (16 / 9)
|
|
|
- if (width > max) {
|
|
|
- parentContainer.width = '100vw'
|
|
|
- return
|
|
|
- } else {
|
|
|
- parentContainer.width = width + 'px'
|
|
|
- }
|
|
|
- }
|
|
|
+ // const setContainer = () => {
|
|
|
+ // const min = Math.min(screen.width, screen.height)
|
|
|
+ // const max = Math.max(screen.width, screen.height)
|
|
|
+ // const width = min * (16 / 9)
|
|
|
+ // if (width > max) {
|
|
|
+ // parentContainer.width = '100vw'
|
|
|
+ // return
|
|
|
+ // } else {
|
|
|
+ // parentContainer.width = width + 'px'
|
|
|
+ // }
|
|
|
+ // }
|
|
|
const handleInit = (type = 0) => {
|
|
|
//设置容器16:9
|
|
|
- setContainer()
|
|
|
+ // setContainer()
|
|
|
// 横屏
|
|
|
postMessage(
|
|
|
{
|
|
@@ -124,6 +140,7 @@ export default defineComponent({
|
|
|
const route = useRoute()
|
|
|
const headeRef = ref()
|
|
|
const data = reactive({
|
|
|
+ currentId: route.query.id as any,
|
|
|
detail: null as any,
|
|
|
knowledgePointList: [] as any,
|
|
|
itemList: [] as any,
|
|
@@ -131,7 +148,7 @@ export default defineComponent({
|
|
|
isCourse: false,
|
|
|
isRecordPlay: false,
|
|
|
videoRefs: {},
|
|
|
-
|
|
|
+ refLevelList: [] as any,
|
|
|
videoState: 'init' as 'init' | 'play',
|
|
|
videoItemRef: null as any,
|
|
|
animationState: 'start' as 'start' | 'end',
|
|
@@ -287,11 +304,11 @@ export default defineComponent({
|
|
|
}, 500)
|
|
|
})
|
|
|
}
|
|
|
- const getDetail = async () => {
|
|
|
+ const getDetail = async (id?: any) => {
|
|
|
try {
|
|
|
const res: any = await request.get(
|
|
|
apiSuffix.value +
|
|
|
- `/tenantAlbumMusic/getLessonCourseDetail/${route.query.id}`,
|
|
|
+ `/tenantAlbumMusic/getLessonCourseDetail/${id || route.query.id}`,
|
|
|
{
|
|
|
hideLoading: true
|
|
|
}
|
|
@@ -366,11 +383,24 @@ export default defineComponent({
|
|
|
console.log(data.knowledgePointList, 'data.knowledgePointList')
|
|
|
getItemList()
|
|
|
}
|
|
|
+ return true
|
|
|
} catch (error) {
|
|
|
console.log(error)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ const onTitleTip = (type: "phaseGoals" | "checkItem", text: string) => {
|
|
|
+ handleStop()
|
|
|
+ popupData.pointOpen = true
|
|
|
+ popupData.pointContent = text
|
|
|
+ if(type === "checkItem") {
|
|
|
+ popupData.pointTitle = '检查事项'
|
|
|
+ } else if(type === "phaseGoals") {
|
|
|
+ popupData.pointTitle = '阶段目标'
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// ifram事件处理
|
|
|
const iframeHandle = (ev: MessageEvent) => {
|
|
|
console.log('headerTogge', ev)
|
|
@@ -459,27 +489,24 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ const getRefLevel = async (id?: any) => {
|
|
|
+ try {
|
|
|
+ const res = await request.post(apiSuffix.value + '/tenantAlbumMusic/refLevel', {
|
|
|
+ data: {
|
|
|
+ lessonCoursewareDetailId: id || route.query.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ data.refLevelList = res.data || []
|
|
|
+ return true
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
await sysParamConfig()
|
|
|
+ await getRefLevel()
|
|
|
await getDetail()
|
|
|
- // const hasFree = String(data.detail?.accessScope) === '0'
|
|
|
- // if (!hasFree) {
|
|
|
- // if (state.platformType === 'STUDENT') {
|
|
|
- // const hasVip = handleCheckVip()
|
|
|
- // if (!hasVip) {
|
|
|
- // nextTick(() => {
|
|
|
- // postMessage({
|
|
|
- // api: 'courseLoading',
|
|
|
- // content: {
|
|
|
- // show: false,
|
|
|
- // type: 'fullscreen'
|
|
|
- // }
|
|
|
- // })
|
|
|
- // })
|
|
|
- // return
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
// getCourseSchedule();
|
|
|
window.addEventListener('message', iframeHandle)
|
|
|
|
|
@@ -522,6 +549,10 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
const popupData = reactive({
|
|
|
+ pointOpen: false,
|
|
|
+ pointContent: "",
|
|
|
+ pointTitle: "",
|
|
|
+ coursewareOpen: false,
|
|
|
open: false,
|
|
|
activeIndex: 0,
|
|
|
playIndex: 0,
|
|
@@ -840,25 +871,6 @@ export default defineComponent({
|
|
|
}
|
|
|
class={styles.itemDiv}
|
|
|
>
|
|
|
- {/* <VideoItem
|
|
|
- ref={(el: any) => (data.videoItemRef = el)}
|
|
|
- item={activeVideoItem.value}
|
|
|
- activeModel={activeData.model}
|
|
|
- onClose={setModelOpen}
|
|
|
- onPlay={() => {
|
|
|
- data.videoState = 'play';
|
|
|
- }}
|
|
|
- onPause={() => {
|
|
|
- clearTimeout(activeData.timer);
|
|
|
- activeData.model = true;
|
|
|
- }}
|
|
|
- onEnded={() => {
|
|
|
- const _index = popupData.activeIndex + 1;
|
|
|
- if (_index < data.itemList.length) {
|
|
|
- handleSwipeChange(_index);
|
|
|
- }
|
|
|
- }}
|
|
|
- /> */}
|
|
|
<VideoPlay
|
|
|
ref={(el: any) => (data.videoItemRef = el)}
|
|
|
item={activeVideoItem.value}
|
|
@@ -866,6 +878,9 @@ export default defineComponent({
|
|
|
onPlay={() => {
|
|
|
data.videoState = 'play'
|
|
|
data.animationState = 'end'
|
|
|
+ if(whitePenShow.value || penShow.value || popupData.coursewareOpen || popupData.open || popupData.guideOpen || popupData.pointOpen) {
|
|
|
+ handleStop()
|
|
|
+ }
|
|
|
}}
|
|
|
onLoadedmetadata={(videoItem: any) => {
|
|
|
data.videoState = 'play'
|
|
@@ -914,52 +929,6 @@ export default defineComponent({
|
|
|
: {}
|
|
|
}
|
|
|
>
|
|
|
- {/* {m.type === 'VIDEO' && (
|
|
|
- <>
|
|
|
- <VideoPlay
|
|
|
- ref={(v: any) => (data.videoRefs[mIndex] = v)}
|
|
|
- item={m}
|
|
|
- isActive={activeEle}
|
|
|
- isEmtry={isEmtry}
|
|
|
- onPrepare={(val) => {
|
|
|
- m.isprepare = val
|
|
|
- }}
|
|
|
- onLoadedmetadata={(videoItem: any) => {
|
|
|
- m.videoEle = videoItem
|
|
|
- }}
|
|
|
- onTogglePlay={(paused: boolean) => {
|
|
|
- // console.log('播放切换', paused)
|
|
|
- if (!m.isprepare) {
|
|
|
- m.isprepare = true
|
|
|
- }
|
|
|
- m.autoPlay = false
|
|
|
- if (paused || popupData.open || popupData.guideOpen) {
|
|
|
- clearTimeout(activeData.timer)
|
|
|
- } else {
|
|
|
- setModelOpen()
|
|
|
- }
|
|
|
- }}
|
|
|
- onEnded={() => {
|
|
|
- const _index = popupData.activeIndex + 1
|
|
|
- if (_index < data.itemList.length) {
|
|
|
- handleSwipeChange(_index)
|
|
|
- }
|
|
|
- }}
|
|
|
- onReset={() => {
|
|
|
- if (!m.videoEle?.paused) {
|
|
|
- setModelOpen()
|
|
|
- }
|
|
|
- }}
|
|
|
- />
|
|
|
- <Transition name="van-fade">
|
|
|
- {!m.isprepare && (
|
|
|
- <div class={styles.loadWrap}>
|
|
|
- <Vue3Lottie animationData={playLoadData}></Vue3Lottie>
|
|
|
- </div>
|
|
|
- )}
|
|
|
- </Transition>
|
|
|
- </>
|
|
|
- )} */}
|
|
|
<Transition name="van-fade">
|
|
|
{m.typeCode === 'VIDEO' &&
|
|
|
data.animationState !== 'end' &&
|
|
@@ -1007,7 +976,7 @@ export default defineComponent({
|
|
|
)
|
|
|
})}
|
|
|
</div>
|
|
|
- <Transition name="right">
|
|
|
+ {/* <Transition name="right">
|
|
|
{activeData.model && (
|
|
|
<div
|
|
|
class={styles.rightFixedBtns}
|
|
@@ -1027,13 +996,6 @@ export default defineComponent({
|
|
|
</div>
|
|
|
|
|
|
<div class={[styles.btnsWrap, styles.btnsBottom]}>
|
|
|
- {/* <div
|
|
|
- class={styles.fullBtn}
|
|
|
- onClick={() => (popupData.guideOpen = true)}
|
|
|
- >
|
|
|
- <img src={iconTouping} />
|
|
|
- <span>投屏</span>
|
|
|
- </div> */}
|
|
|
{data.isCourse && (
|
|
|
<>
|
|
|
<div
|
|
@@ -1055,7 +1017,7 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</div>
|
|
|
)}
|
|
|
- </Transition>
|
|
|
+ </Transition> */}
|
|
|
|
|
|
<Transition name="left">
|
|
|
{activeData.model && (
|
|
@@ -1063,48 +1025,84 @@ export default defineComponent({
|
|
|
class={styles.leftFixedBtns}
|
|
|
onClick={(e: Event) => e.stopPropagation()}
|
|
|
>
|
|
|
- {popupData.activeIndex != 0 && (
|
|
|
- <div class={[styles.btnsWrap, styles.prePoint]}>
|
|
|
+
|
|
|
+ <div class={[styles.btnsWrap, styles.prePoint]}>
|
|
|
+ <div class={styles.fullBtn} onClick={() => {
|
|
|
+ handleStop()
|
|
|
+ popupData.coursewareOpen = true
|
|
|
+ }}>
|
|
|
+ <img src={iconCourseType} />
|
|
|
+ </div>
|
|
|
+ <div class={styles.fullBtn} onClick={() => {
|
|
|
+ handleStop()
|
|
|
+ popupData.open = true
|
|
|
+ }}>
|
|
|
+ <img src={iconMenu} />
|
|
|
+ {/* <span>知识点</span> */}
|
|
|
+ </div>
|
|
|
+
|
|
|
<div
|
|
|
- class={styles.fullBtn}
|
|
|
+ class={[styles.fullBtn, !(popupData.activeIndex != 0) && styles.disabled]}
|
|
|
onClick={() => {
|
|
|
- // useThrottleFn(() => {
|
|
|
- // handlePreAndNext('up')
|
|
|
- // }, 300)
|
|
|
- // onChangeSwiper('up')
|
|
|
- handlePreAndNext('up')
|
|
|
+ if(popupData.activeIndex != 0) handlePreAndNext('up')
|
|
|
}}
|
|
|
>
|
|
|
<img src={iconUp} />
|
|
|
- <span style={{ textAlign: 'center' }}>上一个</span>
|
|
|
+ {/* <span style={{ textAlign: 'center' }}>上一个</span> */}
|
|
|
</div>
|
|
|
- </div>
|
|
|
- )}
|
|
|
- {popupData.activeIndex != data.itemList.length - 1 && (
|
|
|
- <div class={styles.btnsWrap}>
|
|
|
<div
|
|
|
- class={styles.fullBtn}
|
|
|
+ class={[styles.fullBtn, !(popupData.activeIndex != data.itemList.length - 1) && styles.disabled]}
|
|
|
onClick={() => {
|
|
|
- // console.log('click down')
|
|
|
- // useThrottleFn(() => {
|
|
|
- // console.log('click down pass')
|
|
|
- // handlePreAndNext('down')
|
|
|
- // }, 300)
|
|
|
- // onChangeSwiper('down')
|
|
|
- handlePreAndNext('down')
|
|
|
+ if(popupData.activeIndex != data.itemList.length - 1) handlePreAndNext('down')
|
|
|
}}
|
|
|
>
|
|
|
- <span style={{ textAlign: 'center' }}>下一个</span>
|
|
|
+ {/* <span style={{ textAlign: 'center' }}>下一个</span> */}
|
|
|
<img src={iconDown} />
|
|
|
</div>
|
|
|
- </div>
|
|
|
- )}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
)}
|
|
|
</Transition>
|
|
|
</div>
|
|
|
|
|
|
+
|
|
|
<div
|
|
|
+ style={{ transform: activeData.model ? '' : 'translateY(-100%)' }}
|
|
|
+ id="coursePlayHeader"
|
|
|
+ class={styles.headerContainer}
|
|
|
+ ref={headeRef}
|
|
|
+ >
|
|
|
+ <div class={styles.backBtn}>
|
|
|
+ <Icon name={iconBack} onClick={() => {
|
|
|
+ goback()
|
|
|
+ }} />
|
|
|
+ <div class={styles.titleSection}>
|
|
|
+ <div class={styles.title}>{popupData.tabName}</div>
|
|
|
+ <div class={styles.titleContent}>
|
|
|
+ <p>{data.itemList[popupData.activeIndex]?.name}</p>
|
|
|
+ {data.detail?.lessonTargetDesc ? <span onClick={() => onTitleTip('phaseGoals', data.detail?.lessonTargetDesc)}>阶段目标</span>: ""}
|
|
|
+ {data.itemList[popupData.activeIndex]?.checkItem ? <span onClick={() => onTitleTip('checkItem', data.itemList[popupData.activeIndex]?.checkItem)}>检查事项</span> : ""}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ {state.platformType === 'TEACHER' && (
|
|
|
+ <div
|
|
|
+ class={styles.headRight}
|
|
|
+ onClick={(e: Event) => {
|
|
|
+ e.stopPropagation()
|
|
|
+ clearTimeout(activeData.timer)
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <div class={styles.rightBtn} onClick={() => {
|
|
|
+ handleStop()
|
|
|
+ popupData.guideOpen = true
|
|
|
+ }}>
|
|
|
+ <img src={iconTouping} />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ {/* <div
|
|
|
style={{ transform: activeData.model ? '' : 'translateY(-100%)' }}
|
|
|
id="coursePlayHeader"
|
|
|
class={styles.headerContainer}
|
|
@@ -1112,11 +1110,7 @@ export default defineComponent({
|
|
|
>
|
|
|
<div class={styles.backBtn} onClick={() => goback()}>
|
|
|
<Icon name={iconBack} />
|
|
|
- 返回
|
|
|
</div>
|
|
|
- {data.isCourse && (
|
|
|
- <PlayRecordTime ref={playRef} list={data.knowledgePointList} />
|
|
|
- )}
|
|
|
<div
|
|
|
class={styles.menu}
|
|
|
onClick={() => {
|
|
@@ -1129,37 +1123,8 @@ export default defineComponent({
|
|
|
{popupData.tabName}
|
|
|
</div>
|
|
|
|
|
|
- {state.platformType === 'TEACHER' && (
|
|
|
- <div
|
|
|
- class={styles.headRight}
|
|
|
- onClick={(e: Event) => {
|
|
|
- e.stopPropagation()
|
|
|
- clearTimeout(activeData.timer)
|
|
|
- }}
|
|
|
- >
|
|
|
- {/* <div
|
|
|
- class={styles.rightBtn}
|
|
|
- onClick={() => (popupData.guideOpen = true)}
|
|
|
- >
|
|
|
- <img src={iconTouping} />
|
|
|
- </div> */}
|
|
|
- {/* <div
|
|
|
- class={styles.rightBtn}
|
|
|
- onClick={() => {
|
|
|
- openStudyTool({
|
|
|
- type: 'pen',
|
|
|
- icon: iconPen,
|
|
|
- name: '批注'
|
|
|
- });
|
|
|
- }}>
|
|
|
- <img src={iconPen} />
|
|
|
- </div> */}
|
|
|
- {/* <div class={styles.rightBtn} onClick={() => (popupData.toolOpen = true)}>
|
|
|
- <img src={iconMore} />
|
|
|
- </div> */}
|
|
|
- </div>
|
|
|
- )}
|
|
|
- </div>
|
|
|
+
|
|
|
+ </div> */}
|
|
|
|
|
|
{/* 更多弹窗 */}
|
|
|
<Popup
|
|
@@ -1174,8 +1139,7 @@ export default defineComponent({
|
|
|
</Popup>
|
|
|
|
|
|
<Popup
|
|
|
- class={styles.popup}
|
|
|
- style={{ background: 'rgba(0,0,0, 0.7)' }}
|
|
|
+ class={[styles.popup, styles.popupCoursewarePlay]}
|
|
|
overlayClass={styles.overlayClass}
|
|
|
position="right"
|
|
|
round
|
|
@@ -1195,7 +1159,37 @@ export default defineComponent({
|
|
|
</Popup>
|
|
|
|
|
|
<Popup
|
|
|
- class={styles.popup}
|
|
|
+ class={[styles.popup, styles.popupCoursewarePlay]}
|
|
|
+ overlayClass={styles.overlayClass}
|
|
|
+ position="right"
|
|
|
+ round
|
|
|
+ v-model:show={popupData.coursewareOpen}
|
|
|
+ onClose={handleClosePopup}>
|
|
|
+ {/* 课件类型 */}
|
|
|
+ <CoursewareType list={data.refLevelList} onConfirm={async (item: any) => {
|
|
|
+ // 判断是否为当前课程类型
|
|
|
+ if(data.currentId === item.id) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ data.currentId = item.id;
|
|
|
+ const n = await getDetail(item.id);
|
|
|
+ const s = await getRefLevel(item.id);
|
|
|
+ if(n && s) {
|
|
|
+ popupData.coursewareOpen = false;
|
|
|
+ popupData.activeIndex = 0;
|
|
|
+ nextTick(() => {
|
|
|
+ popupData.open = true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ if(!isOnline.value) {
|
|
|
+ Toast('网络异常')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }} />
|
|
|
+ </Popup>
|
|
|
+
|
|
|
+ <Popup
|
|
|
+ class={[styles.popup, styles.popupCoursewarePlay]}
|
|
|
overlayClass={styles.overlayClass}
|
|
|
position="right"
|
|
|
round
|
|
@@ -1205,9 +1199,18 @@ export default defineComponent({
|
|
|
<OGuide />
|
|
|
</Popup>
|
|
|
|
|
|
- {studyData.penShow && (
|
|
|
- <Pen show={studyData.type === 'pen'} close={() => closeStudyTool()} />
|
|
|
- )}
|
|
|
+ <Popup
|
|
|
+ class={[styles.popup, styles.popupPoint]}
|
|
|
+ round
|
|
|
+ style={{ background: 'transparent !important' }}
|
|
|
+ v-model:show={popupData.pointOpen}
|
|
|
+ onClose={handleClosePopup}>
|
|
|
+ <CoursewareTips onClose={() => {
|
|
|
+ popupData.pointOpen = false
|
|
|
+ }} content={popupData.pointContent} titleName={popupData.pointTitle} />
|
|
|
+ </Popup>
|
|
|
+
|
|
|
+ <GlobalTools />
|
|
|
</div>
|
|
|
)
|
|
|
}
|