gemercheung 2 years ago
parent
commit
815a6d2036

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

@@ -59,10 +59,17 @@
             />
             <span class="count">{{ hotspot.hotspotTitle.length }}/50</span>
           </div>
-          <div class="remark">
-            {{ $i18n.t("hotspot.title_show_mode") }}
+          <div class="hotspot-show-wrapper">
+            <div class="remark">
+              {{ $i18n.t("hotspot.title_show_mode") }}
+            </div>
+            <Switcher
+              :value="tempHotpotLabelShow"
+              @change="onSwitcherChange"
+            ></Switcher>
           </div>
-          <TabbarSwitcher
+
+          <!-- <TabbarSwitcher
             class="display-mode-selector"
             :tabList="[
               // $i18n.t('hotspot.show_on_hover'),
@@ -71,7 +78,7 @@
             ]"
             :activeIdx="currentTitleDispayModeIdx"
             @select="onSelectTitleDisplayMode"
-          />
+          /> -->
           <div class="remark">
             {{ $i18n.t("hotspot.title_position") }}
           </div>
@@ -197,6 +204,7 @@ import TabbarSwitcher from "@/components/shared/TabbarSwitcher.vue";
 import TabbarSwitcherIcon from "@/components/shared/TabbarSwitcherIcon.vue";
 import hotspotTypeList from "./hotspotTypeList.js";
 import { isValidPhoneNumber } from "libphonenumber-js/max";
+import { tree } from "d3";
 
 export default {
   props: ["show", "data", "editTitle"],
@@ -209,6 +217,7 @@ export default {
   },
   data() {
     return {
+      tempHotpotLabelShow: false,
       hotspotTypeList,
       hotspotIconTypeList: [
         {
@@ -239,6 +248,18 @@ export default {
     };
   },
   watch: {
+    "hotspot.titleDisplayMode": {
+      handler(val) {
+        console.log("titleDisplayMode", val);
+        if (val === "always") {
+          this.tempHotpotLabelShow = 1;
+        }
+        if (val === "never") {
+          this.tempHotpotLabelShow = 0;
+        }
+      },
+      immediate: true,
+    },
     "hotspot.fontSize": {
       handler(val) {
         const rangeValue = val / 12;
@@ -625,6 +646,16 @@ export default {
       this.$emit("close");
       this.$emit("save", this.hotspot);
     },
+    onSwitcherChange(val) {
+      console.log("onSwitcherChange", val);
+      this.tempHotpotLabelShow = val;
+      if (val === 0) {
+        this.hotspot.titleDisplayMode = "never";
+      }
+      if (val === 1) {
+        this.hotspot.titleDisplayMode = "always";
+      }
+    },
   },
 };
 </script>
@@ -763,5 +794,14 @@ export default {
       width: 112px;
     }
   }
+  .hotspot-show-wrapper {
+    padding: 25px 0 10px 0;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    .remark {
+      margin: 0 !important;
+    }
+  }
 }
 </style>

+ 6 - 2
packages/qjkankan-view/src/hooks/useAudio.js

@@ -138,6 +138,7 @@ class AudioPlayer {
     }
 
     switchUrlSource(url, autoplay, loop) {
+        this.audio.unload();
         if ('unload' in this.audio) {
             console.log('switchUrlSource-1');
             this.audio.unload();
@@ -167,7 +168,7 @@ class AudioPlayer {
             preload: true,
             src: [this._src],
             loop: this._loop || false,
-            html5: false,
+            html5: true,
             onplay: () => {
                 this._isPlaying = true
                 this.emit('play')
@@ -220,7 +221,10 @@ class AudioPlayer {
         return this.audio.pause();
     }
     resume() {
-        return this.audio.play();
+        console.log('resume');
+        if (!this._isPlaying) {
+            return this.audio.play();
+        }
     }
     stop() {
         this.pause();

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

@@ -261,5 +261,6 @@ const handlePass = () => {
 <style lang="scss" scoped>
 .ui-view-layout {
   position: relative;
+  z-index: 0;
 }
 </style>

+ 1 - 0
packages/qjkankan-view/src/pages/showMobile.vue

@@ -259,5 +259,6 @@ const handlePass = () => {
 <style lang="scss" scoped>
 .ui-view-layout {
   position: relative;
+  z-index: 0;
 }
 </style>

+ 1 - 1
packages/qjkankan-view/src/store/modules/audio.js

@@ -138,7 +138,7 @@ export default {
         },
         playBGM({ commit, getters, state, dispatch }, type) {
             console.warn('~~playBGM~~', type);
-            debugger;
+            // debugger;
             const index = getters['currentAudio'].order;
             const order = index + 1;
             const target = getters['bgmList'].find(i => i.type === type);