|
@@ -123,7 +123,7 @@ import { getLessonCourseDetail_gym, getLessonCoursewareDetail_gyt, getLessonCour
|
|
|
import { checkWebCourse_gyt } from "@/api/coursewarePlay.api"
|
|
|
import { httpAjaxErrMsg, httpAjaxLoadingErrMsg } from "@/plugin/httpAjax"
|
|
|
import userStore from "@/store/modules/user"
|
|
|
-import { useRoute } from "vue-router"
|
|
|
+import { useRoute, useRouter } from "vue-router"
|
|
|
import { shallowRef, ref, computed, onUnmounted, onMounted, watch, nextTick } from "vue"
|
|
|
import { ElMessageBox } from "element-plus"
|
|
|
import courseCollapse from "./components/courseCollapse"
|
|
@@ -133,8 +133,10 @@ import useDialogConfirm from "@/hooks/useDialogConfirm"
|
|
|
import { getRecentCourseSchedule_gym } from "@/api/homePage.api"
|
|
|
import { getToken } from "@/libs/auth"
|
|
|
import { URL_TEACH_GYT, URL_TEACH_GYM, URL_TEACH_KLX } from "@/config"
|
|
|
+import { handleFullscreen } from "@/libs/fullscreen"
|
|
|
|
|
|
const route = useRoute()
|
|
|
+const router = useRouter()
|
|
|
const userStoreHook = userStore()
|
|
|
// 批注
|
|
|
const penShow = ref(false)
|
|
@@ -158,9 +160,11 @@ const songPlaySrc = computed<string>(() => {
|
|
|
}
|
|
|
// GYM,GYT,KLX 区分 云教练
|
|
|
const urlObj = {
|
|
|
- GYT: `${URL_TEACH_GYT}?id=${activeCourseware.value?.content}&modelType=practice&modeType=json&Authorization=${getToken()}`,
|
|
|
- GYM: `${URL_TEACH_GYM}?Authorization=${getToken()}&platform=web&liveConfig=1#/detail/${activeCourseware.value?.content}?isHideBack=true`,
|
|
|
- KLX: `${URL_TEACH_KLX}??Authorization=${getToken()}&id=${activeCourseware.value?.content}&isHideBack=true&limitModel=practice`
|
|
|
+ GYT: `${URL_TEACH_GYT}?id=${activeCourseware.value?.content}&modelType=practice&modeType=json&Authorization=${getToken()}&isYjt=1`,
|
|
|
+ GYM: `${URL_TEACH_GYM}?Authorization=${getToken()}&platform=web&liveConfig=1#/detail/${
|
|
|
+ activeCourseware.value?.content
|
|
|
+ }?isHideBack=trueis&Yjt=1`,
|
|
|
+ KLX: `${URL_TEACH_KLX}??Authorization=${getToken()}&id=${activeCourseware.value?.content}&isHideBack=true&limitModel=practice&isYjt=1`
|
|
|
}
|
|
|
return urlObj[userStoreHook.roles!]
|
|
|
})
|
|
@@ -228,7 +232,7 @@ function handlePointList(pointList: any[]) {
|
|
|
// 如果url里面有materialId 代表指定资料播放
|
|
|
if (route.query.materialId) {
|
|
|
const index = flattenCoursewareListData.findIndex((item: any) => {
|
|
|
- return route.query.materialId === item.id + ""
|
|
|
+ return route.query.materialId === item.id + "" && route.query.knowledgePointId === item.knowledgePointId + ""
|
|
|
})
|
|
|
index > -1 && (activeCoursewareIndex.value = index)
|
|
|
}
|
|
@@ -265,7 +269,7 @@ function handleChangeCourseware(index: -1 | 1) {
|
|
|
}
|
|
|
function handleCourseClick(value: any) {
|
|
|
activeCoursewareIndex.value = flattenCoursewareList.value.findIndex((item: any) => {
|
|
|
- return value.id === item.id
|
|
|
+ return value.id === item.id && value.knowledgePointId === item.knowledgePointId
|
|
|
})
|
|
|
}
|
|
|
/* 播放器相关 */
|
|
@@ -292,6 +296,9 @@ function handlePlayVideo({ src, name }: { src: string; name: string }) {
|
|
|
})
|
|
|
showController()
|
|
|
}
|
|
|
+
|
|
|
+// 全屏显示
|
|
|
+handleFullscreen(true, false)
|
|
|
/* 按键事件相关 */
|
|
|
onMounted(() => {
|
|
|
document.addEventListener("keydown", handleKeydown)
|
|
@@ -345,8 +352,9 @@ function hideController() {
|
|
|
}
|
|
|
/* 结束课程 */
|
|
|
function handleGoBack() {
|
|
|
- window.open("about:blank", "_self")
|
|
|
- window.close()
|
|
|
+ // window.open("about:blank", "_self")
|
|
|
+ // window.close()
|
|
|
+ router.go(-1)
|
|
|
}
|
|
|
function handleCoursewareEnd() {
|
|
|
if (route.query.modeId) {
|
|
@@ -398,9 +406,9 @@ const activeCoursewareResourceId = computed<string | undefined>(() => {
|
|
|
function handleGoPracticeBtn(activeCoursewareResourceId: string) {
|
|
|
// GYM,GYT,KLX 区分 云教练
|
|
|
const urlObj = {
|
|
|
- GYT: `${URL_TEACH_GYT}?id=${activeCoursewareResourceId}&modelType=practice&modeType=json&Authorization=${getToken()}`,
|
|
|
- GYM: `${URL_TEACH_GYM}?Authorization=${getToken()}&platform=web&liveConfig=1#/detail/${activeCoursewareResourceId}?isHideBack=true`,
|
|
|
- KLX: `${URL_TEACH_KLX}??Authorization=${getToken()}&id=${activeCoursewareResourceId}&isHideBack=true&limitModel=practice`
|
|
|
+ GYT: `${URL_TEACH_GYT}?id=${activeCoursewareResourceId}&modelType=practice&modeType=json&Authorization=${getToken()}&isYjt=1`,
|
|
|
+ GYM: `${URL_TEACH_GYM}?Authorization=${getToken()}&platform=web&liveConfig=1#/detail/${activeCoursewareResourceId}?isYjt=1`,
|
|
|
+ KLX: `${URL_TEACH_KLX}??Authorization=${getToken()}&id=${activeCoursewareResourceId}&limitModel=practice&isYjt=1`
|
|
|
}
|
|
|
window.open(urlObj[userStoreHook.roles!], "_blank")
|
|
|
}
|