|
@@ -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,11 @@ 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'
|
|
|
+
|
|
|
+const DEV = import.meta.env.DEV
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'CoursewarePlay',
|
|
@@ -152,6 +154,7 @@ export default defineComponent({
|
|
|
videoRefs: {}
|
|
|
})
|
|
|
const activeData = reactive({
|
|
|
+ isAutoPlay: !DEV, // 是否自动播放
|
|
|
nowTime: 0,
|
|
|
model: true, // 遮罩
|
|
|
isAnimation: true, // 是否动画
|
|
@@ -226,7 +229,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
|
|
@@ -390,7 +397,8 @@ export default defineComponent({
|
|
|
tabName: '',
|
|
|
itemActive: '',
|
|
|
itemName: '',
|
|
|
- guideOpen: false
|
|
|
+ guideOpen: false,
|
|
|
+ toolOpen: false, // 工具弹窗控制
|
|
|
})
|
|
|
|
|
|
/**停止所有的播放 */
|
|
@@ -423,6 +431,13 @@ 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 gotoRollCall = (pageTag: string) => {
|
|
@@ -594,6 +609,34 @@ 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) => {
|
|
|
+ handleStop()
|
|
|
+ clearModel()
|
|
|
+ popupData.toolOpen = false
|
|
|
+ studyData.type = item.type
|
|
|
+
|
|
|
+ switch(item.type){
|
|
|
+ case 'pen':
|
|
|
+ studyData.penShow = true
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return () => (
|
|
|
<div class={styles.playContent}>
|
|
|
<div
|
|
@@ -783,6 +826,7 @@ export default defineComponent({
|
|
|
<Icon name={iconBack} />
|
|
|
返回
|
|
|
</div>
|
|
|
+ {data.isCourse && <PlayRecordTime ref={playRef} list={data.knowledgePointList} />}
|
|
|
<div
|
|
|
class={styles.menu}
|
|
|
onClick={() => {
|
|
@@ -793,21 +837,36 @@ export default defineComponent({
|
|
|
>
|
|
|
{popupData.tabName}
|
|
|
</div>
|
|
|
- {data.isCourse && <PlayRecordTime ref={playRef} list={data.knowledgePointList} />}
|
|
|
+
|
|
|
+ <div class={styles.headRight}>
|
|
|
+ <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 +885,12 @@ 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={() => studyData.type = 'init'} />}
|
|
|
</div>
|
|
|
)
|
|
|
}
|