|
@@ -5,67 +5,63 @@
|
|
-->
|
|
-->
|
|
<template>
|
|
<template>
|
|
<div class="coursewarePlay">
|
|
<div class="coursewarePlay">
|
|
- <videoPlay ref="videoPlayDom" @ended="handleChangeCourseware(1)" :disableEvents="true">
|
|
|
|
- <div class="leftTools posTools">
|
|
|
|
- <div v-if="activeCoursewareIndex > 0" class="posBtn" @click="handleChangeCourseware(-1)">
|
|
|
|
- <img src="@/img/coursewarePlay/shang.png" />
|
|
|
|
- <div>上一个</div>
|
|
|
|
- </div>
|
|
|
|
- <div v-if="activeCoursewareIndex < flattenCoursewareList.length - 1" class="posBtn" @click="handleChangeCourseware(1)">
|
|
|
|
- <img src="@/img/coursewarePlay/xia.png" />
|
|
|
|
- <div>下一个</div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <videoPlay ref="videoPlayDom" @ended="handleChangeCourseware(1)" :disableEvents="true" />
|
|
|
|
+ <div class="leftTools posTools">
|
|
|
|
+ <div v-if="activeCoursewareIndex > 0" class="posBtn" @click="handleChangeCourseware(-1)">
|
|
|
|
+ <img src="@/img/coursewarePlay/shang.png" />
|
|
|
|
+ <div>上一个</div>
|
|
</div>
|
|
</div>
|
|
- <div class="rightTools posTools">
|
|
|
|
- <div
|
|
|
|
- class="posBtn"
|
|
|
|
- @click="
|
|
|
|
- () => {
|
|
|
|
- videoPlayDom?.pauseVideo()
|
|
|
|
- whitePenShow = true
|
|
|
|
- }
|
|
|
|
- "
|
|
|
|
- >
|
|
|
|
- <img src="@/img/coursewarePlay/baiban.png" />
|
|
|
|
- <div>白板</div>
|
|
|
|
- </div>
|
|
|
|
- <div
|
|
|
|
- class="posBtn"
|
|
|
|
- @click="
|
|
|
|
- () => {
|
|
|
|
- videoPlayDom?.pauseVideo()
|
|
|
|
- penShow = true
|
|
|
|
- }
|
|
|
|
- "
|
|
|
|
- >
|
|
|
|
- <img src="@/img/coursewarePlay/pizhu.png" />
|
|
|
|
- <div>批注</div>
|
|
|
|
- </div>
|
|
|
|
- <div class="posBtn" @click="drawerShow = true">
|
|
|
|
- <img src="@/img/coursewarePlay/zhishidian.png" />
|
|
|
|
- <div>知识点</div>
|
|
|
|
- </div>
|
|
|
|
- <div class="posBtn" @click="handleCoursewareEnd">
|
|
|
|
- <img src="@/img/coursewarePlay/jieshu.png" />
|
|
|
|
- <div>结束</div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div v-if="activeCoursewareIndex < flattenCoursewareList.length - 1" class="posBtn" @click="handleChangeCourseware(1)">
|
|
|
|
+ <img src="@/img/coursewarePlay/xia.png" />
|
|
|
|
+ <div>下一个</div>
|
|
</div>
|
|
</div>
|
|
- <div class="topTools">
|
|
|
|
- <div class="leftMenu">
|
|
|
|
- <img @click="handleGoBack" class="backImg" src="@/img/coursewarePlay/back.png" />
|
|
|
|
- <playRecordTime
|
|
|
|
- v-if="route.query.modeId && coursewareTotalTIme && !(userStoreHook.roles === 'GYM')"
|
|
|
|
- :modeId="route.query.modeId as string"
|
|
|
|
- :coursewareTotalTIme="coursewareTotalTIme"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div class="midMenu">{{ activeCourseware?.parentData.name || "" }}</div>
|
|
|
|
- <div class="rightMenu"></div>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ <div class="rightTools posTools">
|
|
|
|
+ <div
|
|
|
|
+ class="posBtn"
|
|
|
|
+ @click="
|
|
|
|
+ () => {
|
|
|
|
+ videoPlayDom?.pauseVideo()
|
|
|
|
+ whitePenShow = true
|
|
|
|
+ }
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <img src="@/img/coursewarePlay/baiban.png" />
|
|
|
|
+ <div>白板</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ class="posBtn"
|
|
|
|
+ @click="
|
|
|
|
+ () => {
|
|
|
|
+ videoPlayDom?.pauseVideo()
|
|
|
|
+ penShow = true
|
|
|
|
+ }
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <img src="@/img/coursewarePlay/pizhu.png" />
|
|
|
|
+ <div>批注</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="posBtn" @click="drawerShow = true">
|
|
|
|
+ <img src="@/img/coursewarePlay/zhishidian.png" />
|
|
|
|
+ <div>知识点</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="posBtn" @click="handleCoursewareEnd">
|
|
|
|
+ <img src="@/img/coursewarePlay/jieshu.png" />
|
|
|
|
+ <div>结束</div>
|
|
</div>
|
|
</div>
|
|
- <div class="activeName">
|
|
|
|
- <div>{{ activeCourseware?.name || "" }}</div>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ <div class="topTools">
|
|
|
|
+ <div class="leftMenu">
|
|
|
|
+ <img @click="handleGoBack" class="backImg" src="@/img/coursewarePlay/back.png" />
|
|
|
|
+ <playRecordTime
|
|
|
|
+ v-if="route.query.modeId && coursewareTotalTime && !(userStoreHook.roles === 'GYM')"
|
|
|
|
+ :modeId="route.query.modeId as string"
|
|
|
|
+ :coursewareTotalTime="coursewareTotalTime"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
- </videoPlay>
|
|
|
|
|
|
+ <div class="midMenu">{{ activeCourseware?.parentData.name || "" }}</div>
|
|
|
|
+ <div class="rightMenu"></div>
|
|
|
|
+ </div>
|
|
<el-drawer class="elDrawer" v-model="drawerShow" :show-close="false">
|
|
<el-drawer class="elDrawer" v-model="drawerShow" :show-close="false">
|
|
<template #header="{ close }">
|
|
<template #header="{ close }">
|
|
<img class="directory" src="@/img/coursewarePlay/kcml.png" />
|
|
<img class="directory" src="@/img/coursewarePlay/kcml.png" />
|
|
@@ -111,13 +107,13 @@ import playRecordTime from "./components/playRecordTime"
|
|
import useDialogConfirm from "@/hooks/useDialogConfirm"
|
|
import useDialogConfirm from "@/hooks/useDialogConfirm"
|
|
import { getRecentCourseSchedule_gym } from "@/api/homePage.api"
|
|
import { getRecentCourseSchedule_gym } from "@/api/homePage.api"
|
|
|
|
|
|
|
|
+const route = useRoute()
|
|
|
|
+const userStoreHook = userStore()
|
|
// 批注
|
|
// 批注
|
|
const penShow = ref(false)
|
|
const penShow = ref(false)
|
|
// 白板
|
|
// 白板
|
|
const whitePenShow = ref(false)
|
|
const whitePenShow = ref(false)
|
|
-
|
|
|
|
-const route = useRoute()
|
|
|
|
-const userStoreHook = userStore()
|
|
|
|
|
|
+/* 获取资源 */
|
|
const videoPlayDom = ref<InstanceType<typeof videoPlay>>()
|
|
const videoPlayDom = ref<InstanceType<typeof videoPlay>>()
|
|
const coursewareList = shallowRef<any[]>([]) // 知识点
|
|
const coursewareList = shallowRef<any[]>([]) // 知识点
|
|
const flattenCoursewareList = shallowRef<any[]>([]) // 扁平化coursewareList
|
|
const flattenCoursewareList = shallowRef<any[]>([]) // 扁平化coursewareList
|
|
@@ -128,15 +124,13 @@ const activeCourseware = computed<undefined | Record<string, any>>(() => {
|
|
const activeCoursewareIndex = ref(0)
|
|
const activeCoursewareIndex = ref(0)
|
|
const drawerShow = ref(false)
|
|
const drawerShow = ref(false)
|
|
// 课程总时间
|
|
// 课程总时间
|
|
-const coursewareTotalTIme = ref(0)
|
|
|
|
|
|
+const coursewareTotalTime = ref(0)
|
|
watch(activeCourseware, () => {
|
|
watch(activeCourseware, () => {
|
|
- activeCourseware.value && videoPlayDom.value?.playVideo(activeCourseware.value.content)
|
|
|
|
-})
|
|
|
|
-onMounted(() => {
|
|
|
|
- document.addEventListener("keydown", handleVideoKeydown)
|
|
|
|
-})
|
|
|
|
-onUnmounted(() => {
|
|
|
|
- document.removeEventListener("keydown", handleVideoKeydown)
|
|
|
|
|
|
+ activeCourseware.value &&
|
|
|
|
+ videoPlayDom.value?.playVideo({
|
|
|
|
+ src: activeCourseware.value.content,
|
|
|
|
+ name: activeCourseware.value.name
|
|
|
|
+ })
|
|
})
|
|
})
|
|
getCoursewareList()
|
|
getCoursewareList()
|
|
function getCoursewareList() {
|
|
function getCoursewareList() {
|
|
@@ -174,7 +168,6 @@ function getCoursewareList() {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
let flattenCoursewareListData: any = [] // 临时扁平化数据
|
|
let flattenCoursewareListData: any = [] // 临时扁平化数据
|
|
function handlePointList(pointList: any[]) {
|
|
function handlePointList(pointList: any[]) {
|
|
coursewareList.value = filterPointList(pointList)
|
|
coursewareList.value = filterPointList(pointList)
|
|
@@ -195,7 +188,7 @@ function filterPointList(pointList: any[], parentData?: { ids: string[]; name: s
|
|
children: filterPointList(point.children, { ids: [...(parentData?.ids || []), point.id], name: point.name })
|
|
children: filterPointList(point.children, { ids: [...(parentData?.ids || []), point.id], name: point.name })
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- coursewareTotalTIme.value += point.totalMaterialTimeSecond
|
|
|
|
|
|
+ coursewareTotalTime.value += point.totalMaterialTimeSecond
|
|
return Object.assign(point, {
|
|
return Object.assign(point, {
|
|
materialList: point.materialList.map((item: any) => {
|
|
materialList: point.materialList.map((item: any) => {
|
|
item.parentData = {
|
|
item.parentData = {
|
|
@@ -209,7 +202,6 @@ function filterPointList(pointList: any[], parentData?: { ids: string[]; name: s
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
function handleChangeCourseware(index: -1 | 1) {
|
|
function handleChangeCourseware(index: -1 | 1) {
|
|
const newIndex = index + activeCoursewareIndex.value
|
|
const newIndex = index + activeCoursewareIndex.value
|
|
if (newIndex < 0 || newIndex > flattenCoursewareList.value.length - 1) {
|
|
if (newIndex < 0 || newIndex > flattenCoursewareList.value.length - 1) {
|
|
@@ -222,6 +214,14 @@ function handleCourseClick(value: any) {
|
|
return value.id === item.id
|
|
return value.id === item.id
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+/* 按键事件相关 */
|
|
|
|
+onMounted(() => {
|
|
|
|
+ document.addEventListener("keydown", handleVideoKeydown)
|
|
|
|
+})
|
|
|
|
+onUnmounted(() => {
|
|
|
|
+ document.removeEventListener("keydown", handleVideoKeydown)
|
|
|
|
+})
|
|
function handleVideoKeydown(e: KeyboardEvent) {
|
|
function handleVideoKeydown(e: KeyboardEvent) {
|
|
const key = e.key
|
|
const key = e.key
|
|
if (key === "ArrowDown") {
|
|
if (key === "ArrowDown") {
|
|
@@ -230,6 +230,8 @@ function handleVideoKeydown(e: KeyboardEvent) {
|
|
handleChangeCourseware(-1)
|
|
handleChangeCourseware(-1)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+/* 结束课程 */
|
|
function handleGoBack() {
|
|
function handleGoBack() {
|
|
window.open("about:blank", "_self")
|
|
window.open("about:blank", "_self")
|
|
window.close()
|
|
window.close()
|
|
@@ -282,18 +284,6 @@ function handleCoursewareEnd() {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
position: relative;
|
|
position: relative;
|
|
- .activeName {
|
|
|
|
- transition: all 0.5s;
|
|
|
|
- position: absolute;
|
|
|
|
- right: 30px;
|
|
|
|
- bottom: 15px;
|
|
|
|
- font-weight: 500;
|
|
|
|
- font-size: 20px;
|
|
|
|
- color: #ffffff;
|
|
|
|
- display: flex;
|
|
|
|
- align-items: flex-end;
|
|
|
|
- padding-bottom: 13px;
|
|
|
|
- }
|
|
|
|
.topTools {
|
|
.topTools {
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 0;
|
|
top: 0;
|
|
@@ -371,10 +361,6 @@ function handleCoursewareEnd() {
|
|
opacity: 0;
|
|
opacity: 0;
|
|
transform: translateY(-100%);
|
|
transform: translateY(-100%);
|
|
}
|
|
}
|
|
- .activeName {
|
|
|
|
- opacity: 0;
|
|
|
|
- transform: translateY(100%);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
&:deep(.elDrawer.el-drawer) {
|
|
&:deep(.elDrawer.el-drawer) {
|
|
width: 346px !important;
|
|
width: 346px !important;
|