فهرست منبع

全屏 和 多字段判断课件唯一性

黄琪勇 10 ماه پیش
والد
کامیت
4998f29ac6

+ 10 - 4
src/views/cloudTextbooks/chooseDialog.vue

@@ -60,11 +60,17 @@ function close() {
 }
 
 function handlePaly(id: string) {
-   const url = router.resolve({
+   // const url = router.resolve({
+   //    name: "coursewarePlay",
+   //    params: { id }
+   // }).href
+   // window.open(url, "_blank")
+   router.push({
       name: "coursewarePlay",
-      params: { id }
-   }).href
-   window.open(url, "_blank")
+      params: {
+         id
+      }
+   })
 }
 </script>
 

+ 6 - 2
src/views/coursewarePlay/components/courseCollapse/courseCollapse.vue

@@ -21,7 +21,7 @@
             <template v-if="item.materialList">
                <div
                   class="courseList"
-                  :class="{ isActive: activeCollapse?.id === i.id }"
+                  :class="{ isActive: activeCollapse?.id === i.id && activeCollapse?.knowledgePointId === i.knowledgePointId }"
                   v-for="i in item.materialList"
                   :key="i.id"
                   @click="handleClick(i)"
@@ -33,7 +33,10 @@
                      </div>
                   </div>
                   <div class="iconArrow">
-                     <img v-if="activeCollapse?.id === i.id" src="@/img/coursewarePlay/icon-load.gif" />
+                     <img
+                        v-if="activeCollapse?.id === i.id && activeCollapse?.knowledgePointId === i.knowledgePointId"
+                        src="@/img/coursewarePlay/icon-load.gif"
+                     />
                   </div>
                </div>
             </template>
@@ -52,6 +55,7 @@ type materialListType = {
    type: string
    typeCode?: string
    name: string
+   knowledgePointId: string
 }
 type courseListType = {
    id: string

+ 11 - 5
src/views/coursewarePlay/coursewarePlay.vue

@@ -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)
@@ -228,7 +230,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 +267,7 @@ function handleChangeCourseware(index: -1 | 1) {
 }
 function handleCourseClick(value: any) {
    activeCoursewareIndex.value = flattenCoursewareList.value.findIndex((item: any) => {
-      return value.id === item.id && value.parentData === item.parentData
+      return value.id === item.id && value.knowledgePointId === item.knowledgePointId
    })
 }
 /* 播放器相关 */
@@ -292,6 +294,9 @@ function handlePlayVideo({ src, name }: { src: string; name: string }) {
    })
    showController()
 }
+
+// 全屏显示
+handleFullscreen(true, false)
 /* 按键事件相关 */
 onMounted(() => {
    document.addEventListener("keydown", handleKeydown)
@@ -345,8 +350,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) {

+ 16 - 5
src/views/curriculum/curriculumDetail.vue

@@ -192,14 +192,25 @@ function handleSetUpCourseware(id: string) {
    })
 }
 function handleCourseClick(item: any) {
-   const url = router.resolve({
+   // const url = router.resolve({
+   //    name: "coursewarePlay",
+   //    params: { id: curriculumDetailData.value.id },
+   //    query: {
+   //       materialId: item.id,
+   //       knowledgePointId: item.knowledgePointId
+   //    }
+   // }).href
+   // window.open(url, "_blank")
+   router.push({
       name: "coursewarePlay",
-      params: { id: curriculumDetailData.value.id },
+      params: {
+         id: curriculumDetailData.value.id
+      },
       query: {
-         materialId: item.id
+         materialId: item.id,
+         knowledgePointId: item.knowledgePointId
       }
-   }).href
-   window.open(url, "_blank")
+   })
 }
 </script>
 

+ 13 - 4
src/views/curriculum/hooks/useStartClass.ts

@@ -120,12 +120,21 @@ export function handleStartClass_gyt(id: string) {
 }
 
 function handlePaly(coursewareDetailId: string, coursewareId: string) {
-   const url = router.resolve({
+   // const url = router.resolve({
+   //    name: "coursewarePlay",
+   //    params: { id: coursewareDetailId },
+   //    query: {
+   //       modeId: coursewareId
+   //    }
+   // }).href
+   // window.open(url, "_blank")
+   router.push({
       name: "coursewarePlay",
-      params: { id: coursewareDetailId },
+      params: {
+         id: coursewareDetailId
+      },
       query: {
          modeId: coursewareId
       }
-   }).href
-   window.open(url, "_blank")
+   })
 }