wangfumin 3 mēneši atpakaļ
vecāks
revīzija
87333e22f7

+ 11 - 2
packages/qjkankan-view/src/apis/index.js

@@ -35,13 +35,22 @@ export function getPanoInfo(ok, no) {
  */
 export function getFdkkInfo(data, ok, no) {
   // 使用环境变量判断是否为离线模式
+  console.log(data, 'config.isOfflineMode')
   if (config.isOfflineMode) {
     // 离线包环境,读取本地JSON文件
     return new Promise((resolve, reject) => {
       const vrId = data.num || browser.getURLParam("vr");
       // 构建scene.json文件的路径
-      const sceneJsonPath = `/scene_view_data/${vrId}/data/scene.json`;
-      
+      console.log(data, 'data')
+      let sceneJsonPath = ''
+      if(data.currentScene.version && data.currentScene.version == 'V4') {
+        sceneJsonPath = `/scene_view_data/${vrId}/data/scene.json`;
+        console.log(1)
+      } else { 
+        console.log(2)
+        sceneJsonPath = `/data/data${vrId}/scene.json`
+      }
+      console.log(sceneJsonPath, 'sceneJsonPath')
       fetch(sceneJsonPath)
         .then(response => response.json())
         .then(data => {

+ 2 - 2
packages/qjkankan-view/src/components/Fdkk/index.vue

@@ -79,11 +79,11 @@ const V4IframeUrl = computed(() => {
   const v4Mi = process.env.VUE_APP_DEBBUG_V4_URL;
 
   if (process.env.VUE_APP_DEBBUG_V4 == 1) {
-    return `${v4Mi}/${unref(isMobile) ? "smg" : "spg"}.html?m=${
+    return `${v4Mi}/${unref(isMobile) ? "smg" : "spc"}.html?m=${
       unref(currentScene).sceneCode
     }&fromApp=panorama&lang=${unref(lang)}&rnd=${Math.floor(Math.random() * 100000)}`;
   } else {
-    return `/${unref(isMobile) ? "smg" : "spg"}.html?m=${
+    return `/${unref(isMobile) ? "smg" : "spc"}.html?m=${
       unref(currentScene).sceneCode
     }&fromApp=panorama&lang=${unref(lang)}&rnd=${Math.floor(Math.random() * 100000)}`;
   }

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

@@ -145,7 +145,8 @@ watch(
         // console.log(newVal, "newVal");
       });
     } else {
-      getFdkkInfo({ num: newVal.sceneCode }).then(async (data) => {
+      console.log("currentScene", currentScene.value, currentScene.value.version);
+      getFdkkInfo({ num: newVal.sceneCode, currentScene: currentScene.value }).then(async (data) => {
         hadGetInfo.value = true;
 
         const isVersion = isUpgradeAdapter(data.data.isUpgrade);