人生啊人生 1 сар өмнө
parent
commit
ba045dc683

+ 15 - 2
src/components/ThreeWorldEventQingXiCheAndQv/QingXiCheAndQvMain.vue

@@ -7,7 +7,7 @@ import LoadingDemo from "./LoadingDemo.vue";
 import QingXiCheAndQvProcessEvent from "./event/QingXiCheAndQvProcessEvent.vue";
 import { QingXiCheAndQvProcessEventStore } from "./event/store/QingXiCheAndQvProcessEventStore.js";
 import { QingXiCheAndQvCarEvent } from "./js/QingXiCheAndQvCarEvent.js";
-import { watch, ref } from "vue";
+import { watch, ref, onMounted } from "vue";
 
 import WindowTxt from "../WindowQingXiCheAndQv/WindowTxt.vue";
 import { WindowTxtStore } from "@/components/WindowQingXiCheAndQv/store/WindowTxtStore.js";
@@ -39,6 +39,15 @@ const props = defineProps({
         type: Boolean,
         default: true,
     },
+    /**
+     * 当前的模式
+     * 0 - 学习模式,会出现各种提示,进行理解学习
+     * 1 - 考试模式,不会有任何提示,自己想办法完成
+     */
+    eventMode :  {
+        type: Number,
+        default: 0,
+    },
 });
 
 // 监听某个参数发生变化
@@ -53,7 +62,6 @@ watch(
     }
 )
 
-
 // 定义发射给父组件的方法
 const emits = defineEmits([
     // 回调进度
@@ -260,6 +268,11 @@ const QvStepUpdate = (name) => {
 
 }
 
+onMounted(() => {
+    QingXiCheAndQvProcessEventStore().obj.eventMode = props.eventMode;
+});
+
+
 </script>
 
 <template>

+ 2 - 1
src/view/student/trainChapter/trainAssessment.vue

@@ -6,7 +6,7 @@
         </div>
         
         <div class="chapterThreeWorld" >
-            <QingXiCheAndQvMain :initTime="initTimeQingXiCarAndQv" :processUiOpen="(stepTipsLook == true ? false : true)"
+            <QingXiCheAndQvMain :eventMode="1" :initTime="initTimeQingXiCarAndQv" :processUiOpen="(stepTipsLook == true ? false : true)"
             @callbackProgress="callbackProgressQingXiCheAndQv" ></QingXiCheAndQvMain>
         </div>
 
@@ -35,6 +35,7 @@ let initTimeQingXiCarAndQv = ref("0");
  * 清洗车自定义回调步骤
  */
 const callbackProgressQingXiCheAndQv = (json : any) => {
+
     console.log("callbackProgressQingXiCheAndQv ===>", json);
 
     // 完成所有步骤

+ 10 - 1
src/view/student/trainMain/trainMain.vue

@@ -61,7 +61,16 @@ const itemClick = (type: 'training' | 'report' | 'report_share') => {
     }
 
     if (type == 'assessment') {
-        router.push({ path: `/train/assessmentSelect/${state.taskId}` });
+        router.push({ path: `/train/assessmentSelect/${state.taskId}` }).then(() => {
+            // console.log("路由跳转完成了 ===>");
+            /**
+             * 由于 router.push 跳转页面,会导致来回切换三维场景存留一些其他参数
+             * 导致第一次进入三维界面是正常的,退回,切换回来,三维场景会出现报错
+             * 所以,这里切换到三维场景,要进行整个页面刷新一下
+             * 就可以解决这个问题,让它正常运行
+             */
+            window.location.reload();
+        });
     }
 
     if (type == 'report') router.push({ path: `/train/exam/${state.taskId}/${state.trainSelf.id}/${state.trainSelf.taskReport.id}` });