gemercheung 2 yıl önce
ebeveyn
işleme
a6d29bdcf0

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

@@ -363,7 +363,7 @@ export default {
       // 热点类型相关设置项
       switch (this.hotspot.hotspotType) {
         case "scene":
-          if (!this.hotspot.secne) {
+          if (!this.hotspot.secne.id) {
             return false;
           }
           break;

+ 20 - 7
packages/qjkankan-view/src/components/assembly/MobileTags/metas/metas-imagetext.vue

@@ -11,6 +11,7 @@
           :modules="modules"
           :slides-per-view="1"
           :free-mode="true"
+          @paginationRender="handlePageRender"
         >
           <swiper-slide
             v-for="(item, index) in currentTag.imageTextInfo.imageList"
@@ -21,7 +22,7 @@
         </Swiper>
         <div class="audio-control" v-if="hasAudio">
           <ui-icon
-            @click="pauseAudio"
+            @click.prevent="pauseAudio"
             type="player_pause"
             v-if="isPlaying"
           ></ui-icon>
@@ -50,6 +51,7 @@ import {
   computed,
   onUnmounted,
   unref,
+  watchEffect,
 } from "vue";
 import { useStore } from "vuex";
 import { useI18n, getLocale } from "@/i18n";
@@ -67,10 +69,12 @@ const currentTag = computed(() => store.getters["tags/currentTag"]);
 
 const modules = ref([Pagination, Navigation]);
 const hasAudio = computed(
-  () => currentTag.value.imageTextInfo.audio.ossPath.length > 0
+  () =>
+    currentTag.value.imageTextInfo.audio.ossPath &&
+    currentTag.value.imageTextInfo.audio.ossPath.length > 0
 );
 const time = ref("00:00");
-const audioAllTime = ref("");
+const audioAllTime = ref("00:00");
 const isPlaying = ref(false);
 
 function transTime(time) {
@@ -135,6 +139,13 @@ const pauseAudio = () => {
 onUnmounted(() => {
   pauseAudio();
 });
+
+function handlePageRender(_, el) {
+  if (unref(hasAudio)) {
+    el.style.left = "20%";
+    el.style.transform = "translateX(-20%)";
+  }
+}
 </script>
 
 <style lang="scss">
@@ -175,16 +186,18 @@ onUnmounted(() => {
 
     .audio-control {
       position: absolute;
+      z-index: 10000;
       bottom: 50px;
       border-radius: 8px;
       background: rgba(0, 0, 0, 0.6);
       width: 122px;
       height: 32px;
+      word-spacing: -2px;
       background: rgba(0, 0, 0, 0.4);
       opacity: 1;
       border: 1px solid rgba(255, 255, 255, 0.2);
-      left:70%;
-      transform: translateX(-70%);
+      left: 75%;
+      transform: translateX(-75%);
       line-height: 32px;
       display: flex;
       justify-content: center;
@@ -231,8 +244,8 @@ onUnmounted(() => {
   border: 1px solid rgba(255, 255, 255, 0.2);
   color: #fff;
   border-radius: 15px;
-  left: 20%;
-  transform: translateX(-20%);
+  left: 50%;
+  transform: translateX(-50%);
   bottom: 50px;
   .swiper-pagination-total {
     color: #858586;

+ 11 - 4
packages/qjkankan-view/src/components/assembly/Tags/metas/metas-imagetext.vue

@@ -116,13 +116,14 @@
 
 <script setup>
 import { nextTick } from "process";
-import { ref, computed, unref, onMounted, onUnmounted } from "vue";
+import { ref, computed, unref, onMounted, onUnmounted, watchEffect } from "vue";
 import { useStore } from "vuex";
 const store = useStore();
 const hasAudio = computed(
-  () => currentTag.value.imageTextInfo.audio.ossPath.length > 0
+  () =>
+    currentTag.value.imageTextInfo.audio.ossPath &&
+    currentTag.value.imageTextInfo.audio.ossPath.length > 0
 );
-
 const scaleRate = ref(1);
 
 const objectFit = ref("scale-down");
@@ -204,7 +205,7 @@ function transTime(time) {
   return minute + isM0 + sec;
 }
 const time = ref("00:00");
-const audioAllTime = ref("");
+const audioAllTime = ref("00:00");
 const isPlaying = ref(false);
 onMounted(() => {
   const audio = document.querySelector("#audioTag");
@@ -253,6 +254,12 @@ const pauseAudio = () => {
 onUnmounted(() => {
   pauseAudio();
 });
+
+watchEffect(() => {
+  if (!unref(hasAudio)) {
+    debugger;
+  }
+});
 </script>
 
 <style lang="scss" scoped>