Selaa lähdekoodia

feat: 遮罩国际化,应用到全部改版

jinx 2 kuukautta sitten
vanhempi
commit
4ee504c561

BIN
packages/qjkankan-editor/public/static/template/skin/masking-en.png


BIN
packages/qjkankan-editor/public/static/template/skin/masking-zh.png


+ 6 - 0
packages/qjkankan-editor/src/framework/play/pano/index.vue

@@ -245,6 +245,9 @@ export default {
 
         if (skyMask.icon) {
           this.$getKrpano().set(`hotspot[peaklogo].url`, skyMask.icon);
+        } else {
+          //默认遮罩国际化
+          this.$getKrpano().set(`hotspot[peaklogo].url`, `static/template/skin/masking-${this.$lang}.png`);
         }
         if ("scale" in skyMask) {
           this.$getKrpano().set(`hotspot[peaklogo].scale`, skyMask.scale);
@@ -268,6 +271,9 @@ export default {
         }
         if (earthMask.icon) {
           this.$getKrpano().set(`hotspot[nadirlogo].url`, earthMask.icon);
+        } else {
+          //默认遮罩国际化
+          this.$getKrpano().set(`hotspot[nadirlogo].url`, `static/template/skin/masking-${this.$lang}.png`);
         }
         if ("scale" in earthMask) {
           this.$getKrpano().set(`hotspot[nadirlogo].scale`, earthMask.scale);

+ 21 - 6
packages/qjkankan-editor/src/views/mask/setting.vue

@@ -34,8 +34,9 @@
       </template>
       <!-- sky end -->
       <div class="swi-col">
-        <span> {{ $i18n.t("mask.apply_to_all_pano") }} </span>
-        <switcher :value="isApplySkyToAll" @change="(sat) => (isApplySkyToAll = Boolean(sat))"></switcher>
+        <!-- <span> {{ $i18n.t("mask.apply_to_all_pano") }} </span>
+        <switcher :value="isApplySkyToAll" @change="(sat) => (isApplySkyToAll = Boolean(sat))"></switcher> -->
+        <div class="apply-all-btn" @click="isApplySkyToAll = true">{{ $i18n.t("mask.apply_to_all_pano") }}</div>
       </div>
       <div style="margin: 30px 0"></div>
       <!-- earth start -->
@@ -64,8 +65,9 @@
         </div>
       </template>
       <div class="swi-col">
-        <span> {{ $i18n.t("mask.apply_to_all_pano") }} </span>
-        <switcher :value="isApplyEarthToAll" @change="(vet) => (isApplyEarthToAll = Boolean(vet))"></switcher>
+        <!-- <span> {{ $i18n.t("mask.apply_to_all_pano") }} </span>
+        <switcher :value="isApplyEarthToAll" @change="(vet) => (isApplyEarthToAll = Boolean(vet))"></switcher> -->
+        <div class="apply-all-btn" @click="isApplyEarthToAll = true">{{ $i18n.t("mask.apply_to_all_pano") }}</div>
       </div>
       <!-- earth end -->
     </template>
@@ -247,12 +249,12 @@ export default {
       window.open("/#/scene");
     },
     onClickCancelSkyLogo() {
-      this.handlePeakURL("static/template/skin/masking.png");
+      this.handlePeakURL(`static/template/skin/masking-${this.$lang}.png`);
       this.currentMask.data.sky.fodderId = "";
       this.currentMask.data.sky.icon = "";
     },
     onClickCancelEarthLogo() {
-      this.handleNadirURL("static/template/skin/masking.png");
+      this.handleNadirURL(`static/template/skin/masking-${this.$lang}.png`);
       this.currentMask.data.earth.fodderId = "";
       this.currentMask.data.earth.icon = "";
     },
@@ -275,6 +277,7 @@ export default {
       }
     },
     handlePeakURL(url) {
+      console.error(url);
       const kr = this.$getKrpano();
       if (kr && url) {
         kr.set("hotspot[peaklogo].url", url);
@@ -410,4 +413,16 @@ export default {
     }
   }
 }
+.apply-all-btn {
+  width: 100%;
+  color: #fff;
+  font-size: 14px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background: #313131;
+  padding: 9px;
+  cursor: pointer;
+  border-radius: 2px;
+}
 </style>

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

@@ -42,8 +42,9 @@
       </div>
 
       <div class="col">
-        <span>{{ $i18n.t("mask.apply_to_all_pano") }}</span>
-        <Switcher :value="applyToAll" @change="onSwitcherChange"></Switcher>
+        <!-- <span>{{ $i18n.t("mask.apply_to_all_pano") }}</span>
+        <Switcher :value="applyToAll" @change="onSwitcherChange"></Switcher> -->
+        <div class="apply-all-btn" @click="applyToAll = true">{{ $i18n.t("mask.apply_to_all_pano") }}</div>
       </div>
     </template>
 
@@ -327,4 +328,16 @@ export default {
     }
   }
 }
+.apply-all-btn {
+  width: 100%;
+  color: #fff;
+  font-size: 14px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background: #313131;
+  padding: 9px;
+  cursor: pointer;
+  border-radius: 2px;
+}
 </style>