gemercheung 2 years ago
parent
commit
2b96949fb0

+ 7 - 7
packages/qjkankan-editor/src/views/hotspot/EditPanel.vue

@@ -363,7 +363,7 @@ export default {
       // 热点类型相关设置项
       switch (this.hotspot.hotspotType) {
         case "scene":
-          if (!this.hotspot.secne.id) {
+          if (!(this.hotspot.secne && this.hotspot.secne.id)) {
             return false;
           }
           break;
@@ -441,10 +441,8 @@ export default {
           // ) {
           //   return false;
           // }
-  
-          if (
-            !this.hotspot.serialFrameInfo.img
-          ) {
+
+          if (!this.hotspot.serialFrameInfo.img) {
             return false;
           }
           break;
@@ -591,8 +589,10 @@ export default {
 
     cancel() {
       this.$store.commit("SetHotspot", this.backupHotSpot);
-      console.log('cancel',this.backupHotSpot);
-      this.$getKrpano().call("cancelJQHotspot(" + this.backupHotSpot.name + ");");
+      console.log("cancel", this.backupHotSpot);
+      this.$getKrpano().call(
+        "cancelJQHotspot(" + this.backupHotSpot.name + ");"
+      );
       this.$emit("close", {
         type: this.editTitle == this.$i18n.t("hotspot.edit") ? "edit" : "add",
         data: this.backupHotSpot,

+ 2 - 3
packages/qjkankan-view/public/showviewer/lib/krpano/skin/vtourskin.xml

@@ -237,8 +237,7 @@
 		<layer name="skin_btn_next_fs_icon" style="skin_base" crop="64|64|64|64" align="center" scale="0.5" enabled="false" />
 	</layer>
 
-
-	<!-- gyro plugin -->
+   <!-- gyro plugin -->
 	<plugin name="skin_gyro" keep="true" url="" html5_url="%SWFPATH%/plugins/gyro2.js" softstart="1.0" enabled="false" onavailable="skin_arrange_buttons();" devices="html5" />
 
 
@@ -285,7 +284,7 @@
 		  );
 
 		if(skin_settings.littleplanetintro AND (device.webgl OR device.flash),
-			skin_setup_littleplanetintro(skin_settings.littleplanetintro);
+			if(get(skin_settings.lptswitch) == 1,skin_setup_littleplanetintro(skin_settings.littleplanetintro););
 		  );
 
 		skin_addthumbs();

+ 79 - 53
packages/qjkankan-view/src/pages/show.vue

@@ -29,46 +29,48 @@ import LoadingLogo from "@/components/assembly/Loading";
 import Opening from "@/components/assembly/Opening";
 import { createApp } from "@/app";
 
-import { ref, onMounted, computed, watch, nextTick } from "vue";
+import { ref, onMounted, computed, watch, nextTick, unref } from "vue";
 import { getPanoInfo, checkWork } from "@/apis";
 import { useStore } from "vuex";
 import config from "@/utils/config";
 import browser from "@/utils/browser";
-import { useApp } from '@/app'
-import { useI18n, getLocale } from '@/i18n'
-const { t } = useI18n({ useScope: 'global' })
+import { useApp } from "@/app";
+import { useI18n, getLocale } from "@/i18n";
+const { t } = useI18n({ useScope: "global" });
 
 const fixOpening = {
-  '小行星开场': 1,
-  '水平巡游开场': 2,
-  '小行星巡游开场': 3,
-  '水晶球开场': 4,
-  '小行星缩放开场': 5,
-}
+  小行星开场: 1,
+  水平巡游开场: 2,
+  小行星巡游开场: 3,
+  水晶球开场: 4,
+  小行星缩放开场: 5,
+};
 
 const store = useStore();
 const show = ref(false);
 const workEnable = ref(true);
 const coverInfo = ref({});
 
-const lang = getLocale()
-
+const lang = getLocale();
 
 const currentScene = computed(() => store.getters["scene/currentScene"]);
-const currentCatalogRoot = computed(() => store.getters["scene/currentCatalogRoot"]);
+const currentCatalogRoot = computed(
+  () => store.getters["scene/currentCatalogRoot"]
+);
 
 const isAutoRotate = computed(() => store.getters["functions/isAutoRotate"]);
 
-
 const earthMask = computed(() => store.getters["scene/earthMask"]);
 const skyMask = computed(() => store.getters["scene/skyMask"]);
-
-
+const isShowOpeningAnimation = ref(0);
 
 onMounted(async () => {
   if (browser.isMobile()) {
-    window.location.href = window.location.href.replace('show.html', 'showMobile.html')
-    return
+    window.location.href = window.location.href.replace(
+      "show.html",
+      "showMobile.html"
+    );
+    return;
   }
   let res = await checkWork();
   if (!res.data) {
@@ -76,48 +78,57 @@ onMounted(async () => {
     return;
   }
   getPanoInfo().then(async (data) => {
+    isShowOpeningAnimation.value = Number(data.isShowOpeningAnimation);
     store.commit("scene/setScenes", data.scenes);
-    store.commit("scene/setPassword", data.password === "" ? false : data.password);
+    store.commit(
+      "scene/setPassword",
+      data.password === "" ? false : data.password
+    );
     store.commit("scene/setMetaData", data);
-    document.title = data.name || t('common.no_title')
+    document.title = data.name || t("common.no_title");
 
     let firstScene = "";
 
-
     if (config.sceneNum) {
-      firstScene = data.scenes.find((item) => item.sceneCode == config.sceneNum);
+      firstScene = data.scenes.find(
+        (item) => item.sceneCode == config.sceneNum
+      );
     } else if (data.firstScene) {
-      firstScene = data.scenes.find((item) => item.sceneCode == data.firstScene.sceneCode);
+      firstScene = data.scenes.find(
+        (item) => item.sceneCode == data.firstScene.sceneCode
+      );
     }
 
-
     store.commit("scene/setCurrentScene", firstScene || data.scenes[0]);
 
-
     // 过滤空分组
     let ttt = data.catalogRoot.filter((item) => {
-      let flag = ''
+      let flag = "";
 
       if (item.children) {
         item.children.some((sub) => {
-          flag = data.scenes.some(son => {
+          flag = data.scenes.some((son) => {
             // console.log(String(son.category).toLowerCase(), String(sub).toLowerCase());
-            return String(son.category).toLowerCase() == String(sub).toLowerCase()
-          })
-          return flag
+            return (
+              String(son.category).toLowerCase() == String(sub).toLowerCase()
+            );
+          });
+          return flag;
         });
       }
-      return flag
+      return flag;
     });
 
-    data.catalogRoot = ttt
-
+    data.catalogRoot = ttt;
 
-    let catalog = data.catalogs.find((item) => item.id == currentScene.value.category);
+    let catalog = data.catalogs.find(
+      (item) => item.id == currentScene.value.category
+    );
 
     // 查询初始场景的所在1级分组
     data.catalogRoot.forEach((item) => {
-      let temp = item.children && item.children.find((sub) => sub == catalog.id);
+      let temp =
+        item.children && item.children.find((sub) => sub == catalog.id);
       if (temp) {
         store.commit("scene/setCurrentCatalogRoot", item);
         return;
@@ -131,11 +142,13 @@ onMounted(async () => {
 
     show.value = true;
 
-    let isHavePano = data.scenes.some(item => item.type == 'pano')
+    let isHavePano = data.scenes.some((item) => item.type == "pano");
 
     const app = createApp({
       // xml: "%HTMLPATH%/static/template/tour.xml",
-      xml: `${process.env.VUE_APP_CDN}/720yun_fd_manage/${config.projectNum}/tour.xml?rnd=${Math.random()}`,
+      xml: `${process.env.VUE_APP_CDN}/720yun_fd_manage/${
+        config.projectNum
+      }/tour.xml?rnd=${Math.random()}`,
       swf: "%HTMLPATH%/showviewer/lib/krpano/tour.swf",
       target: "pano",
       html5: "auto",
@@ -143,13 +156,20 @@ onMounted(async () => {
       isHavePano,
       vars: {
         startscene: "scene_" + currentScene.value.sceneCode,
-        "view.vlookat": currentScene.value.initVisual ? currentScene.value.initVisual.vlookat : 0,
-        "view.hlookat": currentScene.value.initVisual ? currentScene.value.initVisual.hlookat : 0,
+        "view.vlookat": currentScene.value.initVisual
+          ? currentScene.value.initVisual.vlookat
+          : 0,
+        "view.hlookat": currentScene.value.initVisual
+          ? currentScene.value.initVisual.hlookat
+          : 0,
         "autorotate.enabled": !!data.isAuto,
-        "skin_settings.littleplanetintro": fixOpening[data.openingAnimationType || '小行星开场']
+        "skin_settings.littleplanetintro":
+          fixOpening[data.openingAnimationType || "小行星开场"],
+        "skin_settings.lptswitch": unref(isShowOpeningAnimation),
       },
       passQueryParameters: true,
     });
+    console.log('gemer',currentScene.value.icon);
 
     coverInfo.value = data.coverInfo || {};
     app.Scene.lock();
@@ -161,47 +181,53 @@ onMounted(async () => {
     if (isHavePano) {
       app.Scene.on("sceneReady", () => {
         if (app.krpanoDom) {
-
-          let defaultMask = `%SWFPATH%/skin/masking_${lang}.png`
+          let defaultMask = `%SWFPATH%/skin/masking_${lang}.png`;
 
           if (earthMask.value) {
             app.krpanoDom.set(`hotspot[nadirlogo].url`, defaultMask);
-            app.krpanoDom.set(`hotspot[nadirlogo].visible`, earthMask.value.isShow);
+            app.krpanoDom.set(
+              `hotspot[nadirlogo].visible`,
+              earthMask.value.isShow
+            );
 
             if (earthMask.value.icon) {
               app.krpanoDom.set(`hotspot[nadirlogo].url`, earthMask.value.icon);
             }
           }
 
-
           if (skyMask.value) {
             app.krpanoDom.set(`hotspot[peaklogo].url`, defaultMask);
-            app.krpanoDom.set(`hotspot[peaklogo].visible`, skyMask.value.isShow);
+            app.krpanoDom.set(
+              `hotspot[peaklogo].visible`,
+              skyMask.value.isShow
+            );
             if (skyMask.value.icon) {
               app.krpanoDom.set(`hotspot[peaklogo].url`, skyMask.value.icon);
             }
           }
 
-          app.krpanoDom.set(`layer[webvr_exitbutton].html`, t('common.exit_vr'));
-
+          app.krpanoDom.set(
+            `layer[webvr_exitbutton].html`,
+            t("common.exit_vr")
+          );
         }
-        let hotspots = []
+        let hotspots = [];
         if (currentScene.value.someData) {
-          hotspots = typeof currentScene.value.someData == 'string' ? JSON.parse(currentScene.value.someData).hotspots : currentScene.value.someData.hotspots
+          hotspots =
+            typeof currentScene.value.someData == "string"
+              ? JSON.parse(currentScene.value.someData).hotspots
+              : currentScene.value.someData.hotspots;
         }
-        console.log(hotspots,'hotspotshotspotshotspotshotspots');
+        console.log(hotspots, "hotspotshotspotshotspotshotspots");
         app.Tags.initHotspot(hotspots, false);
       });
-
     }
   });
-
 });
 </script>
 
 <style lang="scss" scoped>
 .ui-view-layout {
   position: relative;
-
 }
 </style>

+ 3 - 1
packages/qjkankan-view/src/pages/showMobile.vue

@@ -60,7 +60,7 @@ const isAutoRotate = computed(() => store.getters["functions/isAutoRotate"]);
 
 const earthMask = computed(() => store.getters["scene/earthMask"]);
 const skyMask = computed(() => store.getters["scene/skyMask"]);
-
+const isShowOpeningAnimation = ref(0);
 onMounted(async () => {
   if (!browser.isMobile()) {
     window.location.href = window.location.href.replace(
@@ -75,6 +75,7 @@ onMounted(async () => {
     return;
   }
   getPanoInfo().then(async (data) => {
+    isShowOpeningAnimation.value = Number(data.isShowOpeningAnimation);
     store.commit("scene/setScenes", data.scenes);
     store.commit(
       "scene/setPassword",
@@ -163,6 +164,7 @@ onMounted(async () => {
         "autorotate.enabled": !!data.isAuto,
         "skin_settings.littleplanetintro":
           fixOpening[data.openingAnimationType || "小行星开场"],
+        "skin_settings.lptswitch": unref(isShowOpeningAnimation),
       },
       passQueryParameters: true,
     });

+ 0 - 5
yarn.lock

@@ -16672,11 +16672,6 @@ vue-awesome-swiper@^4.1.1:
   resolved "https://mirrors.cloud.tencent.com/npm/vue-awesome-swiper/-/vue-awesome-swiper-4.1.1.tgz#8f7ab221ad003021d756b86aa618f429924900fe"
   integrity sha512-50um10t6N+lJaORkpwSi1wWuMmBI1sgFc9Znsi5oUykw2cO5DzLaBHcO2JNX21R+Ue4TGoIJDhhxjBHtkFrTEQ==
 
-vue-awesome-swiper@^5.0.1:
-  version "5.0.1"
-  resolved "https://mirrors.cloud.tencent.com/npm/vue-awesome-swiper/-/vue-awesome-swiper-5.0.1.tgz#ba0d20ec9ca4dff2b7b4e99592cf59308335dfcc"
-  integrity sha512-mWjFJzUqA4lG+DmsmibvMpoiBnl+IH2SSeiiQ3i5M0t1y9FknTxnGT0DsMb2YdJLgjYMEK3sYOWzqgLnZMH8Lg==
-
 vue-cropper@^1.0.2:
   version "1.0.7"
   resolved "https://mirrors.cloud.tencent.com/npm/vue-cropper/-/vue-cropper-1.0.7.tgz#be8f22bcaa012a93917ad4dc2aab1e0e8e138e1d"