|
@@ -11,6 +11,7 @@
|
|
|
ref="videoPlayDom"
|
|
|
@ended="handleChangeCourseware(1)"
|
|
|
@playbackRate="showController"
|
|
|
+ :autoPlay="videoIsAutoPlay"
|
|
|
:disableEvents="true"
|
|
|
:isShowController="isShowController"
|
|
|
/>
|
|
@@ -22,11 +23,11 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="leftTools posTools">
|
|
|
- <div class="posBtn" @click="drawerMenuShow = true">
|
|
|
+ <div class="posBtn" @click="handleToolClick('menu')">
|
|
|
<img src="@/img/coursewarePlay/menu.png" />
|
|
|
<!-- <div>课程类型</div> -->
|
|
|
</div>
|
|
|
- <div class="posBtn" @click="drawerShow = true">
|
|
|
+ <div class="posBtn" @click="handleToolClick('point')">
|
|
|
<img src="@/img/coursewarePlay/zhishidian.png" />
|
|
|
<!-- <div>知识点</div> -->
|
|
|
</div>
|
|
@@ -90,8 +91,8 @@
|
|
|
<div class="title">{{ activeCourseware?.parentData.name || "" }}</div>
|
|
|
<div class="content">
|
|
|
{{ activeCourseware?.name || "" }}
|
|
|
- <span v-if="!activeCourseware?.phaseGoals" @click="onTitleTip('phaseGoals', activeCourseware?.phaseGoals)">阶段目标</span>
|
|
|
- <span v-if="!activeCourseware?.checkItem" @click="onTitleTip('checkItem', activeCourseware?.checkItem)">检查事项</span>
|
|
|
+ <span v-if="activeCourseware?.phaseGoals" @click="onTitleTip('phaseGoals', activeCourseware?.phaseGoals)">阶段目标</span>
|
|
|
+ <span v-if="activeCourseware?.checkItem" @click="onTitleTip('checkItem', activeCourseware?.checkItem)">检查事项</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -99,6 +100,7 @@
|
|
|
<playRecordTime
|
|
|
v-if="route.query.modeId && coursewareTotalTime && userStoreHook.roles === 'GYT'"
|
|
|
:modeId="route.query.modeId as string"
|
|
|
+ :isCurrentCoursewareMenu="isCurrentCoursewareMenu"
|
|
|
:coursewareTotalTime="coursewareTotalTime"
|
|
|
/>
|
|
|
</div>
|
|
@@ -121,7 +123,7 @@
|
|
|
<el-drawer class="elDrawer elCourseMenu" v-model="drawerMenuShow" :show-close="false">
|
|
|
<template #header="{ close }">
|
|
|
<img class="directory" src="@/img/coursewarePlay/menuActive.png" />
|
|
|
- <div class="tit">课程目录</div>
|
|
|
+ <div class="tit">课程类型</div>
|
|
|
<img class="close" @click="close" src="@/img/coursewarePlay/close.png" />
|
|
|
</template>
|
|
|
<ElScrollbar class="elScrollbar">
|
|
@@ -135,7 +137,7 @@
|
|
|
<script setup lang="ts">
|
|
|
import videoPlay from "./videoPlay"
|
|
|
import { getLessonCourseDetail_gym, getLessonCoursewareDetail_gyt, getLessonCourseDetail_klx } from "@/api/cloudTextbooks.api"
|
|
|
-import { checkWebCourse_gyt, refLevel_gyt } from "@/api/coursewarePlay.api"
|
|
|
+import { checkWebCourse_gyt, refLevel_gym, refLevel_gyt, refLevel_klx } from "@/api/coursewarePlay.api"
|
|
|
import { httpAjaxErrMsg, httpAjaxLoadingErrMsg } from "@/plugin/httpAjax"
|
|
|
import userStore from "@/store/modules/user"
|
|
|
import { useRoute, useRouter } from "vue-router"
|
|
@@ -150,6 +152,9 @@ import { getToken } from "@/libs/auth"
|
|
|
import { URL_TEACH_GYT, URL_TEACH_GYM, URL_TEACH_KLX } from "@/config"
|
|
|
import { handleFullscreen } from "@/libs/fullscreen"
|
|
|
import useCoursewarePlayTip from "./components/useCoursewarePlayTip"
|
|
|
+import useDialogConfirm from "@/hooks/useDialogConfirm"
|
|
|
+import LoadingBar from "@/plugin/loadingBar"
|
|
|
+import { isPlay, penShow, toolOpen, whitePenShow } from "@/businessComponents/globalTools/globalTools"
|
|
|
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
@@ -158,7 +163,8 @@ const userStoreHook = userStore()
|
|
|
const videoPlayDom = ref<InstanceType<typeof videoPlay>>()
|
|
|
const coursewareMenuList = shallowRef<any[]>([]) // 课程类型
|
|
|
const coursewareList = shallowRef<any[]>([]) // 知识点
|
|
|
-const flattenCoursewareList = shallowRef<any[]>([]) // 扁平化coursewareList
|
|
|
+const flattenCoursewareList = ref<any[]>([]) // 扁平化coursewareList
|
|
|
+const isCurrentCoursewareMenu = shallowRef(true) // 是否为当前选的课程类型
|
|
|
// 选中的知识点
|
|
|
const activeCourseware = computed<undefined | Record<string, any>>(() => {
|
|
|
return flattenCoursewareList.value[activeCoursewareIndex.value]
|
|
@@ -183,6 +189,11 @@ const songPlaySrc = computed<string>(() => {
|
|
|
}
|
|
|
return urlObj[userStoreHook.roles!]
|
|
|
})
|
|
|
+// 视频是否自动播放
|
|
|
+const videoIsAutoPlay = computed<boolean>(() => {
|
|
|
+ // 如果为视频且有阶段目前则不自动播放
|
|
|
+ return fileType.value === "VIDEO" && activeCourseware.value?.phaseGoals ? false : true
|
|
|
+})
|
|
|
const activeCoursewareIndex = ref(0)
|
|
|
const drawerShow = ref(false)
|
|
|
const drawerMenuShow = ref(false)
|
|
@@ -191,6 +202,9 @@ const coursewareTotalTime = ref(0)
|
|
|
// 监控播放
|
|
|
watch(activeCourseware, () => {
|
|
|
handleVideoPause()
|
|
|
+ if (activeCourseware.value?.phaseGoals) {
|
|
|
+ onTitleTip("phaseGoals", activeCourseware.value?.phaseGoals)
|
|
|
+ }
|
|
|
fileType.value === "VIDEO" &&
|
|
|
nextTick(() => {
|
|
|
handlePlayVideo({
|
|
@@ -201,14 +215,14 @@ watch(activeCourseware, () => {
|
|
|
showController()
|
|
|
})
|
|
|
getCoursewareList()
|
|
|
-function getCoursewareList() {
|
|
|
+async function getCoursewareList(id?: string) {
|
|
|
// GYM,GYT,KLX 区分 查询接口
|
|
|
const LessonCoursewareDetailApi = {
|
|
|
GYT: getLessonCoursewareDetail_gyt,
|
|
|
GYM: getLessonCourseDetail_gym,
|
|
|
KLX: getLessonCourseDetail_klx
|
|
|
}
|
|
|
- httpAjaxErrMsg(LessonCoursewareDetailApi[userStoreHook.roles!], route.params.id as string).then(res => {
|
|
|
+ await httpAjaxErrMsg(LessonCoursewareDetailApi[userStoreHook.roles!], id || (route.params.id as string)).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
const { lockFlag, knowledgePointList } = res.data || {}
|
|
|
if (lockFlag) {
|
|
@@ -242,48 +256,21 @@ function getCoursewareList() {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-// getCoursewareMenuList()
|
|
|
-function getCoursewareMenuList() {
|
|
|
+getCoursewareMenuList()
|
|
|
+function getCoursewareMenuList(id?: string) {
|
|
|
// GYM,GYT,KLX 区分 查询接口
|
|
|
const LessonCoursewareMenuDetailApi = {
|
|
|
GYT: refLevel_gyt,
|
|
|
- GYM: getLessonCourseDetail_gym,
|
|
|
- KLX: getLessonCourseDetail_klx
|
|
|
+ GYM: refLevel_gym,
|
|
|
+ KLX: refLevel_klx
|
|
|
}
|
|
|
+
|
|
|
httpAjaxErrMsg(LessonCoursewareMenuDetailApi[userStoreHook.roles!], {
|
|
|
- lessonCoursewareDetailId: "1689564396456579073",
|
|
|
- courseScheduleId: "1844948199117283329"
|
|
|
+ lessonCoursewareDetailId: id || route.params.id
|
|
|
+ // courseScheduleId: "1844948199117283329"
|
|
|
} as any).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
- const { lockFlag, knowledgePointList } = res.data || {}
|
|
|
- if (lockFlag) {
|
|
|
- ElMessageBox.alert("课件已锁定", "温馨提示", {
|
|
|
- confirmButtonText: "退出",
|
|
|
- type: "error"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- handleGoBack()
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- handleGoBack()
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if ((knowledgePointList || []).length < 1) {
|
|
|
- ElMessageBox.alert("没有找到课件", "温馨提示", {
|
|
|
- confirmButtonText: "退出",
|
|
|
- type: "error"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- handleGoBack()
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- handleGoBack()
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- // 处理返回的数据
|
|
|
- handlePointList(knowledgePointList)
|
|
|
+ coursewareMenuList.value = res.data || []
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -332,10 +319,23 @@ function handleCourseClick(value: any) {
|
|
|
activeCoursewareIndex.value = flattenCoursewareList.value.findIndex((item: any) => {
|
|
|
return value.id === item.id && value.knowledgePointId === item.knowledgePointId
|
|
|
})
|
|
|
+ drawerShow.value = false
|
|
|
}
|
|
|
+async function handleCourseMenuClick(value: any) {
|
|
|
+ LoadingBar.loading(true)
|
|
|
+ flattenCoursewareListData = []
|
|
|
+ activeCoursewareIndex.value = -1
|
|
|
+ if (value.id === route.params.id) {
|
|
|
+ isCurrentCoursewareMenu.value = true
|
|
|
+ } else {
|
|
|
+ isCurrentCoursewareMenu.value = false
|
|
|
+ }
|
|
|
+ await getCoursewareList(value.id)
|
|
|
+ getCoursewareMenuList(value.id)
|
|
|
+ drawerMenuShow.value = false
|
|
|
+ activeCoursewareIndex.value = 0
|
|
|
|
|
|
-function handleCourseMenuClick(value: any) {
|
|
|
- console.log(value, "value")
|
|
|
+ LoadingBar.loading(false)
|
|
|
}
|
|
|
|
|
|
/* 播放器相关 */
|
|
@@ -395,6 +395,14 @@ function handleKeydown(e: KeyboardEvent) {
|
|
|
handleChangeCourseware(-1)
|
|
|
}
|
|
|
}
|
|
|
+function handleToolClick(type: string) {
|
|
|
+ fileType.value === "VIDEO" && handleVideoPause()
|
|
|
+ if (type === "menu") {
|
|
|
+ drawerMenuShow.value = true
|
|
|
+ } else if (type === "point") {
|
|
|
+ drawerShow.value = true
|
|
|
+ }
|
|
|
+}
|
|
|
function handleMousemove() {
|
|
|
showController()
|
|
|
}
|
|
@@ -463,7 +471,27 @@ function handleCoursewareEnd() {
|
|
|
handleGoBack()
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+// 是否收起
|
|
|
+watch(
|
|
|
+ () => isShowController.value,
|
|
|
+ () => {
|
|
|
+ if (isShowController.value) {
|
|
|
+ isPlay.value = false
|
|
|
+ } else {
|
|
|
+ isPlay.value = true
|
|
|
+ toolOpen.value = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+)
|
|
|
+// 白板的批注打开时暂停播放
|
|
|
+watch(
|
|
|
+ () => [whitePenShow.value, penShow.value],
|
|
|
+ () => {
|
|
|
+ if (whitePenShow.value || penShow.value) {
|
|
|
+ handleVideoPause()
|
|
|
+ }
|
|
|
+ }
|
|
|
+)
|
|
|
// 去练习
|
|
|
const activeCoursewareResourceId = computed<string | undefined>(() => {
|
|
|
const materialRefs = activeCourseware.value?.materialRefs
|
|
@@ -493,6 +521,7 @@ function onTitleTip(type: "phaseGoals" | "checkItem", text: string) {
|
|
|
text,
|
|
|
btnShow: [false, false]
|
|
|
})
|
|
|
+ handleVideoPause()
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -516,7 +545,7 @@ function onTitleTip(type: "phaseGoals" | "checkItem", text: string) {
|
|
|
transform: translateY(-100%);
|
|
|
}
|
|
|
.goPracticeBtn {
|
|
|
- transform: translatex(-135px);
|
|
|
+ transform: translateY(74px);
|
|
|
}
|
|
|
}
|
|
|
&.fileType_song.hideController {
|
|
@@ -661,10 +690,10 @@ function onTitleTip(type: "phaseGoals" | "checkItem", text: string) {
|
|
|
}
|
|
|
.goPracticeBtn {
|
|
|
position: absolute;
|
|
|
- left: 30px;
|
|
|
- bottom: 124px;
|
|
|
- width: 178px;
|
|
|
- height: 64px;
|
|
|
+ right: 32px;
|
|
|
+ bottom: 24px;
|
|
|
+ width: 143px;
|
|
|
+ height: 50px;
|
|
|
background: url("@/img/coursewarePlay/goPracticeBtn.png") no-repeat;
|
|
|
background-size: 100% 100%;
|
|
|
cursor: pointer;
|