|
@@ -34,12 +34,9 @@ import iconMenu from './image/icon-menu.svg'
|
|
|
import iconDian from './image/icon-dian.svg'
|
|
|
import iconTouping from './image/icon-touping.svg'
|
|
|
import iconPoint from './image/icon-point.svg'
|
|
|
-import iconLoop from './image/icon-loop.svg'
|
|
|
-import iconLoopActive from './image/icon-loop-active.svg'
|
|
|
-import iconplay from './image/icon-play.svg'
|
|
|
-import iconpause from './image/icon-pause.svg'
|
|
|
import iconUp from './image/icon-up.svg'
|
|
|
import iconDown from './image/icon-down.svg'
|
|
|
+import iconMore from './image/icon-more.png'
|
|
|
import Points from './component/points'
|
|
|
import { browser, getSecondRPM } from '@/helpers/utils'
|
|
|
import { Vue3Lottie } from 'vue3-lottie'
|
|
@@ -63,6 +60,9 @@ import 'swiper/less/effect-flip'
|
|
|
import 'swiper/less/effect-creative'
|
|
|
import { handleCheckVip } from '../hook/useFee'
|
|
|
import OGuide from '@/components/o-guide'
|
|
|
+import Tool, { ToolItem, ToolType } from './component/tool'
|
|
|
+import Tools from './component/tools/pen'
|
|
|
+import Pen from './component/tools/pen'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'CoursewarePlay',
|
|
@@ -152,6 +152,7 @@ export default defineComponent({
|
|
|
videoRefs: {}
|
|
|
})
|
|
|
const activeData = reactive({
|
|
|
+ isAutoPlay: true, // 是否自动播放
|
|
|
nowTime: 0,
|
|
|
model: true, // 遮罩
|
|
|
isAnimation: true, // 是否动画
|
|
@@ -226,7 +227,11 @@ export default defineComponent({
|
|
|
let _firstIndex = list.findIndex((n: any) => n.materialId == route.query.kId)
|
|
|
_firstIndex = _firstIndex > -1 ? _firstIndex : 0
|
|
|
const item = list[_firstIndex]
|
|
|
- item.autoPlay = true
|
|
|
+
|
|
|
+ // 是否自动播放
|
|
|
+ if (activeData.isAutoPlay) {
|
|
|
+ item.autoPlay = true
|
|
|
+ }
|
|
|
popupData.activeIndex = _firstIndex
|
|
|
popupData.tabName = item.tabName
|
|
|
popupData.tabActive = item.knowledgePointId
|
|
@@ -265,7 +270,7 @@ export default defineComponent({
|
|
|
})
|
|
|
showDialog({
|
|
|
title: '温馨提示',
|
|
|
- message: '课件已锁定',
|
|
|
+ message: '课件已锁定'
|
|
|
}).then((value) => {
|
|
|
goback()
|
|
|
})
|
|
@@ -390,7 +395,8 @@ export default defineComponent({
|
|
|
tabName: '',
|
|
|
itemActive: '',
|
|
|
itemName: '',
|
|
|
- guideOpen: false
|
|
|
+ guideOpen: false,
|
|
|
+ toolOpen: false // 工具弹窗控制
|
|
|
})
|
|
|
|
|
|
/**停止所有的播放 */
|
|
@@ -423,6 +429,17 @@ export default defineComponent({
|
|
|
Object.values(data.videoRefs).map((n: any) => n.toggleHideControl(false))
|
|
|
}, 4000)
|
|
|
}
|
|
|
+ /** 立即收起所有的模态框 */
|
|
|
+ const clearModel = () => {
|
|
|
+ clearTimeout(activeData.timer)
|
|
|
+ closeToast()
|
|
|
+ activeData.model = false
|
|
|
+ Object.values(data.videoRefs).map((n: any) => n.toggleHideControl(false))
|
|
|
+ }
|
|
|
+ const toggleModel = (type: boolean = true) => {
|
|
|
+ activeData.model = type
|
|
|
+ Object.values(data.videoRefs).map((n: any) => n.toggleHideControl(type))
|
|
|
+ }
|
|
|
|
|
|
// 去点名,签退
|
|
|
const gotoRollCall = (pageTag: string) => {
|
|
@@ -594,8 +611,49 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /** 弹窗关闭 */
|
|
|
+ const handleClosePopup = () => {
|
|
|
+ const item = data.itemList[popupData.activeIndex]
|
|
|
+ if (item?.type == 'VIDEO' && !item.videoEle?.paused) {
|
|
|
+ setModelOpen()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 教学数据 */
|
|
|
+ const studyData = reactive({
|
|
|
+ type: '' as ToolType,
|
|
|
+ penShow: false
|
|
|
+ })
|
|
|
+
|
|
|
+ /** 打开教学工具 */
|
|
|
+ const openStudyTool = (item: ToolItem) => {
|
|
|
+ const activeItem = data.itemList[popupData.activeIndex]
|
|
|
+ // 暂停视频和曲谱的播放
|
|
|
+ if (activeItem.type === 'VIDEO' && activeItem.videoEle) {
|
|
|
+ activeItem.videoEle.pause()
|
|
|
+ }
|
|
|
+ if (activeItem.type === 'SONG') {
|
|
|
+ activeItem.iframeRef?.contentWindow?.postMessage({ api: 'setPlayState' }, '*')
|
|
|
+ }
|
|
|
+ clearModel()
|
|
|
+ popupData.toolOpen = false
|
|
|
+ studyData.type = item.type
|
|
|
+
|
|
|
+ switch (item.type) {
|
|
|
+ case 'pen':
|
|
|
+ studyData.penShow = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 关闭教学工具 */
|
|
|
+ const closeStudyTool = () => {
|
|
|
+ studyData.type = 'init'
|
|
|
+ toggleModel()
|
|
|
+ }
|
|
|
+
|
|
|
return () => (
|
|
|
- <div class={styles.playContent}>
|
|
|
+ <div id="playContent" class={styles.playContent}>
|
|
|
<div
|
|
|
onClick={() => {
|
|
|
clearTimeout(activeData.timer)
|
|
@@ -724,10 +782,10 @@ export default defineComponent({
|
|
|
</div>
|
|
|
|
|
|
<div class={[styles.btnsWrap, styles.btnsBottom]}>
|
|
|
- <div class={styles.fullBtn} onClick={() => (popupData.guideOpen = true)}>
|
|
|
+ {/* <div class={styles.fullBtn} onClick={() => (popupData.guideOpen = true)}>
|
|
|
<img src={iconTouping} />
|
|
|
<span>投屏</span>
|
|
|
- </div>
|
|
|
+ </div> */}
|
|
|
{data.isCourse && (
|
|
|
<>
|
|
|
<div
|
|
@@ -783,6 +841,7 @@ export default defineComponent({
|
|
|
<Icon name={iconBack} />
|
|
|
返回
|
|
|
</div>
|
|
|
+ {data.isCourse && <PlayRecordTime ref={playRef} list={data.knowledgePointList} />}
|
|
|
<div
|
|
|
class={styles.menu}
|
|
|
onClick={() => {
|
|
@@ -793,21 +852,44 @@ export default defineComponent({
|
|
|
>
|
|
|
{popupData.tabName}
|
|
|
</div>
|
|
|
- {data.isCourse && <PlayRecordTime ref={playRef} list={data.knowledgePointList} />}
|
|
|
+
|
|
|
+ {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={() => (popupData.toolOpen = true)}>
|
|
|
+ <img src={iconMore} />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
</div>
|
|
|
|
|
|
+ {/* 更多弹窗 */}
|
|
|
+ <Popup
|
|
|
+ class={styles.popupMore}
|
|
|
+ overlayClass={styles.overlayClass}
|
|
|
+ position="right"
|
|
|
+ round
|
|
|
+ v-model:show={popupData.toolOpen}
|
|
|
+ onClose={handleClosePopup}
|
|
|
+ >
|
|
|
+ <Tool onHandleTool={openStudyTool} />
|
|
|
+ </Popup>
|
|
|
+
|
|
|
<Popup
|
|
|
class={styles.popup}
|
|
|
overlayClass={styles.overlayClass}
|
|
|
position="right"
|
|
|
round
|
|
|
v-model:show={popupData.open}
|
|
|
- onClose={() => {
|
|
|
- const item = data.itemList[popupData.activeIndex]
|
|
|
- if (item?.type == 'VIDEO' && !item.videoEle?.paused) {
|
|
|
- setModelOpen()
|
|
|
- }
|
|
|
- }}
|
|
|
+ onClose={handleClosePopup}
|
|
|
>
|
|
|
<Points
|
|
|
data={data.knowledgePointList}
|
|
@@ -826,15 +908,14 @@ export default defineComponent({
|
|
|
position="right"
|
|
|
round
|
|
|
v-model:show={popupData.guideOpen}
|
|
|
- onClose={() => {
|
|
|
- const item = data.itemList[popupData.activeIndex]
|
|
|
- if (item?.type == 'VIDEO' && !item.videoEle?.paused) {
|
|
|
- setModelOpen()
|
|
|
- }
|
|
|
- }}
|
|
|
+ onClose={handleClosePopup}
|
|
|
>
|
|
|
<OGuide />
|
|
|
</Popup>
|
|
|
+
|
|
|
+ {studyData.penShow && (
|
|
|
+ <Pen show={studyData.type === 'pen'} close={() => closeStudyTool()} />
|
|
|
+ )}
|
|
|
</div>
|
|
|
)
|
|
|
}
|