Browse Source

feat: 保存

gemercheung 1 year ago
parent
commit
b0fe6fd75f

+ 10 - 0
packages/qjkankan-editor/src/Store/modules/scene.js

@@ -16,6 +16,12 @@ const initCustomMask = {
     antidistorted: false,
   },
 };
+const initVisual = {
+  vlookat: null,
+  hlookat: null,
+  vlookatmin: 0,
+  vlookatmax: 0,
+};
 
 export default {
   namespaced: true,
@@ -26,6 +32,7 @@ export default {
       //当前场景
       currentScene: {
         customMask: initCustomMask,
+        initVisual: initVisual,
       },
       //访问密码
       password: "",
@@ -62,6 +69,9 @@ export default {
             console.log("item", item);
             payload[index]["customMask"] = initCustomMask;
           }
+          if (!("initVisual" in item)) {
+            payload[index]["initVisual"] = initVisual;
+          }
         });
       }
 

+ 8 - 1
packages/qjkankan-editor/src/views/cover/setting.vue

@@ -78,7 +78,7 @@
           :defaultImgSrc="
             require(`@/assets/images/default/mask_bg_${$lang}.png`)
           "
-          @cancel="onClickCancelSkyLogo"
+          @cancel="onClickCancelEarthLogo"
         ></SelectedImage>
         <div class="action">
           <button @click="onSelectPic('earth')" class="ui-button submit">
@@ -272,6 +272,13 @@ export default {
     },
     onClickCancelSkyLogo() {
       this.handlePeakURL("/static/template/skin/masking.png");
+      this.sky.fodderId = "";
+      this.sky.icon = "";
+    },
+    onClickCancelEarthLogo() {
+      this.handlePeakURL("/static/template/skin/masking.png");
+      this.earth.fodderId = "";
+      this.earth.icon = "";
     },
     onSelectPic(type) {
       this.isSelect = type;

+ 12 - 5
packages/qjkankan-editor/src/views/screen/Setting.vue

@@ -83,11 +83,16 @@ export default {
     };
   },
   watch: {
+    "$route.name": {
+      handler() {
+        this.handleHiddenAllMasks();
+      },
+      immediate: true,
+    },
     "currentScene.id": {
       handler(val, oldVal) {
         if (val && val !== oldVal) {
           this.applyToAll = false;
-          console.error("screenID不同");
           this.handleHiddenAllMasks();
         }
       },
@@ -158,10 +163,12 @@ export default {
     },
     handleHiddenAllMasks() {
       if (this.$getKrpano()) {
-        setTimeout(() => {
-          this.$getKrpano().set("hotspot[peaklogo].visible", false);
-          this.$getKrpano().set("hotspot[nadirlogo].visible", false);
-        }, 500);
+        if (this.$route.name === "screen") {
+          setTimeout(() => {
+            this.$getKrpano().set("hotspot[peaklogo].visible", false);
+            this.$getKrpano().set("hotspot[nadirlogo].visible", false);
+          }, 100);
+        }
       }
     },
   },