gemercheung 2 年 前
コミット
2188153d2e

+ 1 - 1
packages/qjkankan-editor/.env.testprod

@@ -7,4 +7,4 @@ VUE_APP_PROXY_URL_ROOT='https://test.4dkankan.com'
 VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
 VUE_APP_ORIGIN=
 VUE_APP_URL_FILL=/qjkankan
-VUE_APP_DEBBUG_FLAG=0510-01
+VUE_APP_DEBBUG_FLAG=0511-01

+ 11 - 5
packages/qjkankan-editor/src/core/hotspot.js

@@ -38,7 +38,16 @@ const convertBaseStyle = (dest, origin) => {
         // normal
         dest.style.fontSize = origin.fontSize
         dest.style.position = origin.titlePosition
-
+        // 兼容旧数据
+ 
+        if ('visible' in origin && typeof origin.visible == "boolean") {
+            dest.visible = origin.visible ? 0 : 1
+            origin.titleDisplayMode = origin.visible ? 'always' : 'never'
+            delete origin.visible
+            // origin.visible = dest.visible
+            origin.titleDisplayMode = ''
+            dest.style.position = "top"
+        }
         if (origin && origin.titleDisplayMode == "always") {
             dest.visible = 0
         }
@@ -48,10 +57,7 @@ const convertBaseStyle = (dest, origin) => {
         if (origin && origin.titleDisplayMode == "hover") {
             dest.visible = 2
         }
-        if ('visible' in origin && typeof origin.visible == "boolean") {
-            dest.visible = origin.visible ? 0 : 1
-            dest.style.position = "top"
-        }
+
         dest.style.borderColor = '';
         dest.style.fillColor = 'rgba(0,0,0,0.8)';
         dest.style.textColor = 'rgba(255,255,255,1)';

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

@@ -250,7 +250,7 @@ export default {
     hotspot: {
       handler(val) {
         // console.error("this.hotspot", val);
-        // console.error("hotspot", val);
+        console.warn("hotspot", val);
         this.$bus.emit("edithotspot", val);
         // console.log("this.$bus", this.$bus);
         // this.$getKrpano().call("removeJQHotspot(" + val.name + ");");

+ 1 - 1
packages/qjkankan-view/.env.testprod

@@ -6,4 +6,4 @@ VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
 VUE_APP_URL_FILL=/qjkankan
 # 接口请求地址
 VUE_APP_APIS_URL=https://test.4dkankan.com/
-VUE_APP_DEBBUG_FLAG=0509-01
+VUE_APP_DEBBUG_FLAG=0511-02

+ 4 - 1
packages/qjkankan-view/src/components/UIGather/control.vue

@@ -155,7 +155,10 @@ const fdkkmetadata = computed(() => store.getters["fdkk/metadata"]);
 const fdkkBGM = computed(() => store.getters["fdkk/fdkkBGM"]);
 
 const setExplanation = () => {
-  if ("audioUrl" in currentScene.value) {
+  if (
+    "explanation" in currentScene.value &&
+    "audioUrl" in currentScene.value.explanation
+  ) {
     let { audioUrl, openByDefault, repeat } = currentScene.value.explanation;
     showCommentaryPlaying.value = false;
     store.commit("functions/setCommentaryUrl", {

+ 4 - 1
packages/qjkankan-view/src/components/UIGather/mobile/control.vue

@@ -35,7 +35,10 @@ const isShowCover = computed(
 );
 
 const setExplanation = () => {
-  if ("audioUrl" in currentScene.value) {
+  if (
+    "explanation" in currentScene.value &&
+    "audioUrl" in currentScene.value.explanation
+  ) {
     let { audioUrl, openByDefault, repeat } = currentScene.value.explanation;
     store.commit("functions/setCommentaryUrl", {
       src: audioUrl,

+ 1 - 1
packages/qjkankan-view/src/components/assembly/Opening.vue

@@ -106,7 +106,7 @@ import { useApp } from "@/app";
 import { useI18n, getLocale } from "@/i18n";
 
 const { t } = useI18n({ useScope: "global" });
-const zIndex = ref(1);
+const zIndex = ref(1000);
 const useZIndex = () => {
   zIndex.value++;
   return unref(zIndex);

+ 0 - 337
packages/qjkankan-view/src/components/assembly/OpeningMobile copy.vue

@@ -1,337 +0,0 @@
-<template>
-  <!-- 视频 -->
-  <div
-    class="videocon"
-    v-if="coverData.coverSelect.indexOf('video') > -1 && showVideo"
-    :style="{
-      backgroundColor: `${coverData.videoColorSelec}`,
-    }"
-  >
-    <video
-      v-if="coverData.videoMo"
-      x5-playsinline="true"
-      playsinline="true"
-      webkit-playsinline="true"
-      class="video"
-      ref="openvideo$"
-      preload
-      autoplay
-      :poster="coverData.videoMoIcon"
-      :class="coverData.videoMoLoc == 'center' ? 'contain' : 'cover'"
-      :src="coverData.videoMo"
-      :controls="Boolean(coverData.coverVideoControl)"
-      muted
-    ></video>
-
-    <img
-      v-show="playing"
-      @click.stop="bofang"
-      class="bofang"
-      :src="require('@/assets/images/default/bofang.png')"
-      alt=""
-    />
-
-    <div @click.stop="jumpVideo" class="jump">
-      {{
-        countdownVideo > 0
-          ? $t("common.jumpTips", { second: countdownVideo })
-          : $t("common.jump")
-      }}
-    </div>
-  </div>
-
-  <!-- 图片 -->
-
-  <div
-    class="imgcon"
-    v-if="coverData.coverSelect.toLowerCase().indexOf('img') > -1 && showImg"
-    @click="closeImg"
-  >
-    <div
-      @click="closeImg"
-      class="image-front"
-      :style="{
-        backgroundImage: `url(${coverData.coverPc})`,
-        backgroundSize: coverData.coverMoLoc == 'center' ? 'contain' : 'cover',
-      }"
-    ></div>
-    <div
-      class="img-background"
-      v-if="coverData.coverMoLoc !== 'full'"
-      :style="{
-        backgroundImage:
-          coverData.coverImgBac == 'imgTile'
-            ? `url(${coverData.coverBac})`
-            : `none`,
-        backgroundColor:
-          coverData.coverImgBac == 'imgTile'
-            ? `none`
-            : `${coverData.imgColorSelec}`,
-      }"
-    ></div>
-    <div @click.stop="closeImg" class="jump">
-      {{
-        countdownImg > 0
-          ? $t("common.jumpTips", { second: countdownImg })
-          : $t("common.jump")
-      }}
-    </div>
-  </div>
-</template>
-<script setup>
-import { ref, watch, computed, onMounted, defineProps, unref } from "vue";
-import { useStore } from "vuex";
-import { useApp } from "@/app";
-import { useI18n, getLocale } from "@/i18n";
-
-const { t } = useI18n({ useScope: "global" });
-
-const props = defineProps({
-  coverData: {
-    type: [Boolean, Object],
-    default: () => {
-      return {};
-    },
-  },
-});
-const store = useStore();
-const openvideo$ = ref(null);
-const playing = ref(true);
-
-const show = ref(true);
-const countdownImg = ref(3);
-const countdownVideo = ref(3);
-const timer = ref(null);
-
-const showVideo = ref(true);
-const showImg = ref(true);
-
-const currentScene = computed(() => store.getters["scene/currentScene"]);
-
-const closeImg = (isCall = false) => {
-  useApp().then((app) => {
-    showImg.value = false;
-    if (props.coverData.coverSelect.toLowerCase().indexOf("and") > -1) {
-      if (props.coverData.coverImageOrder == "later") {
-        showVideo.value = true;
-        showVideoDaoji();
-      }
-      app.render();
-    } else {
-      app.render();
-    }
-  });
-};
-
-const closeVideo = (isCall = false) => {
-  useApp().then((app) => {
-    showVideo.value = false;
-    if (!isCall) {
-      app.render();
-    }
-  });
-};
-
-const showImgDaoji = (cb = () => {}) => {
-  timer.value = setInterval(() => {
-    countdownImg.value--;
-    if (countdownImg.value == 0) {
-      clearInterval(timer.value);
-      timer.value = null;
-      cb();
-
-      return;
-    }
-  }, 1000);
-};
-
-const showVideoDaoji = (isCall = false) => {
-  timer.value = setInterval(() => {
-    countdownVideo.value--;
-    if (countdownVideo.value == 0) {
-      clearInterval(timer.value);
-      timer.value = null;
-      return;
-    }
-  }, 1000);
-};
-
-const jumpVideo = (isCall = false) => {
-  closeVideo(isCall);
-  if (isCall) {
-    showImg.value = true;
-    showImgDaoji();
-  }
-};
-
-// 执行图片封面
-const executeImg = () => {
-  showImgDaoji(() => {
-    closeImg();
-  });
-};
-
-onMounted(() => {
-  console.log("coverData", unref(props.coverData));
-  switch (true) {
-    case props.coverData.coverSelect.toLowerCase().indexOf("and") > -1:
-      if (props.coverData.coverImageOrder == "before") {
-        // 倒计时结束需要唤起图片
-        showVideoDaoji(true);
-        showImg.value = false;
-      } else {
-        showImgDaoji(true);
-        showVideo.value = false;
-      }
-
-      break;
-    case props.coverData.coverSelect.toLowerCase().indexOf("video") > -1:
-      showVideoDaoji(() => {
-        props.coverData.coverVideoInWay == 1 && closeVideo();
-      });
-      break;
-    case props.coverData.coverSelect.toLowerCase().indexOf("img") > -1:
-      showImgDaoji(() => {
-        props.coverData.coverImageInWay == 1 && closeImg();
-      });
-      break;
-    default:
-      break;
-  }
-  if (props.coverData.coverSelect) {
-  }
-
-  if (openvideo$.value) {
-    openvideo$.value.addEventListener("ended", () => {
-      if (props.coverData.coverVideoInWay) {
-        closeVideo();
-      }
-    });
-
-    openvideo$.value.addEventListener("playing", () => {
-      if (playing.value) {
-        playing.value = false;
-      }
-    });
-
-    openvideo$.value.addEventListener("pause", () => {
-      if (!playing.value) {
-        playing.value = true;
-      }
-    });
-
-    document.addEventListener(
-      "WeixinJSBridgeReady",
-      () => {
-        console.log("WeixinJSBridgeReady", openvideo$.value);
-        openvideo$.value.play();
-      },
-      false
-    );
-  }
-}),
-  useApp().then((app) => {
-    app.Scene.on("ready", () => {
-      if (show.value) {
-        show.value = false;
-      }
-    });
-  });
-</script>
-<style lang="scss" scoped>
-.imgcon,
-.videocon {
-  position: fixed;
-  left: 0;
-  right: 0;
-  top: 0;
-  bottom: 0;
-  width: 100%;
-  height: 100%;
-}
-
-.imgcon {
-  background-position: center;
-  z-index: 10;
-  .image-front,
-  .img-background {
-    background-position: center;
-    width: 100%;
-    height: 100%;
-    position: absolute;
-
-    top: 0;
-    z-index: 1;
-    bottom: 0;
-    left: 0;
-  }
-  .img-background {
-    background-repeat: repeat;
-  }
-  .image-front {
-    z-index: 10;
-  }
-}
-
-.videocon {
-  text-align: center;
-
-  > video {
-    max-width: inherit;
-    height: auto;
-    min-height: 100%;
-    top: 50%;
-    left: 50%;
-    z-index: 99;
-    display: inline-block;
-    transform: translate(-50%, -50%);
-    position: absolute;
-  }
-
-  .contain {
-    height: 100%;
-  }
-
-  .cover {
-    height: 100%;
-    width: 100%;
-    object-fit: cover;
-  }
-
-  .bofang {
-    position: absolute;
-    top: 50%;
-    transform: translate(-50%, -50%);
-    left: 50%;
-    width: 80px;
-    height: 80px;
-    z-index: 99999;
-    pointer-events: none;
-  }
-}
-
-.zidxhigh {
-  z-index: 99;
-}
-
-.jump {
-  position: absolute;
-  right: 15px;
-  top: 20px;
-  background: rgba(255, 255, 255, 0.5);
-  text-align: center;
-  line-height: 28px;
-  font-size: 16px;
-  z-index: 999;
-  color: #333333;
-  border-radius: 1px;
-  padding: 4px 12px;
-  cursor: pointer;
-}
-
-@keyframes loading {
-  100% {
-    left: -900px;
-  }
-}
-</style>

+ 1 - 1
packages/qjkankan-view/src/components/assembly/OpeningMobile.vue

@@ -109,7 +109,7 @@ import { useApp } from "@/app";
 import { useI18n, getLocale } from "@/i18n";
 
 const { t } = useI18n({ useScope: "global" });
-const zIndex = ref(1);
+const zIndex = ref(1000);
 const useZIndex = () => {
   zIndex.value++;
   return unref(zIndex);

+ 2 - 1
packages/qjkankan-view/src/pages/show.vue

@@ -189,7 +189,7 @@ onMounted(async () => {
       },
       passQueryParameters: true,
     });
-    console.log("gemer", currentScene.value.icon);
+
 
     coverInfo.value = data.coverInfo || {};
     app.Scene.lock();
@@ -199,6 +199,7 @@ onMounted(async () => {
     }
 
     if (isHavePano) {
+
       app.Scene.on("sceneReady", () => {
         if (app.krpanoDom) {
           let defaultMask = `%SWFPATH%/skin/masking_${lang}.png`;

+ 24 - 2
packages/qjkankan-view/src/store/modules/scene.js

@@ -1,3 +1,24 @@
+
+/**
+ * 兼容自定主义按键为中文的处理器
+ */
+const covertCustomButton = (data) => {
+  return data.map(item => {
+    if ('type' in item) {
+      if (item.type == '链接') item.type = 'link'
+      if (item.type == '电话') item.type = 'phone'
+
+    }
+    if ('openMethod' in item) {
+      if (item.openMethod == '弹出层打开') item.openMethod = '_self'
+      if (item.openMethod == '新窗口打开') item.openMethod = '_target'
+    }
+    console.log('当前转换数据!',item);
+    return item
+  })
+
+}
+
 export default {
   namespaced: true,
   state() {
@@ -44,9 +65,9 @@ export default {
       let metadata = getters.metadata
       if (metadata.customButton) {
         let temp = JSON.parse(JSON.stringify(metadata.customButton))
-        return temp.find(item => item.type == 'link')
+        const res = covertCustomButton(temp);
+        return res.find(item => item.type == 'link')
       }
-
       return {}
     },
 
@@ -56,6 +77,7 @@ export default {
       if (metadata.customButton) {
         console.log(metadata.customButton);
         let temp = JSON.parse(JSON.stringify(metadata.customButton))
+        const res = covertCustomButton(temp);
         return temp.find(item => item.type == 'phone')
       }