gemercheung 1 gadu atpakaļ
vecāks
revīzija
f8253c8fbc

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

@@ -2,7 +2,7 @@ import { i18n } from "@/lang";
 
 const initCustomMask = {
   sky: {
-    isShow: false,
+    isShow: true,
     icon: "",
     scale: 1,
     fodderId: "",

+ 38 - 2
packages/qjkankan-editor/src/framework/play/pano/index.vue

@@ -115,6 +115,7 @@ export default {
         } else {
           this.currentSceneVersion = newVal.version;
         }
+        this.handleIFrameCss();
       } else {
         $("#pano").empty();
         window.vrInitFn = () => {
@@ -267,8 +268,43 @@ export default {
     },
     handleRouterCoverForCap() {
       const { sky, earth } = this.currentScene.customMask;
-      sky.isShow && this.$getKrpano().set("hotspot[peaklogo].visible", true);
-      earth.isShow && this.$getKrpano().set("hotspot[nadirlogo].visible", true);
+      sky.isShow &&
+        this.$getKrpano() &&
+        this.$getKrpano().set("hotspot[peaklogo].visible", true);
+      earth.isShow &&
+        this.$getKrpano() &&
+        this.$getKrpano().set("hotspot[nadirlogo].visible", true);
+    },
+    handleIFrameCss() {
+      setTimeout(() => {
+        //   const css = `
+        // <style type="text/css">
+        // .controls-right-buttons{display:none !important};
+        // .controls-left-buttons .play-control {display: none !important;}
+        // </style>
+        // `;
+        const iframe = document.getElementById("iframe-4dkk");
+        const doc = iframe.contentWindow.document;
+        if (doc) {
+          console.log("存在-doc");
+          var css =
+            ".controls-right-buttons{display:none !important} " +
+            ".controls-left-buttons .play-control{display:none !important} " +
+            ".link-btn{display:none !important} " +
+            ".clear-box{display:none !important} " +
+            ".camera-btn{display:none !important} ";
+          var head = doc.head || doc.getElementsByTagName("head")[0];
+          var style = doc.createElement("style");
+          style.type = "text/css";
+          if (style.styleSheet) {
+            style.styleSheet.cssText = css;
+          } else {
+            style.appendChild(doc.createTextNode(css));
+          }
+
+          head.appendChild(style);
+        }
+      }, 1000);
     },
   },
   mounted() {

+ 99 - 95
packages/qjkankan-editor/src/views/mask/setting.vue

@@ -16,56 +16,58 @@
           @change="(value) => (sky.isShow = Boolean(value))"
         ></switcher>
       </div>
-      <div class="swi-col update-col">
-        <SelectedImage
-          :imgSrc="sky.icon"
-          :defaultImgSrc="
-            require(`@/assets/images/default/mask_bg_${$lang}.png`)
-          "
-          @cancel="onClickCancelSkyLogo"
-        ></SelectedImage>
-        <div class="action">
-          <button
-            @click="onSelectPic('sky')"
-            class="ui-button submit"
-            :class="[$lang]"
-          >
-            <!-- 选择图片 -->
-            {{ $i18n.t(`mask.select_image`) }}
-          </button>
-          <div
-            class="ui-remark"
-            v-html="$i18n.t(`edit_settings.mask_size`)"
-          ></div>
+      <template v-if="sky.isShow">
+        <div class="swi-col update-col">
+          <SelectedImage
+            :imgSrc="sky.icon"
+            :defaultImgSrc="
+              require(`@/assets/images/default/mask_bg_${$lang}.png`)
+            "
+            @cancel="onClickCancelSkyLogo"
+          ></SelectedImage>
+          <div class="action">
+            <button
+              @click="onSelectPic('sky')"
+              class="ui-button submit"
+              :class="[$lang]"
+            >
+              <!-- 选择图片 -->
+              {{ $i18n.t(`mask.select_image`) }}
+            </button>
+            <div
+              class="ui-remark"
+              v-html="$i18n.t(`edit_settings.mask_size`)"
+            ></div>
+          </div>
         </div>
-      </div>
 
-      <div class="up-col">
-        <span> {{ $i18n.t(`mask.scaling_ratio`) }} </span>
+        <div class="up-col">
+          <span> {{ $i18n.t(`mask.scaling_ratio`) }} </span>
 
-        <slider
-          v-model="sky.scale"
-          show-stops
-          :marks="scaleMarks"
-          :step="0.1"
-          :min="0.5"
-          :max="2"
-        />
-      </div>
-      <div class="swi-col">
-        <span> {{ $i18n.t("mask.follow_the_scene") }} </span>
-        <switcher
-          :value="sky.antidistorted"
-          @change="(sa) => (sky.antidistorted = Boolean(sa))"
-        ></switcher>
-      </div>
-      <div class="swi-col">
-        <span> {{ $i18n.t("mask.apply_to_all_pano") }} </span>
-        <switcher
-          :value="isApplySkyToAll"
-          @change="(sat) => (isApplySkyToAll = Boolean(sat))"
-        ></switcher>
-      </div>
+          <slider
+            v-model="sky.scale"
+            show-stops
+            :marks="scaleMarks"
+            :step="0.1"
+            :min="0.5"
+            :max="2"
+          />
+        </div>
+        <div class="swi-col">
+          <span> {{ $i18n.t("mask.follow_the_scene") }} </span>
+          <switcher
+            :value="sky.antidistorted"
+            @change="(sa) => (sky.antidistorted = Boolean(sa))"
+          ></switcher>
+        </div>
+        <div class="swi-col">
+          <span> {{ $i18n.t("mask.apply_to_all_pano") }} </span>
+          <switcher
+            :value="isApplySkyToAll"
+            @change="(sat) => (isApplySkyToAll = Boolean(sat))"
+          ></switcher>
+        </div>
+      </template>
       <!-- sky end -->
       <div style="margin: 30px 0"></div>
       <!-- earth start -->
@@ -76,50 +78,52 @@
           @change="(value) => (earth.isShow = Boolean(value))"
         ></switcher>
       </div>
-      <div class="swi-col update-col">
-        <SelectedImage
-          :imgSrc="earth.icon"
-          :defaultImgSrc="
-            require(`@/assets/images/default/mask_bg_${$lang}.png`)
-          "
-          @cancel="onClickCancelEarthLogo"
-        ></SelectedImage>
-        <div class="action">
-          <button @click="onSelectPic('earth')" class="ui-button submit">
-            {{ $i18n.t(`mask.select_image`) }}
-          </button>
-          <div
-            class="ui-remark"
-            v-html="$i18n.t(`edit_settings.mask_size`)"
-          ></div>
+      <template v-if="earth.isShow">
+        <div class="swi-col update-col">
+          <SelectedImage
+            :imgSrc="earth.icon"
+            :defaultImgSrc="
+              require(`@/assets/images/default/mask_bg_${$lang}.png`)
+            "
+            @cancel="onClickCancelEarthLogo"
+          ></SelectedImage>
+          <div class="action">
+            <button @click="onSelectPic('earth')" class="ui-button submit">
+              {{ $i18n.t(`mask.select_image`) }}
+            </button>
+            <div
+              class="ui-remark"
+              v-html="$i18n.t(`edit_settings.mask_size`)"
+            ></div>
+          </div>
         </div>
-      </div>
 
-      <div class="up-col">
-        <span> {{ $i18n.t(`mask.scaling_ratio`) }} </span>
-        <slider
-          v-model="earth.scale"
-          show-stops
-          :marks="scaleMarks"
-          :step="0.1"
-          :min="0.5"
-          :max="2"
-        />
-      </div>
-      <div class="swi-col">
-        <span> {{ $i18n.t("mask.follow_the_scene") }} </span>
-        <switcher
-          :value="earth.antidistorted"
-          @change="(ve) => (earth.antidistorted = Boolean(ve))"
-        ></switcher>
-      </div>
-      <div class="swi-col">
-        <span> {{ $i18n.t("mask.apply_to_all_pano") }} </span>
-        <switcher
-          :value="isApplyEarthToAll"
-          @change="(vet) => (isApplyEarthToAll = Boolean(vet))"
-        ></switcher>
-      </div>
+        <div class="up-col">
+          <span> {{ $i18n.t(`mask.scaling_ratio`) }} </span>
+          <slider
+            v-model="earth.scale"
+            show-stops
+            :marks="scaleMarks"
+            :step="0.1"
+            :min="0.5"
+            :max="2"
+          />
+        </div>
+        <div class="swi-col">
+          <span> {{ $i18n.t("mask.follow_the_scene") }} </span>
+          <switcher
+            :value="earth.antidistorted"
+            @change="(ve) => (earth.antidistorted = Boolean(ve))"
+          ></switcher>
+        </div>
+        <div class="swi-col">
+          <span> {{ $i18n.t("mask.apply_to_all_pano") }} </span>
+          <switcher
+            :value="isApplyEarthToAll"
+            @change="(vet) => (isApplyEarthToAll = Boolean(vet))"
+          ></switcher>
+        </div>
+      </template>
       <!-- earth end -->
     </template>
 
@@ -259,8 +263,8 @@ export default {
       handler: function (newVal, oldVal) {
         if (newVal && newVal !== oldVal) {
           const { sky, earth } = newVal;
-          this.isApplyEarthToAll = false;
-          this.isApplySkyToAll = false;
+          // this.isApplyEarthToAll = false;
+          // this.isApplySkyToAll = false;
           this.sky = { ...sky };
           this.earth = { ...earth };
         }
@@ -275,12 +279,12 @@ export default {
       window.open("/#/scene");
     },
     onClickCancelSkyLogo() {
-      this.handlePeakURL("/static/template/skin/masking.png");
+      this.handlePeakURL("static/template/skin/masking.png");
       this.sky.fodderId = "";
       this.sky.icon = "";
     },
     onClickCancelEarthLogo() {
-      this.handlePeakURL("/static/template/skin/masking.png");
+      this.handlePeakURL("static/template/skin/masking.png");
       this.earth.fodderId = "";
       this.earth.icon = "";
     },
@@ -317,7 +321,7 @@ export default {
       if (kr) {
         kr.set("hotspot[peaklogo].distorted", anti);
         if (!anti) {
-          kr.set("hotspot[peaklogo].scale", this.sky.scale * 0.50);
+          kr.set("hotspot[peaklogo].scale", this.sky.scale * 0.5);
         }
       }
     },
@@ -345,7 +349,7 @@ export default {
       if (kr) {
         kr.set("hotspot[nadirlogo].distorted", anti);
         if (!anti) {
-          kr.set("hotspot[peaklogo].scale", this.earth.scale * 0.50);
+          kr.set("hotspot[nadirlogo].scale", this.earth.scale * 0.5);
         }
       }
     },