فهرست منبع

编辑器内嵌的效果界面中选中四维看看场景时特殊处理。

任一存 2 سال پیش
والد
کامیت
06f090d2c3

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

@@ -81,6 +81,8 @@ export default {
       state.secondaryList = payload
       if (payload.length>0) {
         this.commit('scene/setCurrentSecondary', payload[0])
+      } else {
+        this.commit('scene/setCurrentSecondary', {})
       }
     },
     setMetaData(state, payload) {

BIN
packages/qjkankan-editor/src/assets/images/default/empty-go-4dkk.png


+ 11 - 4
packages/qjkankan-editor/src/framework/play/pano/components/list.vue

@@ -9,7 +9,7 @@
               active: currentScene.id == item.id,
               loopspan: item.sceneTitle.length > spanlength && currentScene.id == item.id,
             }" :style="{ backgroundImage: `url(${item.icon})`, opacity: item.type === '4dkk' ? 0.5 : 1, }"
-            v-for="(item, i) in currentScenesList" :key="i">
+            v-for="(item, i) in currentScenesList" :key="item.id">
             <i class="iconfont icon-edit_type_3d" :class="{ iconedit_type_panorama: item.type !== '4dkk' }"></i>
             <div>
               <span v-if="currentScene.id == item.id">{{ item.sceneTitle }}</span>
@@ -22,7 +22,7 @@
       </div>
 
       <div class="swiper-container" :style="`width:${secondaryW}px`" id="swSecondary" ref="sw1"
-        v-swiper:mySwipera="swiperOptions" v-if="secondaryList.length > 1">
+        v-swiper:mySwipera="swiperOptions" v-if="!(secondaryList.length === 1 && secondaryList[0].name === '默认二级分组')">
         <ul class="swiper-wrapper">
           <li class="swiper-slide" @click="tabSecondary(item)" :class="{
             active: currentSecondary.id == item.id,
@@ -151,10 +151,17 @@ export default {
     },
 
     tabCurrentScene(data) {
-      if (data.type !== '4dkk') {
+      if (data.type === '4dkk') {
+        if (this.scenes.some((item) => {
+          return item.type === 'pano'
+        })) {
+          return
+        } else {
+          this.$store.commit("scene/setCurrentScene", data);
+        }
+      } else {
         this.$store.commit("scene/setCurrentScene", data);
       }
-
     },
 
     tabSecondary(data) {

+ 73 - 44
packages/qjkankan-editor/src/framework/play/pano/index.vue

@@ -9,8 +9,14 @@
 
     <template v-if="showSnapshot && currentScene">
       <snapshot :showFlash="showFlash"></snapshot>
-      <button class="ui-button submit" @click="onClick">将当前视角设为初始画面</button>
+      <button class="ui-button submit set-initial-view" :class="{disable: currentScene.type === '4dkk',}" @click="onClick">将当前视角设为初始画面</button>
     </template>
+
+    <div class="btn-4dkk-tip" v-if="currentScene.type ==='4dkk'">
+      <img src="@/assets/images/default/empty-go-4dkk.png" alt="" draggable="false">
+      <div>请前往四维时代个人中心编辑场景~</div>
+      <button class="ui-button submit" @click="onClickGo4dkk">立即前往</button>
+    </div>
   </div>
 </template>
 
@@ -30,7 +36,7 @@ export default {
   data() {
     return {
       showFlash: false,
-      inter: null
+      inter: null,
     }
   },
   computed: {
@@ -58,45 +64,45 @@ export default {
         })
       }
       if (newVal.type == '4dkk') {
-        return
-      }
-
-      $("#pano").empty();
-      window.vrInitFn = () => {
-        $waiting.hide()
-        __krfn.utils.initHotspot(this.$getKrpano(), newVal && newVal.someData, true);
-        __krfn.utils.toggleHotspot(this.$getKrpano(), this.$route.name == "hotspot");
-      };
-      window.vrViewFn = () => {
-        try {
-          let tmp = newVal.initVisual;
-          this.$getKrpano().set("view.vlookat", tmp.vlookat);
-          this.$getKrpano().set("view.hlookat", tmp.hlookat);
-        } catch (error) {
-          error;
+        $("#pano").empty();
+      } else {
+        $("#pano").empty();
+        window.vrInitFn = () => {
+          $waiting.hide()
+          __krfn.utils.initHotspot(this.$getKrpano(), newVal && newVal.someData, true);
+          __krfn.utils.toggleHotspot(this.$getKrpano(), this.$route.name == "hotspot");
+        };
+        window.vrViewFn = () => {
+          try {
+            let tmp = newVal.initVisual;
+            this.$getKrpano().set("view.vlookat", tmp.vlookat);
+            this.$getKrpano().set("view.hlookat", tmp.hlookat);
+          } catch (error) {
+            error;
+          }
+        };
+
+        var settings = {
+          "events[skin_events].onxmlcomplete": "js(window.vrViewFn());",
+          "events[skin_events].onloadcomplete": "js(window.vrInitFn());",
+        };
+
+        if (newVal) {
+          removepano("#pano");
+          $waiting.show();
+          embedpano({
+            // http://oss-xiaoan.oss-cn-shenzhen.aliyuncs.com/720yun_fd_manage/fd720_Va0LrkXW3/vtour/tour.xml
+            // xml: "%HTMLPATH%/static/template/tour.xml",
+            xml: `${this.$cdn}/720yun_fd_manage/${newVal.sceneCode}/vtour/tour.xml`,
+            swf: "%HTMLPATH%/static/template/tour.swf",
+            target: "pano",
+            html5: "auto",
+            mobilescale: 1,
+            vars: settings,
+            webglsettings: { preserveDrawingBuffer: true },
+            passQueryParameters: true,
+          });
         }
-      };
-
-      var settings = {
-        "events[skin_events].onxmlcomplete": "js(window.vrViewFn());",
-        "events[skin_events].onloadcomplete": "js(window.vrInitFn());",
-      };
-
-      if (newVal) {
-        removepano("#pano");
-        $waiting.show();
-        embedpano({
-          // http://oss-xiaoan.oss-cn-shenzhen.aliyuncs.com/720yun_fd_manage/fd720_Va0LrkXW3/vtour/tour.xml
-          // xml: "%HTMLPATH%/static/template/tour.xml",
-          xml: `${this.$cdn}/720yun_fd_manage/${newVal.sceneCode}/vtour/tour.xml`,
-          swf: "%HTMLPATH%/static/template/tour.swf",
-          target: "pano",
-          html5: "auto",
-          mobilescale: 1,
-          vars: settings,
-          webglsettings: { preserveDrawingBuffer: true },
-          passQueryParameters: true,
-        });
       }
     },
     isConfirmingPosi(newVal) {
@@ -144,13 +150,13 @@ export default {
           }
         });
     },
