Browse Source

feat: 保存

gemercheung 1 year ago
parent
commit
f946bf51d7

+ 8 - 2
packages/qjkankan-editor/src/views/mask/setting.vue

@@ -227,7 +227,7 @@ export default {
       handler: function (val) {
         if (val) {
           this.$confirm({
-            content: this.$i18n.t('mask.is_apply_to_all_pano'),
+            content: this.$i18n.t("mask.is_apply_to_all_pano"),
             ok: () => {
               this.$store.dispatch("scene/applycustomMaskToAll", "sky");
             },
@@ -243,7 +243,7 @@ export default {
       handler: function (val) {
         if (val) {
           this.$confirm({
-            content: this.$i18n.t('mask.is_apply_to_all_pano'),
+            content: this.$i18n.t("mask.is_apply_to_all_pano"),
             ok: () => {
               this.$store.dispatch("scene/applycustomMaskToAll", "earth");
             },
@@ -316,6 +316,9 @@ export default {
       const kr = this.$getKrpano();
       if (kr) {
         kr.set("hotspot[peaklogo].distorted", anti);
+        if (!anti) {
+          kr.set("hotspot[peaklogo].scale", this.sky.scale * 0.50);
+        }
       }
     },
     handleNadirStatus(status) {
@@ -341,6 +344,9 @@ export default {
       const kr = this.$getKrpano();
       if (kr) {
         kr.set("hotspot[nadirlogo].distorted", anti);
+        if (!anti) {
+          kr.set("hotspot[peaklogo].scale", this.earth.scale * 0.50);
+        }
       }
     },
     updateCurrentScene() {

+ 3 - 2
packages/qjkankan-editor/src/views/screen/Setting.vue

@@ -162,8 +162,9 @@ export default {
       const kr = this.$getKrpano();
       if (kr) {
         kr.set("view.limitview", "lookat");
-        const mid = min + max;
-        kr.set("view.vlookat", mid);
+        // const mid = min + max;
+        // console.log("mid", min, max);
+        // kr.set("view.vlookat", min);
         kr.set("view.vlookatmin", String(min));
         kr.set("view.vlookatmax", String(max));
       }

+ 10 - 1
packages/qjkankan-view/src/components/Pano/index.vue

@@ -224,11 +224,17 @@ const handleMasksUpdate = (skyMask, earthMask, app) => {
     }
     if ("antidistorted" in skyMask) {
       app.krpanoDom.set(`hotspot[peaklogo].distorted`, skyMask.antidistorted);
+      if (!skyMask.antidistorted) {
+        app.krpanoDom.set(`hotspot[peaklogo].scale`, skyMask.scale * 0.9);
+      }
     }
   }
   if (earthMask) {
     if ("isShow" in earthMask) {
-      app.krpanoDom.set(`hotspot[nadirlogo].visible`, Boolean(earthMask.isShow));
+      app.krpanoDom.set(
+        `hotspot[nadirlogo].visible`,
+        Boolean(earthMask.isShow)
+      );
     }
     if (earthMask.icon) {
       app.krpanoDom.set(`hotspot[nadirlogo].url`, earthMask.icon);
@@ -241,6 +247,9 @@ const handleMasksUpdate = (skyMask, earthMask, app) => {
         `hotspot[nadirlogo].distorted`,
         earthMask.antidistorted
       );
+      if (!earthMask.antidistorted) {
+        app.krpanoDom.set(`hotspot[nadirlogo].scale`, earthMask.scale * 0.9);
+      }
     }
   }
 };

+ 1 - 1
packages/qjkankan-view/src/components/UIGather/control/telephone.vue

@@ -19,7 +19,7 @@
 </template>
 
 <script setup>
-import { reactive, defineEmits, onBeforeMount, onMounted, ref, watchEffect, computed, watch, nextTick } from "vue";
+import { computed } from "vue";
 import { useStore } from "vuex";
 const store = useStore();
 

+ 10 - 1
packages/qjkankan-view/src/pages/show.vue

@@ -261,11 +261,17 @@ const handleMasksUpdate = (skyMask, earthMask, app) => {
     }
     if ("antidistorted" in skyMask) {
       app.krpanoDom.set(`hotspot[peaklogo].distorted`, skyMask.antidistorted);
+      if (!skyMask.antidistorted) {
+        app.krpanoDom.set(`hotspot[peaklogo].scale`, skyMask.scale * 0.50);
+      }
     }
   }
   if (earthMask) {
     if ("isShow" in earthMask) {
-      app.krpanoDom.set(`hotspot[nadirlogo].visible`, Boolean(earthMask.isShow));
+      app.krpanoDom.set(
+        `hotspot[nadirlogo].visible`,
+        Boolean(earthMask.isShow)
+      );
     }
     if (earthMask.icon) {
       app.krpanoDom.set(`hotspot[nadirlogo].url`, earthMask.icon);
@@ -278,6 +284,9 @@ const handleMasksUpdate = (skyMask, earthMask, app) => {
         `hotspot[nadirlogo].distorted`,
         earthMask.antidistorted
       );
+      if (!earthMask.antidistorted) {
+        app.krpanoDom.set(`hotspot[nadirlogo].scale`, earthMask.scale * 0.50);
+      }
     }
   }
 };

+ 6 - 0
packages/qjkankan-view/src/pages/showMobile.vue

@@ -260,6 +260,9 @@ const handleMasksUpdate = (skyMask, earthMask, app) => {
     }
     if ("antidistorted" in skyMask) {
       app.krpanoDom.set(`hotspot[peaklogo].distorted`, skyMask.antidistorted);
+      if (!skyMask.antidistorted) {
+        app.krpanoDom.set(`hotspot[peaklogo].scale`, skyMask.scale * 0.50);
+      }
     }
   }
   if (earthMask) {
@@ -277,6 +280,9 @@ const handleMasksUpdate = (skyMask, earthMask, app) => {
         `hotspot[nadirlogo].distorted`,
         earthMask.antidistorted
       );
+      if (!earthMask.antidistorted) {
+        app.krpanoDom.set(`hotspot[nadirlogo].scale`, earthMask.scale * 0.50);
+      }
     }
   }
 };