人生啊人生 3 luni în urmă
părinte
comite
3651115871

+ 10 - 0
user_web/src/components/CarSimulation/CarSimulationMain.vue

@@ -7,6 +7,15 @@ import CarCourseChapter3dView from "../CarSimulation/CarCourseChapter3d/view.vue
 import { CarCourseChapter3dShowStore } from "../CarSimulation/CarCourseChapter3d/store/CarCourseChapter3dShowStore.js";
 import { CarProcessDb } from "../CarSimulation/CarThreeWorldEvent/event/CarProcessDb.js";
 
+const props = defineProps({
+    // 重置流程到第一个流程
+    processInitRestTime : {
+        type: String,
+        default : function() {
+            return "0";
+        }
+    },
+});
 
 // 定义发射给父组件的方法
 const emits = defineEmits([
@@ -136,6 +145,7 @@ CarProcessDb.find().callbackChuanGongZuoFu = function(bool) {
 
         <!-- 自定义自己建的加载3d场景的逻辑 -->
         <CarThreeWorldEventMain
+        :processInitRestTime="props.processInitRestTime"
         @tipsBtnsUpOpen="tipsBtnsUpOpenEvent"
         @tipsBtnsDownOpen="tipsBtnsDownOpenEvent"
         ></CarThreeWorldEventMain>

+ 51 - 8
user_web/src/components/CarSimulation/CarThreeWorldEvent/CarThreeWorldEventMain.vue

@@ -18,6 +18,31 @@ import { CarTypeViewEvent } from "./event/CarTypeViewEvent.js";
 import { CarRenderEvent } from "./event/CarRenderEvent.js";
 import { CarWater } from "./event/CarWater.js";
 
+const props = defineProps({
+    // 重置流程到第一个流程
+    processInitRestTime : {
+        type: String,
+        default : function() {
+            return "0";
+        }
+    },
+});
+
+watch(
+    () => props.processInitRestTime,
+    (newVal, oldVal) => {
+        
+        // console.log(
+        //     "Car 是否触发重置流程的逻辑 props.processInitRestTime ===>",
+        //     props.processInitRestTime
+        // );
+        if (CarMyThreeWorldStore().obj.loadSuccess == true) {
+            toChuanYiFuEvent();
+        }
+
+    }
+);
+
 /**
  * 平时开发3d代码逻辑可以写这里
  * 更多的代码逻辑,建议用面向对象的方式去开发
@@ -477,14 +502,14 @@ const callbackLoadEndEvent = (json) => {
         //     CarMyThreeWorldStore().obj.processConfig = configUpdate;
         // }
 
-        // 切换流程 - 设备连接实验
-        let configToIndexUpdate = CarProcessDb.find().configToIndexUpdate(25);
-        if (configToIndexUpdate != null && configToIndexUpdate != undefined) {
-            CarMyThreeWorldStore().obj.processConfig = configToIndexUpdate;
-            console.log(
-                "切换流程 - 设备连接实验", configToIndexUpdate
-            );
-        }
+        // // 切换流程 - 设备连接实验 穿衣服的逻辑
+        // let configToIndexUpdate = CarProcessDb.find().configToIndexUpdate(25);
+        // if (configToIndexUpdate != null && configToIndexUpdate != undefined) {
+        //     CarMyThreeWorldStore().obj.processConfig = configToIndexUpdate;
+        //     console.log(
+        //         "切换流程 - 设备连接实验", configToIndexUpdate
+        //     );
+        // }
         
         // // 切换流程 - 设备下井实验
         // let configToIndexUpdate = CarProcessDb.find().configToIndexUpdate(48);
@@ -504,10 +529,28 @@ const callbackLoadEndEvent = (json) => {
         //     );
         // }
 
+        toChuanYiFuEvent();
+
     }, 2000);
     
 }
 
+
+/**
+ * 重新回到穿衣服的逻辑
+ */
+const toChuanYiFuEvent = () => {
+    // 切换流程 - 设备连接实验
+    let configToIndexUpdate = CarProcessDb.find().configToIndexUpdate(25);
+    if (configToIndexUpdate != null && configToIndexUpdate != undefined) {
+        CarMyThreeWorldStore().obj.processConfig = configToIndexUpdate;
+        console.log(
+            "切换流程 - 设备连接实验", configToIndexUpdate
+        );
+    }
+}
+
+
 /**
  * 跳转到声纳车的逻辑
  */

+ 1 - 0
user_web/src/view/student/trainChapter/trainChapter.vue

@@ -132,6 +132,7 @@
                     ></QvSimulationMain>
 
                     <CarSimulationMain
+                    :processInitRestTime="processInitRestTimeQv"
                     v-show="CarSimulationMainLook == true"
                     @callbackChuanGongZuoFu="callbackChuanGongZuoFuQvEvent"
                     ></CarSimulationMain>