-
     addhotspot(param) {
       __krfn.utils.addhotspot(this.$getKrpano(), param, true);
       this.$store.commit("tags/setIsConfirmingPosi", param.name);
-
+    },
+    onClickGo4dkk() {
+      window.open('/#/')
     }
-
   },
   mounted() {
     window.__krfn = __krfn;
@@ -198,7 +204,7 @@ export default {
     }
   }
 
-  .ui-button {
+  button.set-initial-view {
     position: absolute;
     bottom: 260px;
     min-width: 200px;
@@ -206,5 +212,28 @@ export default {
     transform: translateX(-50%);
     z-index: 99;
   }
+
+  .btn-4dkk-tip {
+    position: absolute;
+    bottom: 50%;
+    left: 50%;
+    transform: translateX(-50%);
+    z-index: 99;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    > img {
+      width: 120px;
+    }
+    > div {
+      color: #a3a3a3;
+      font-size: 14px;
+      white-space: pre;
+      margin-top: 1em;
+    }
+    > button {
+      margin-top: 14px;
+    }
+  }
 }
 </style>

+ 16 - 3
packages/qjkankan-editor/src/views/explanation/explanationSettings.vue

@@ -4,7 +4,14 @@
       语音讲解
       <i class="iconfont icon-material_prompt tool-tip-for-editor" v-tooltip="'您可以为当前全景图添加语音讲解音频。'"/>
     </div>
-    <button v-if="!currentScene.explanation.audioId" class="ui-button submit" @click="isShowSelectionWindow = true">
+    <button
+      v-if="!currentScene.explanation.audioId"
+      class="ui-button submit"
+      :class="{
+        disable: !currentScene || currentScene.type ==='4dkk',
+      }"
+      @click="isShowSelectionWindow = true"
+    >
       <i class="iconfont icon-editor_add"></i>
       添加音频
     </button>
@@ -22,11 +29,17 @@
 
     <div class="switch-wrapper">
       <span class="label">默认开启</span>
-      <Switcher :value="currentScene.explanation.openByDefault" @change="currentScene.explanation.openByDefault = !currentScene.explanation.openByDefault"></Switcher>
+      <Switcher
+        :disable="!currentScene || currentScene.type ==='4dkk'"
+        :value="currentScene.explanation.openByDefault" @change="currentScene.explanation.openByDefault = !currentScene.explanation.openByDefault"
+      />
     </div>
     <div class="switch-wrapper">
       <span class="label">循环播放</span>
-      <Switcher :value="currentScene.explanation.repeat" @change="currentScene.explanation.repeat = !currentScene.explanation.repeat"></Switcher>
+      <Switcher
+        :disable="!currentScene || currentScene.type ==='4dkk'"
+        :value="currentScene.explanation.repeat" @change="currentScene.explanation.repeat = !currentScene.explanation.repeat"
+      />
     </div>
 
     <div class="dialog" style="z-index: 2000" v-if="isShowSelectionWindow">

+ 1 - 1
packages/qjkankan-editor/src/views/hotspot/HotSpotList.vue

@@ -4,7 +4,7 @@
       热点设置
       <i class="iconfont icon-material_prompt tool-tip-for-editor" v-tooltip="'在全景图中添加图标热点,并设置热点的效果。'" />
     </div>
-    <button class="ui-button submit" :class="{ disable: !currentScene }" @click="open(null)">
+    <button class="ui-button submit" :class="{ disable: !currentScene || currentScene.type ==='4dkk' }" @click="open(null)">
       添加热点
     </button>