|
@@ -9,7 +9,8 @@ import {
|
|
|
watch,
|
|
|
Transition,
|
|
|
computed,
|
|
|
- onBeforeUnmount
|
|
|
+ onBeforeUnmount,
|
|
|
+ shallowRef
|
|
|
} from 'vue'
|
|
|
import iconBack from './image/back.png'
|
|
|
import styles from './index.module.less'
|
|
@@ -40,6 +41,7 @@ import VideoPlay from './component/video-play'
|
|
|
import CoursewareType from './component/courseware-type'
|
|
|
import CoursewareTips from './component/courseware-tips'
|
|
|
import GlobalTools from '@/components/globalTools'
|
|
|
+import { isPlay, penShow, toolOpen, whitePenShow } from '@/components/globalTools/globalTools'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'CoursewarePlay',
|
|
@@ -115,6 +117,7 @@ export default defineComponent({
|
|
|
|
|
|
const route = useRoute()
|
|
|
const headeRef = ref()
|
|
|
+ const isCurrentCoursewareMenu = shallowRef(true) // 是否为当前选的课程类型
|
|
|
const data = reactive({
|
|
|
currentId: route.query.id as any,
|
|
|
detail: null as any,
|
|
@@ -466,7 +469,7 @@ export default defineComponent({
|
|
|
|
|
|
const getRefLevel = async (id?: any) => {
|
|
|
try {
|
|
|
- const res = await request.post(state.platformApi + '/tenantAlbumMusic/refLevel', {
|
|
|
+ const res = await request.post(state.platformApi + '/lessonCoursewareDetail/refLevel', {
|
|
|
data: {
|
|
|
lessonCoursewareDetailId: id || route.query.id
|
|
|
}
|
|
@@ -484,7 +487,10 @@ export default defineComponent({
|
|
|
if (state.platformType === 'STUDENT') {
|
|
|
await getLookVideoData()
|
|
|
}
|
|
|
- await getRefLevel()
|
|
|
+ // 只有老师有 课程类型 切换
|
|
|
+ if(state.platformType === "TEACHER") {
|
|
|
+ await getRefLevel()
|
|
|
+ }
|
|
|
await getDetail()
|
|
|
const hasFree = String(data.detail?.accessScope) === '0'
|
|
|
if (!hasFree) {
|
|
@@ -895,6 +901,28 @@ export default defineComponent({
|
|
|
}
|
|
|
)
|
|
|
|
|
|
+ // 白板的批注打开时暂停播放
|
|
|
+ watch(
|
|
|
+ () => [whitePenShow.value, penShow.value],
|
|
|
+ () => {
|
|
|
+ if (whitePenShow.value || penShow.value) {
|
|
|
+ handleStop()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ // 是否收起
|
|
|
+ watch(
|
|
|
+ () => activeData.model,
|
|
|
+ () => {
|
|
|
+ if (activeData.model) {
|
|
|
+ isPlay.value = false
|
|
|
+ } else {
|
|
|
+ isPlay.value = true
|
|
|
+ toolOpen.value = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
/**
|
|
|
* 初始化视频时长
|
|
|
* @param newVal 播放状态
|
|
@@ -1017,6 +1045,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'
|
|
@@ -1027,7 +1058,7 @@ export default defineComponent({
|
|
|
}}
|
|
|
onPause={() => {
|
|
|
clearTimeout(activeData.timer)
|
|
|
- activeData.model = true
|
|
|
+ // activeData.model = true
|
|
|
videoIntervalRef.pause()
|
|
|
}}
|
|
|
onSeeked={() => {
|
|
@@ -1169,7 +1200,7 @@ export default defineComponent({
|
|
|
{activeData.model && (
|
|
|
<div class={styles.leftFixedBtns} onClick={(e: Event) => e.stopPropagation()}>
|
|
|
<div class={[styles.btnsWrap, styles.prePoint]}>
|
|
|
- <div class={styles.fullBtn} onClick={() => (popupData.open = true)}>
|
|
|
+ <div class={styles.fullBtn} onClick={() => (popupData.coursewareOpen = true)}>
|
|
|
<img src={iconCourseType} />
|
|
|
</div>
|
|
|
<div class={styles.fullBtn} onClick={() => (popupData.open = true)}>
|
|
@@ -1206,24 +1237,18 @@ export default defineComponent({
|
|
|
class={styles.headerContainer}
|
|
|
ref={headeRef}
|
|
|
>
|
|
|
- <div class={styles.backBtn} onClick={() => goback()}>
|
|
|
- <Icon name={iconBack} />
|
|
|
+ <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>第3条练习6-15小节-演奏-练习</p>
|
|
|
- <span>阶段目标</span>
|
|
|
- <span>检查事项</span>
|
|
|
- </div> */}
|
|
|
- <div class={styles.title}>{popupData.tabName}</div>
|
|
|
+ <div class={styles.title} onClick={() => goback()}>{popupData.tabName}</div>
|
|
|
<div class={styles.titleContent}>
|
|
|
- <p>{data.itemList[popupData.activeIndex]?.name}</p>
|
|
|
+ <p onClick={() => goback()}>{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>
|
|
|
- {data.isCourse && <PlayRecordTime ref={playRef} list={data.knowledgePointList} />}
|
|
|
+ {data.isCourse && <PlayRecordTime ref={playRef} isCurrentCoursewareMenu={isCurrentCoursewareMenu.value} list={data.knowledgePointList} />}
|
|
|
{/* <div
|
|
|
class={styles.menu}
|
|
|
onClick={() => {
|
|
@@ -1235,7 +1260,7 @@ export default defineComponent({
|
|
|
{popupData.tabName}
|
|
|
</div> */}
|
|
|
|
|
|
- {state.platformType !== 'TEACHER' && (
|
|
|
+ {state.platformType === 'TEACHER' && (
|
|
|
<div
|
|
|
class={styles.headRight}
|
|
|
onClick={(e: Event) => {
|
|
@@ -1279,7 +1304,7 @@ export default defineComponent({
|
|
|
|
|
|
{/* 更多弹窗 */}
|
|
|
<Popup
|
|
|
- class={styles.popupMore}
|
|
|
+ class={[styles.popupMore, styles.popupCoursewarePlay]}
|
|
|
overlayClass={styles.overlayClass}
|
|
|
position="right"
|
|
|
round
|
|
@@ -1290,8 +1315,7 @@ export default defineComponent({
|
|
|
</Popup>
|
|
|
|
|
|
<Popup
|
|
|
- class={styles.popup}
|
|
|
- style={{ background: 'rgba(0,0,0, 0.75)' }}
|
|
|
+ class={[styles.popup, styles.popupCoursewarePlay]}
|
|
|
overlayClass={styles.overlayClass}
|
|
|
position="right"
|
|
|
round
|
|
@@ -1323,10 +1347,13 @@ export default defineComponent({
|
|
|
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) {
|
|
|
+ data.currentId = item.id;
|
|
|
+ isCurrentCoursewareMenu.value = item.id === route.query.id ? true : false
|
|
|
popupData.coursewareOpen = false;
|
|
|
popupData.activeIndex = 0;
|
|
|
nextTick(() => {
|