gemercheung 2 anni fa
parent
commit
1fc80c9b6f

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

@@ -138,15 +138,16 @@ const handleMessage = (res) => {
     if (event == "toggleBgmStatus") {
       console.error("toggleBgmStatus", params);
       // debugger;
-      // if (params.status) {
-      //   if (unref(isHasV4BGM)) {
-      //     store.dispatch("audio/playBGM", 2);
-      //   } else {
-      //     store.dispatch("audio/playBGM", 0);
-      //   }
-      // } else {
-      //   store.dispatch("audio/pauseBGM");
-      // }
+      if (params.status) {
+        // if (unref(isHasV4BGM)) {
+        //   store.dispatch("audio/playBGM", 2);
+        // } else {
+        //   store.dispatch("audio/playBGM", 0);
+        // }
+        // store.dispatch("audio/resumeBGM");
+      } else {
+        // store.dispatch("audio/pauseBGM");
+      }
     }
 
     if (event == "autoPlayBgm") {

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

@@ -138,7 +138,8 @@ useApp().then((app) => {
       const isNotclickType = ["tag"];
       if (!isNotclickType.includes(hotspot.hotspotType)) {
         console.log("click", hotspot);
-        store.commit("functions/setPauseFrom", "");
+        // store.commit("functions/setPauseFrom", "");
+        store.dispatch("audio/pauseBGM");
         if (hotspot.hotspotType == "phone" && unref(isMobile)) {
           window.open(`tel:${hotspot.phoneInfo.phone}`, "_self");
           return;
@@ -161,7 +162,8 @@ useApp().then((app) => {
             hotspot.hotspotType == "audio" ||
             hotspot.hotspotType == "video"
           ) {
-            store.commit("functions/setPauseFrom", currentPlaying.value);
+            store.dispatch("audio/pauseBGM");
+            // store.commit("functions/setPauseFrom", currentPlaying.value);
           }
         }
       }

+ 1 - 0
packages/qjkankan-view/src/components/assembly/MobileTags/index.vue

@@ -55,6 +55,7 @@ const emit = defineEmits(["close"]);
 const close = () => {
   emit("close");
   store.commit("tags/setCurrentTag", {});
+  store.dispatch("audio/resumeBGM");
 };
 </script>
 

+ 2 - 0
packages/qjkankan-view/src/components/assembly/Tags/index.vue

@@ -35,6 +35,7 @@ import metasPhone from "./metas/metas-phone.vue";
 import { defineEmits, computed } from "vue";
 import { useStore } from "vuex";
 
+
 // import { useMusicPlayer,useSoundPlayer } from '@/utils/sound'
 // //背景音乐
 // const musicPlayer = useMusicPlayer()
@@ -52,6 +53,7 @@ const emit = defineEmits(["close"]);
 const close = () => {
   emit("close");
   store.commit("tags/setCurrentTag", {});
+  store.dispatch("audio/resumeBGM");
   // if (pauseFrom.value == "commentary") {
   //   soundPlayer.play();
   // } else if (pauseFrom.value == "bgm") {

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

@@ -164,7 +164,7 @@ export default {
             const { currentPlayer } = useAudio();
             currentPlayer.value.pause();
         },
-        ResumeBGM() {
+        resumeBGM() {
             const { currentPlayer } = useAudio();
             currentPlayer.value.play();
         },