ソースを参照

适应全景看看版本升级

任一存 2 年 前
コミット
9255d8e5b0

+ 2 - 2
.env.testdev

@@ -1,8 +1,8 @@
 VUE_APP_STATIC_DIR=showviewer
-VUE_APP_CDN=https://ossxiaoan.4dage.com
+VUE_APP_CDN=https://4dkk.4dage.com
 VUE_APP_PROXY_URL_ROOT='https://test.4dkankan.com'
 VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
-VUE_APP_URL_FILL=
+VUE_APP_URL_FILL=https://www.4dkankan.com/qjkankan
 
 # 接口请求地址
 VUE_APP_APIS_URL=https://test.4dkankan.com/

BIN
dist.zip


+ 1 - 1
src/components/Pano/index.vue

@@ -44,7 +44,7 @@ const loadScene = async (currentScene) => {
       },${initVisual ? initVisual.hlookat : "0"})`
     );
     if (app.krpanoDom) {
-      if (config.noLittleIds.includes(config.projectNum)) {
+      if (config.needLimitIds.includes(config.projectNum)) {
         app.krpanoDom.set(`view.vlookatmin`, 0);
         app.krpanoDom.set(`view.vlookatmax`, 0);
         app.krpanoDom.set(`view.limitview`, 'lookat');

+ 1 - 1
src/components/UIGather/index.vue

@@ -49,7 +49,7 @@ useApp().then((app) => {
                   showUI.value = true
             }
       })
-      app.Scene.on("sceneReady", () => {
+      app.Scene.on("ready", () => {
             showUI.value = true
       })
 })

+ 68 - 68
src/components/UIGather/mobile/index.vue

@@ -1,23 +1,23 @@
 <template>
-      <!-- <Logo /> -->
-      <Tips />
-      <!-- <Menu /> -->
-      <div v-show="showUI && !vrStatus">
-            <sceneList />
-            <div class="btn-style">
-                  <!-- <div class="menu-icon">
-                        <div @click="onIsShowList"
-                              v-if="!((metadata.catalogRoot && metadata.catalogRoot.length == 1) && scenes.length == 1 && secondaryList.length == 1)">
-                              <img :src="require(`@/assets/images/icon/${isShowScenesList ? 'function_off@2x.png' : 'function_on@2x.png'}`)"
-                                    alt="" />
-                        </div>
-                  </div> -->
-
-                  <Control />
-                  <!-- <ControlRight /> -->
-            </div>
-
+  <!-- <Logo /> -->
+  <Tips />
+  <!-- <Menu /> -->
+  <div v-show="showUI && !vrStatus">
+    <sceneList />
+    <div class="btn-style">
+      <!-- <div class="menu-icon">
+      <div @click="onIsShowList"
+        v-if="!((metadata.catalogRoot && metadata.catalogRoot.length == 1) && scenes.length == 1 && secondaryList.length == 1)">
+        <img :src="require(`@/assets/images/icon/${isShowScenesList ? 'function_off@2x.png' : 'function_on@2x.png'}`)"
+          alt="" />
       </div>
+      </div> -->
+
+      <Control />
+      <!-- <ControlRight /> -->
+    </div>
+
+  </div>
 
 </template>
 
@@ -46,69 +46,69 @@ const currentScene = computed(() => store.getters["scene/currentScene"]);
 const vrStatus = computed(() => store.getters["functions/vrStatus"]);
 
 const onIsShowList = (data) => {
-      if (showTours.value) {
-            store.commit('fdkk/setShowToursList', false)
-      }
-      store.commit("functions/setShowScenesList", !isShowScenesList.value);
+  if (showTours.value) {
+    store.commit('fdkk/setShowToursList', false)
+  }
+  store.commit("functions/setShowScenesList", !isShowScenesList.value);
 };
 
 watch(currentScene, () => {
-      if (currentScene.value.type == '4dkk' && isShowScenesList.value) {
-            let t = setTimeout(() => {
-                  clearTimeout(t)
-                  store.commit("functions/setShowScenesList", false);
-            }, 1500);
-      }
+  if (currentScene.value.type == '4dkk' && isShowScenesList.value) {
+    let t = setTimeout(() => {
+      clearTimeout(t)
+      store.commit("functions/setShowScenesList", false);
+    }, 1500);
+  }
 })
 
 useApp().then((app) => {
-      app.Scene.on("ready", (data) => {
-            if (currentScene && currentScene.value.type == '4dkk' && !showUI.value) {
-                  showUI.value = true
-            }
-      })
-      app.Scene.on("sceneReady", () => {
-            showUI.value = true
-      })
-      app.Scene.on("onExitVr", () => {
-            store.commit("functions/setVrStatus", false);
-      })
+  app.Scene.on("ready", (data) => {
+  if (currentScene && (currentScene.value.type == '4dkk' || currentScene.value.type === 'pano') && !showUI.value) {
+      showUI.value = true
+    }
+  })
+  app.Scene.on("ready", () => {
+    showUI.value = true
+  })
+  app.Scene.on("onExitVr", () => {
+    store.commit("functions/setVrStatus", false);
+  })
 })
 
 </script>
 
 <style lang="scss" scoped>
 .btn-style {
+  display: flex;
+  width: 96%;
+  max-width: 600px;
+  position: absolute;
+  left: 2%;
+  right: 2%;
+  bottom: 38px;
+  z-index: 9;
+
+  .menu-icon {
+    width: 36px;
+    height: 36px;
+
+    >div {
+      width: 100%;
+      height: 36px;
+      background: rgba(0, 0, 0, 0.4);
+      border-radius: 50%;
+      border: 1px solid rgba(255, 255, 255, 0.2);
+      backdrop-filter: blur(6px);
       display: flex;
-      width: 96%;
-      max-width: 600px;
-      position: absolute;
-      left: 2%;
-      right: 2%;
-      bottom: 38px;
-      z-index: 9;
-
-      .menu-icon {
-            width: 36px;
-            height: 36px;
-
-            >div {
-                  width: 100%;
-                  height: 36px;
-                  background: rgba(0, 0, 0, 0.4);
-                  border-radius: 50%;
-                  border: 1px solid rgba(255, 255, 255, 0.2);
-                  backdrop-filter: blur(6px);
-                  display: flex;
-                  align-items: center;
-                  justify-content: center;
-
-                  >img {
-                        width: 24px;
-                        height: 24px;
-
-                  }
-            }
+      align-items: center;
+      justify-content: center;
+
+      >img {
+      width: 24px;
+      height: 24px;
+
       }
+    }
+  }
 }
 </style>

+ 1 - 1
src/components/UIGather/mobile/tips.vue

@@ -13,7 +13,7 @@ const metadata = computed(() => store.getters["scene/metadata"]);
 const show = ref(false);
 
 useApp().then((app) => {
-  app.Scene.on("sceneReady", () => {
+  app.Scene.on("ready", () => {
     console.log(metadata.value.isRemind);
     let locoR = "localRemind" + metadata.value.id;
     if (metadata.value.isRemind) {

+ 1 - 1
src/components/UIGather/tips.vue

@@ -13,7 +13,7 @@ const metadata = computed(() => store.getters["scene/metadata"]);
 const show = ref(false);
 
 useApp().then((app) => {
-  app.Scene.on("sceneReady", () => {
+  app.Scene.on("ready", () => {
     console.log(metadata.value.isRemind);
     let locoR = "localRemind" + metadata.value.id;
     if (metadata.value.isRemind) {

+ 1 - 1
src/pages/show.vue

@@ -187,7 +187,7 @@ onMounted(async () => {
     }
 
     if (isHavePano) {
-      app.Scene.on("sceneReady", () => {
+      app.Scene.on("ready", () => {
         if (app.krpanoDom) {
           let defaultMask = `%SWFPATH%/skin/masking_${lang}.png`;
 

+ 1 - 1
src/pages/showMobile.js

@@ -11,7 +11,7 @@ import Deferred from "@/utils/Deferred";
 import store from '../store'
 import VueLazyLoad from 'vue3-lazyload'
 
-console.log('2023.5.15.18.21');
+console.log('2023.06.28.11.09');
 
 let App;
 if (

+ 45 - 4
src/pages/showMobile.vue

@@ -81,6 +81,48 @@ onMounted(async () => {
     return;
   }
   getPanoInfo().then(async (data) => {
+
+    /**
+     * data downgrade
+     */
+    if (data.isShowOpeningAnimation) {
+      switch (data.openingAnimationType) {
+        case '1':
+        data.openingAnimationType = '小行星开场'
+        break;
+        case '2':
+        data.openingAnimationType = '小行星巡游开场'
+        break;
+        case '3':
+        data.openingAnimationType = '小行星缩放开场'
+        break;
+        case '4':
+        data.openingAnimationType = '水平巡游开场'
+        break;
+        case '5':
+        data.openingAnimationType = '水晶球开场'
+        break;
+        default:
+        break;
+      }
+    }
+    if (Array.isArray(data.customButton) && data.customButton.length) {
+      for (const iterator of data.customButton) {
+        if (iterator.name === 'phone') {
+          iterator.name = '电话'
+        } else if (iterator.name === 'link') {
+          iterator.name = '链接'
+        }
+
+        if (iterator.openMethod === '_self') {
+          iterator.openMethod = '弹出层打开'
+        } else if (iterator.openMethod === '_blank') {
+          iterator.openMethod = '新窗口打开'
+        }
+      }
+    }
+    
+    
     isShowOpeningAnimation.value = Number(data.isShowOpeningAnimation);
     store.commit("scene/setScenes", data.scenes);
     store.commit(
@@ -190,7 +232,7 @@ onMounted(async () => {
         "skin_settings.littleplanetintro":
           fixOpening[data.openingAnimationType || "小行星开场"],
         // "skin_settings.lptswitch": unref(isShowOpeningAnimation),
-        "skin_settings.lptswitch": !config.noLittleIds.includes(config.projectNum),
+        "skin_settings.lptswitch": !config.needLimitIds.includes(config.projectNum),
       },
       passQueryParameters: true,
     });
@@ -202,11 +244,10 @@ onMounted(async () => {
     }
 
     if (isHavePano) {
-      app.Scene.on("sceneReady", () => {
-        console.log('sceneReady');
+      app.Scene.on("ready", () => {
         if (app.krpanoDom) {
           let defaultMask = `%SWFPATH%/skin/masking_${lang}.png`;
-          if (config.noLittleIds.includes(config.projectNum)) {
+          if (config.needLimitIds.includes(config.projectNum)) {
             app.krpanoDom.set(`view.vlookatmin`, 0);
             app.krpanoDom.set(`view.vlookatmax`, 0);
             app.krpanoDom.set(`view.limitview`, 'lookat');

+ 1 - 1
src/sdk/QJKanKan/modules/Scene.js

@@ -27,7 +27,7 @@ export default class Scene extends Emiter {
   }
 
   sceneReady() {
-    this.emit("sceneReady");
+    this.emit("sceneReady"); // 看起来,使用新版本(2023.6.27)的全景数据时,不会再运行到这里了。
   }
 
   async start() {

+ 1 - 1
src/utils/config.js

@@ -25,7 +25,7 @@ const config = {
     // 无限滚动列表的每页数据量
     PAGE_SIZE: 20,
     // 需要限制视角可变范围的场景
-    noLittleIds: [
+    needLimitIds: [
       'WK1656467989114929152',
       'WK1656877437742497792',
       'WK1656904911083814912',