gemercheung 2 năm trước cách đây
mục cha
commit
6ac646effb

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

@@ -7,5 +7,5 @@ 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=0615-01
-VUE_APP_DEBBUG_NOTIFY=1
+VUE_APP_DEBBUG_FLAG=0615-04
+VUE_APP_DEBBUG_NOTIFY=0

+ 47 - 8
packages/qjkankan-editor/src/views/base/Toolbar.vue

@@ -37,7 +37,7 @@
                 v-model.trim="info.name"
                 @input="emojistr"
                 @keydown.enter="onTitleInputEnter"
-                type="text"
+                type="textarea"
                 autocomplete="new-password"
                 maxlength="50"
                 :placeholder="$i18n.t(`edit_settings.work_placeholder`)"
@@ -273,18 +273,52 @@ export default {
   .uc-r {
     width: 100%;
     max-width: 660px;
+    // > .title-input-wrapper {
+    //   position: relative;
+    //   border: 1px solid rgba(151, 151, 151, 0.2);
+    //   padding: 0 10px;
+    //   background: #252526;
+    //   border-radius: 2px;
+    //   height: 36px;
+    //   width: 100%;
+    //   &:focus-within {
+    //     border-color: #0076f6;
+    //   }
+    //   > input {
+    //     border: none;
+    //     background: transparent;
+    //     outline: none;
+    //     height: 100%;
+    //     width: calc(100% - 50px);
+    //     padding: 0;
+    //     color: #fff;
+    //     letter-spacing: 1px;
+    //     font-size: 14px;
+    //   }
+    //   > .count {
+    //     position: absolute;
+    //     top: 50%;
+    //     transform: translateY(-50%);
+    //     right: 16px;
+    //     font-size: 14px;
+    //     color: rgba(255, 255, 255, 0.2);
+    //   }
+    // }
+
     > .title-input-wrapper {
       position: relative;
       border: 1px solid rgba(151, 151, 151, 0.2);
-      padding: 0 10px;
-      background: #252526;
+      padding: 5px 0;
+      background: #1a1b1d;
       border-radius: 2px;
-      height: 36px;
+      min-height: 36px;
       width: 100%;
+      margin-top: 18px;
       &:focus-within {
         border-color: #0076f6;
       }
-      > input {
+      > input,
+      textarea {
         border: none;
         background: transparent;
         outline: none;
@@ -295,11 +329,16 @@ export default {
         letter-spacing: 1px;
         font-size: 14px;
       }
+      &.has-textarea {
+        // min-height: 72px;
+        height: auto;
+        position: relative;
+      }
       > .count {
         position: absolute;
-        top: 50%;
-        transform: translateY(-50%);
-        right: 16px;
+        bottom: 10px;
+        // transform: translateY(-50%);
+        right: 10px;
         font-size: 14px;
         color: rgba(255, 255, 255, 0.2);
       }

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

@@ -61,7 +61,7 @@
             ></Switcher>
           </div>
 
-          <div class="title-input-wrapper">
+          <!-- <div class="title-input-wrapper">
             <input
               v-model.trim="hotspot.hotspotTitle"
               type="text"
@@ -69,6 +69,19 @@
               :placeholder="$i18n.t('hotspot.title_placeholder')"
             />
             <span class="count">{{ hotspot.hotspotTitle.length }}/50</span>
+          </div> -->
+          <div class="title-input-wrapper has-textarea">
+            <Input
+              ref="titleTextarea"
+              class="titleTextarea"
+              v-model="hotspot.hotspotTitle"
+              type="textarea"
+              maxlength="50"
+              :autosize="{ minRows: 1 }"
+              :placeholder="$i18n.t('hotspot.title_placeholder')"
+            />
+
+            <span class="count">{{ hotspot.hotspotTitle.length }}/50</span>
           </div>
 
           <!-- <TabbarSwitcher
@@ -205,9 +218,9 @@ import Switcher from "@/components/shared/Switcher.vue";
 import TabbarSwitcher from "@/components/shared/TabbarSwitcher.vue";
 import TabbarSwitcherIcon from "@/components/shared/TabbarSwitcherIcon.vue";
 import hotspotTypeList from "./hotspotTypeList.js";
+import { Input } from "element-ui";
 import { isValidPhoneNumber } from "@/utils/other.js";
 // import isValidPhoneNumber from "is-chinese-phone-number";
-import { tree } from "d3";
 
 export default {
   props: ["show", "data", "editTitle"],
@@ -217,6 +230,7 @@ export default {
     Switcher,
     TabbarSwitcher,
     TabbarSwitcherIcon,
+    Input,
   },
   data() {
     return {
@@ -720,10 +734,10 @@ export default {
       > .title-input-wrapper {
         position: relative;
         border: 1px solid rgba(151, 151, 151, 0.2);
-        padding: 0 16px;
+        padding: 0 ;
         background: #1a1b1d;
         border-radius: 2px;
-        height: 36px;
+        min-height: 36px;
         width: 100%;
         margin-top: 18px;
         &:focus-within {
@@ -805,3 +819,12 @@ export default {
   }
 }
 </style>
+<style lang="less">
+.title-input-wrapper {
+  .el-textarea__inner {
+    background-color: transparent;
+    color: white;
+    border: none;
+  }
+}
+</style>

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

@@ -7,7 +7,7 @@ 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=0615-01
+VUE_APP_DEBBUG_FLAG=0616-01
 VUE_APP_DEBBUG_NOTIFY=1
 VUE_APP_DEBBUG_V4=0
 VUE_APP_DEBBUG_V4_URL="http://192.168.0.186:8081"

+ 0 - 1
packages/qjkankan-view/public/showviewer/lib/krpano/skin/vtourskin.xml

@@ -1280,7 +1280,6 @@
 	<action name="animationComplete">
 			set(control.usercontrol, all);
 			js_sceneReadyCallback();
-			showlog();
 			trace('vlookat',get(view.vlookat));
 			trace('hlookat',get(view.hlookat));
 			trace('org_vlookat',get(view.org_vlookat));

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

@@ -119,7 +119,9 @@ const handleMessage = (res) => {
     if (event == "fdkkBgmLink") {
       const url = params.music || "";
       console.log("fdkkBgmLink", url);
+      store.dispatch("audio/setLock", false);
       store.dispatch("audio/initV4BGM", url);
+
       // loading完毕
       getApp().Scene.emit("ready");
     }

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

@@ -89,12 +89,13 @@ watch(
     } else {
       getFdkkInfo({ num: newVal.sceneCode }).then(async (data) => {
         hadGetInfo.value = true;
+
         const isVersion = isUpgradeAdapter(data.data.isUpgrade);
         console.log("当前-version", isVersion);
+        store.dispatch("audio/setLock", true);
         store.commit("scene/setFdkkCurrentVersion", isVersion);
         // v3
         if (isVersion === "V3") {
-          store.dispatch("audio/setLock", true);
           let flag =
             data.data.bgMusic &&
             data.data.bgMusic != "0" &&
@@ -111,8 +112,6 @@ watch(
           } else {
             setTimeout(() => store.dispatch("audio/pauseBGM"), 100);
           }
-        } else {
-          store.dispatch("audio/setLock", false);
         }
       });
     }

+ 3 - 0
packages/qjkankan-view/src/components/UIGather/list.vue

@@ -220,6 +220,9 @@ const loadList = () => {
           centerInsufficientSlides: true,
           centeredSlidesBounds: true,
           freeMode: true,
+          // slidesPerView : 6,
+          slidesPerGroup: 10,
+          // resistanceRatio: 0,
         });
       });
     }, 100);

+ 16 - 6
packages/qjkankan-view/src/components/UIGather/mobile/control.pano.vue

@@ -137,22 +137,33 @@ const onLink = () => {
   }
 };
 const onIsBGM = () => {
-  if (!unref(isPlayNormalBGM)) {
-    store.dispatch("audio/playBGM", 0);
-  } else {
-    if (unref(isCurrentPlaying)) {
-      store.dispatch("audio/pauseBGM");
+  if (unref(isHasV4BGM)) {
+    if (!unref(isCurrentPlaying)) {
+      store.dispatch("audio/playBGM", 2);
     } else {
+      store.dispatch("audio/pauseBGM");
+    }
+  } else {
+    if (!unref(isPlayNormalBGM)) {
+      console.log("从其他切过来");
       store.dispatch("audio/playBGM", 0);
+    } else {
+      if (!unref(isCurrentPlaying)) {
+        store.dispatch("audio/playBGM", 0);
+      } else {
+        store.dispatch("audio/pauseBGM");
+      }
     }
   }
 };
+
 const onIsAutoRotate = (data) => {
   store.commit("functions/setAutoRotate", !isAutoRotate.value);
 };
 
 const onIsCommentary = () => {
   if (!unref(isPlayExplanationBGM)) {
+    console.log("从其他切过来");
     store.dispatch("audio/playBGM", 3);
   } else {
     if (unref(isCurrentPlaying)) {
@@ -162,7 +173,6 @@ const onIsCommentary = () => {
     }
   }
 };
-
 const onVR = (data) => {
   useApp().then((app) => {
     console.log(app.krpanoDom.get("webvr"));

+ 21 - 11
packages/qjkankan-view/src/hooks/useAudio.js

@@ -13,7 +13,7 @@ const currentAudio = computed(() => store.getters["audio/currentAudio"]);
 const currentAudioTemp = ref("");
 const isDoneforCover = computed(() => store.getters["scene/isDoneforCover"]);
 const currentScene = computed(() => store.getters["scene/currentScene"]);
-
+const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
 const isShowCover = computed(
   () => store.getters["scene/metadata"].coverInfo.isShowCover === 1 || false
 );
@@ -90,7 +90,7 @@ function initAudioPlayer() {
       store.dispatch("audio/updatePlayerStatus", player.isPlaying);
     });
     player.on("end", () => {
-      console.log("end--33", player.isPlaying);
+      console.log("end--33", player._loop);
       store.dispatch("audio/updatePlayerStatus", player.isPlaying);
     });
     window.store = store;
@@ -136,14 +136,15 @@ class AudioPlayer {
     this._loop = options.loop;
     this._autoplay = options.autoplay;
     this._isPlaying = false;
+    this._firstPlay = false;
     this._lock = false;
     const emitter = mitt();
     Object.keys(emitter).forEach((method) => {
       this[method] = emitter[method];
     });
     this.audio = null;
-    this.switchUrl = debounce(this.switchUrlSource, 100).bind(this);
-    this.play = debounce(this.toPlay, 100).bind(this);
+    this.switchUrl = debounce(this.switchUrlSource, 80).bind(this);
+    this.play = debounce(this.toPlay, 80).bind(this);
     this.init();
   }
   get isPlaying() {
@@ -151,7 +152,6 @@ class AudioPlayer {
   }
 
   switchUrlSource(url, autoplay, loop) {
-    this.audio.unload();
     if ("unload" in this.audio) {
       console.log("switchUrlSource-1");
       this.audio.unload();
@@ -159,9 +159,10 @@ class AudioPlayer {
       console.log("switchUrlSource-2");
       return;
     }
-    console.log("switchUrlSource", url);
+    console.log("switchUrlSource", url, autoplay, loop);
     this._isPlaying = false;
     // this._lock = false;
+    // this._firstPlay = false;
     this._autoplay = autoplay || false;
     this._loop = loop || false;
     this._src = url;
@@ -192,6 +193,7 @@ class AudioPlayer {
       },
       onend: () => {
         this._isPlaying = false;
+        console.log("onend", this._loop);
         if (!this._loop) {
           this.audio.unload();
         }
@@ -204,8 +206,9 @@ class AudioPlayer {
     const onclick = () => {
       $player.removeEventListener("click", onclick);
       $player.removeEventListener("touchstart", onclick);
-      //判断是否第一次进入或者是否已点击过
-      if (CLICKFIRST) {
+      //判断是否第一次进入或者是否已点击过 或已自动播放过。
+      if (CLICKFIRST || this._isPlaying) {
+        console.log("已点击过或自动播放中");
         return;
       }
       CLICKFIRST = true;
@@ -218,11 +221,17 @@ class AudioPlayer {
   async toPlay() {
     try {
       if (!this._isPlaying && !this._lock) {
-        console.log("play---1", this._autoplay, this._lock);
-        if (this._autoplay) {
+        // console.log("play---1", this._autoplay, this._lock, this._firstPlay);
+        console.log(
+          `playStatus: audioplay->${this._autoplay},lock:${this._lock},firstPlay:${this._firstPlay}`
+        );
+        if (this._autoplay || this._firstPlay) {
           await this.audio.play();
         } else {
-          //默认不自动播放重置状态
+          //默认不自动播放重置状态并记录已播放过
+          if (CLICKFIRST) {
+            this._firstPlay = true;
+          }
           this._isPlaying = false;
           store.dispatch("audio/updatePlayerStatus", false);
         }
@@ -260,6 +269,7 @@ class AudioPlayer {
   lock() {
     console.log("audio-lock");
     this._lock = true;
+    this.pause();
   }
   unlock() {
     console.log("audio-unlock");

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

@@ -1,210 +1,216 @@
-import { useAudio } from '@/hooks/useAudio';
-import { unref } from 'vue';
+import { useAudio } from "@/hooks/useAudio";
+import { unref } from "vue";
 
-const resourceURL = process.env.VUE_APP_RESOURCE_URL
+const resourceURL = process.env.VUE_APP_RESOURCE_URL;
 
 export default {
-    namespaced: true,
-    state() {
-        return {
-            normalBGM: {
-                url: "",
-                isAuto: false,
-                type: 0,
-                order: 0,
-                repeat: true,
-            }, // 一般背景音乐
-            // appBGM: {
-            //     url: "",
-            //     isAuto: false,
-            //     order: 0
-            // }, // 一般背景音乐
-            v3BGM: {
-                url: "",
-                isAuto: false,
-                type: 1,
-                order: 9,
-                repeat: false,
-                isExist: false,
-                isPlayIng: false,
-            }, // v3背景音乐
-            v4BGM: {
-                url: "",
-                type: 2,
-                isAuto: false,
-                order: 10,
-                repeat: false,
-            }, // v4背景音乐
-            explanationBGM: {
-                url: "",
-                type: 3,
-                isAuto: false,
-                order: 11,
-                repeat: false,
-            }, //解说音乐
-            currentPlaying: false
-        }
+  namespaced: true,
+  state() {
+    return {
+      normalBGM: {
+        url: "",
+        isAuto: false,
+        type: 0,
+        order: 0,
+        repeat: true,
+      }, // 一般背景音乐
+      // appBGM: {
+      //     url: "",
+      //     isAuto: false,
+      //     order: 0
+      // }, // 一般背景音乐
+      v3BGM: {
+        url: "",
+        isAuto: false,
+        type: 1,
+        order: 9,
+        repeat: false,
+        isExist: false,
+        isPlayIng: false,
+      }, // v3背景音乐
+      v4BGM: {
+        url: "",
+        type: 2,
+        isAuto: false,
+        order: 10,
+        repeat: false,
+      }, // v4背景音乐
+      explanationBGM: {
+        url: "",
+        type: 3,
+        isAuto: false,
+        order: 11,
+        repeat: false,
+      }, //解说音乐
+      currentPlaying: false,
+    };
+  },
+  getters: {
+    bgmList: (state) => [
+      state.normalBGM,
+      state.v3BGM,
+      state.v4BGM,
+      state.explanationBGM,
+    ],
+    currentAudio: (_, getters) => {
+      const arr = Array.from(getters.bgmList)
+        .filter((i) => i.url && i.type !== 1)
+        .sort((a, b) => b.order - a.order);
+      return arr.length > 0 ? arr[0] : false;
+    },
+    currentPlayer: () => {
+      const { currentPlayer } = useAudio();
+      return unref(currentPlayer);
     },
-    getters: {
-        bgmList: (state) => [state.normalBGM, state.v3BGM, state.v4BGM, state.explanationBGM],
-        currentAudio: (_, getters) => {
-            const arr = Array.from(getters.bgmList).filter(i => i.url && i.type !== 1).sort((a, b) => b.order - a.order)
-            return arr.length > 0 ? arr[0] : false;
-        },
 
-        isCurrentPlaying: (state) => state.currentPlaying,
-        isHasNormalBGM: (state) => {
-            return state.normalBGM.url.length > 0
-        },
-        isHasV3BGM: (state) => {
-            return state.v3BGM.isExist
-        },
-        isHasV4BGM: (state) => {
-            return state.v4BGM.url.length > 0
-        },
-        isHasExplanationBGM: (state) => {
-            return state.explanationBGM.url.length > 0
-        },
-        isPlayNormalBGM: (_, getters) => {
-            return getters.currentAudio.type === 0
-        },
-        isPlayV3BGM: (state) => {
-            return state.v3BGM.isPlayIng
-        },
-        isPlayV4BGM: (_, getters) => {
-            return getters.currentAudio.type === 2
-        },
-        isPlayExplanationBGM: (_, getters) => {
-            return getters.currentAudio.type === 3
-        }
+    isCurrentPlaying: (state) => state.currentPlaying,
+    isHasNormalBGM: (state) => {
+      return state.normalBGM.url.length > 0;
+    },
+    isHasV3BGM: (state) => {
+      return state.v3BGM.isExist;
+    },
+    isHasV4BGM: (state) => {
+      return state.v4BGM.url.length > 0;
+    },
+    isHasExplanationBGM: (state) => {
+      return state.explanationBGM.url.length > 0;
+    },
+    isPlayNormalBGM: (_, getters) => {
+      return getters.currentAudio.type === 0;
+    },
+    isPlayV3BGM: (state) => {
+      return state.v3BGM.isPlayIng;
+    },
+    isPlayV4BGM: (_, getters) => {
+      return getters.currentAudio.type === 2;
+    },
+    isPlayExplanationBGM: (_, getters) => {
+      return getters.currentAudio.type === 3;
+    },
+  },
+  mutations: {
+    setNormalBGM(state, payload) {
+      state.normalBGM.url = payload.url;
+      state.normalBGM.isAuto = payload.isAuto;
+    },
+    setExplanationBGM(state, payload) {
+      state.explanationBGM.url = payload.url;
+      state.explanationBGM.isAuto = payload.isAuto;
+      state.explanationBGM.repeat = payload.repeat;
+    },
+    setV3BGM(state, payload) {
+      state.v3BGM.isExist = payload;
+    },
+    setV3BGMPlaying(state, payload) {
+      state.v3BGM.isPlayIng = payload;
+    },
+    setV4BGM(state, payload) {
+      state.v4BGM.url = payload.url;
+      state.v4BGM.isAuto = payload.isAuto;
+      state.v4BGM.repeat = payload.repeat;
+    },
+    setPlayStatus(state, payload) {
+      state.currentPlaying = payload;
+    },
+  },
+  actions: {
+    initNormalBGM({ commit }, url) {
+      // 一般背景音乐
+      commit("setNormalBGM", {
+        isAuto: true,
+        url: url,
+      });
+    },
+    initExplanationBGM({ commit }, { url, repeat, isAuto }) {
+      commit("setExplanationBGM", { url, repeat, isAuto });
     },
-    mutations: {
-        setNormalBGM(state, payload) {
-            state.normalBGM.url = payload.url
-            state.normalBGM.isAuto = payload.isAuto
-        },
-        setExplanationBGM(state, payload) {
-            state.explanationBGM.url = payload.url
-            state.explanationBGM.isAuto = payload.isAuto
-            state.explanationBGM.repeat = payload.repeat
-        },
-        setV3BGM(state, payload) {
-            state.v3BGM.isExist = payload
 
-        },
-        setV3BGMPlaying(state, payload) {
-            state.v3BGM.isPlayIng = payload
-        },
-        setV4BGM(state, payload) {
-            state.v4BGM.url = payload.url
-            state.v4BGM.isAuto = payload.isAuto
-            state.v4BGM.repeat = payload.repeat
-        },
-        setPlayStatus(state, payload) {
-            state.currentPlaying = payload
+    initV3BGM({ commit, dispatch }, status) {
+      // V3音乐
+      commit("setV3BGM", status);
+      if (status) {
+        dispatch("pauseBGM");
+      }
+    },
+    initV4BGM({ commit }, url) {
+      // v4音乐
+      let newURL = "";
+      if (url) {
+        if (!/^https?:\/\//.test(url)) {
+          newURL = resourceURL + url;
+        } else {
+          newURL = url;
         }
-
+      }
+      commit("setV4BGM", { url: newURL, repeat: true, isAuto: true });
     },
-    actions: {
-        initNormalBGM({ commit }, url) {
-            // 一般背景音乐
-            commit('setNormalBGM', {
-                isAuto: true,
-                url: url
-            })
-        },
-        initExplanationBGM({ commit }, { url, repeat, isAuto }) {
-            commit('setExplanationBGM', { url, repeat, isAuto });
-        },
-
-        initV3BGM({ commit, dispatch }, status) {
-            // V3音乐
-            commit('setV3BGM', status);
-            if (status) {
-                dispatch('pauseBGM');
-            }
-        },
-        initV4BGM({ commit }, url) {
-            // v4音乐
-            let newURL = ''
-            if (url) {
-                if (!/^https?:\/\//.test(url)) {
-                    newURL = resourceURL + url
-                } else {
-                    newURL = url
-                }
-            }
-            commit('setV4BGM', { url: newURL, repeat: true, isAuto: true });
-        },
-        playBGM({ commit, getters, state, dispatch }, type) {
-            console.warn('~~playBGM~~', type);
-            // debugger;
-            const index = getters['currentAudio'].order;
-            const order = index + 1;
-            const target = getters['bgmList'].find(i => i.type === type);
-            if (target.url.length > 0) {
-                switch (type) {
-                    case 0:
-                        state.normalBGM.order = order;
-                        break;
-                    case 2:
-                        state.v4BGM.order = order;
-                        break;
-                    case 3:
-                        state.explanationBGM.order = order;
-                        break;
-                    default:
-                        state.normalBGM.order = order;
-                        break;
-                }
-            } else {
-                console.error('当前BGM没有URL', target);
-                if (type === 2) {
-                    //fallback
-                    dispatch('playBGM', 0);
-                }
-            }
-
-        },
-        pauseBGM() {
-            const { currentPlayer } = useAudio();
-            if (unref(currentPlayer)) {
-                currentPlayer.value.pause();
-            }
-
-        },
-        resumeBGM() {
-            const { currentPlayer } = useAudio();
-            if (unref(currentPlayer)) {
-                currentPlayer.value.resume();
-            }
-        },
-        updatePlayerStatus({ commit }, status) {
-            commit('setPlayStatus', status)
-        },
-
-        updateV3BGMStatus({ commit }, status) {
-            commit('setV3BGMPlaying', status)
-        },
-
-        destroy() {
-            const { currentPlayer } = useAudio();
-            if (unref(currentPlayer)) {
-                currentPlayer.value.destroy();
-            }
-        },
-        setLock({ commit }, status) {
-            const { currentPlayer } = useAudio();
-            if (unref(currentPlayer)) {
-                status ? currentPlayer.value.lock() : currentPlayer.value.unlock();
-            }
-        },
-        setMuteBGM({ commit }, status) {
-            const { currentPlayer } = useAudio();
-            if (unref(currentPlayer)) {
-                status ? currentPlayer.value.mute() : currentPlayer.value.unmute();
-            }
+    playBGM({ commit, getters, state, dispatch }, type) {
+      console.warn("~~playBGM~~", type);
+      // debugger;
+      const index = getters["currentAudio"].order;
+      const order = index + 1;
+      const target = getters["bgmList"].find((i) => i.type === type);
+      if (target.url.length > 0) {
+        switch (type) {
+          case 0:
+            state.normalBGM.order = order;
+            break;
+          case 2:
+            state.v4BGM.order = order;
+            break;
+          case 3:
+            state.explanationBGM.order = order;
+            break;
+          default:
+            state.normalBGM.order = order;
+            break;
         }
-    }
+      } else {
+        console.error("当前BGM没有URL", target);
+        if (type === 2) {
+          //fallback
+          dispatch("playBGM", 0);
+        }
+      }
+    },
+    pauseBGM() {
+      const { currentPlayer } = useAudio();
+      if (unref(currentPlayer)) {
+        currentPlayer.value.pause();
+      }
+    },
+    resumeBGM() {
+      const { currentPlayer } = useAudio();
+      if (unref(currentPlayer)) {
+        currentPlayer.value.resume();
+      }
+    },
+    updatePlayerStatus({ commit }, status) {
+      commit("setPlayStatus", status);
+    },
+
+    updateV3BGMStatus({ commit }, status) {
+      commit("setV3BGMPlaying", status);
+    },
 
-}
+    destroy() {
+      const { currentPlayer } = useAudio();
+      if (unref(currentPlayer)) {
+        currentPlayer.value.destroy();
+      }
+    },
+    setLock({ commit }, status) {
+      const { currentPlayer } = useAudio();
+      if (unref(currentPlayer)) {
+        status ? currentPlayer.value.lock() : currentPlayer.value.unlock();
+      }
+    },
+    setMuteBGM({ commit }, status) {
+      const { currentPlayer } = useAudio();
+      if (unref(currentPlayer)) {
+        status ? currentPlayer.value.mute() : currentPlayer.value.unmute();
+      }
+    },
+  },
+};