|
@@ -18,14 +18,13 @@
|
|
</li>
|
|
</li>
|
|
|
|
|
|
<!-- 背景音乐 -->
|
|
<!-- 背景音乐 -->
|
|
- <li
|
|
|
|
- @click="onIsBGM"
|
|
|
|
- v-if="metadata.backgroundMusic && metadata.backgroundMusic.id"
|
|
|
|
- >
|
|
|
|
|
|
+ <li @click="onIsBGM" v-if="isHasNormalBGM">
|
|
<img
|
|
<img
|
|
:src="
|
|
:src="
|
|
require(`@/assets/images/icon/${
|
|
require(`@/assets/images/icon/${
|
|
- showMusicPlaying ? 'music@2x.png' : 'music_disabled@2x.png'
|
|
|
|
|
|
+ isPlayNormalBGM && isCurrentPlaying
|
|
|
|
+ ? 'music@2x.png'
|
|
|
|
+ : 'music_disabled@2x.png'
|
|
}`)
|
|
}`)
|
|
"
|
|
"
|
|
alt=""
|
|
alt=""
|
|
@@ -33,14 +32,11 @@
|
|
</li>
|
|
</li>
|
|
|
|
|
|
<!-- 解说音频 -->
|
|
<!-- 解说音频 -->
|
|
- <li
|
|
|
|
- @click="onIsCommentary"
|
|
|
|
- v-if="currentScene.explanation && currentScene.explanation.audioUrl"
|
|
|
|
- >
|
|
|
|
|
|
+ <li @click="onIsCommentary" v-if="isHasExplanationBGM">
|
|
<img
|
|
<img
|
|
:src="
|
|
:src="
|
|
require(`@/assets/images/icon/${
|
|
require(`@/assets/images/icon/${
|
|
- showCommentaryPlaying
|
|
|
|
|
|
+ isPlayExplanationBGM && isCurrentPlaying
|
|
? 'commentary@2x.png'
|
|
? 'commentary@2x.png'
|
|
: 'commentary_disabled@2x.png'
|
|
: 'commentary_disabled@2x.png'
|
|
}`)
|
|
}`)
|
|
@@ -84,13 +80,6 @@ import { useApp } from "@/app";
|
|
import introduce from "./control/text";
|
|
import introduce from "./control/text";
|
|
import telephone from "./control/telephone";
|
|
import telephone from "./control/telephone";
|
|
import clink from "./control/link";
|
|
import clink from "./control/link";
|
|
-// import { useMusicPlayer, useSoundPlayer } from "@/utils/sound";
|
|
|
|
-
|
|
|
|
-//背景音乐
|
|
|
|
-// const musicPlayer = useMusicPlayer();
|
|
|
|
-
|
|
|
|
-// //解说音乐
|
|
|
|
-// const soundPlayer = useSoundPlayer();
|
|
|
|
|
|
|
|
const store = useStore();
|
|
const store = useStore();
|
|
|
|
|
|
@@ -114,6 +103,24 @@ const showIntroduce = computed(() => store.getters["functions/showIntroduce"]);
|
|
const showTelephone = computed(() => store.getters["functions/showTelephone"]);
|
|
const showTelephone = computed(() => store.getters["functions/showTelephone"]);
|
|
const showLink = computed(() => store.getters["functions/showLink"]);
|
|
const showLink = computed(() => store.getters["functions/showLink"]);
|
|
|
|
|
|
|
|
+//BMG音乐
|
|
|
|
+const isHasNormalBGM = computed(() => store.getters["audio/isHasNormalBGM"]);
|
|
|
|
+const isCurrentPlaying = computed(
|
|
|
|
+ () => store.getters["audio/isCurrentPlaying"]
|
|
|
|
+);
|
|
|
|
+const isHasV3BGM = computed(() => store.getters["audio/isHasV3BGM"]);
|
|
|
|
+const isHasV4BGM = computed(() => store.getters["audio/isHasV4BGM"]);
|
|
|
|
+const isHasExplanationBGM = computed(
|
|
|
|
+ () => store.getters["audio/isHasExplanationBGM"]
|
|
|
|
+);
|
|
|
|
+//BMG playing音乐
|
|
|
|
+const isPlayNormalBGM = computed(() => store.getters["audio/isPlayNormalBGM"]);
|
|
|
|
+const isPlayV3BGM = computed(() => store.getters["audio/isPlayV3BGM"]);
|
|
|
|
+const isPlayV4BGM = computed(() => store.getters["audio/isPlayV4BGM"]);
|
|
|
|
+const isPlayExplanationBGM = computed(
|
|
|
|
+ () => store.getters["audio/isPlayExplanationBGM"]
|
|
|
|
+);
|
|
|
|
+
|
|
const isFullscreen = ref(false);
|
|
const isFullscreen = ref(false);
|
|
|
|
|
|
const onIntroduce = () => {
|
|
const onIntroduce = () => {
|
|
@@ -130,15 +137,30 @@ const onLink = () => {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const onIsBGM = () => {
|
|
const onIsBGM = () => {
|
|
- // showMusicPlaying.value ? musicPlayer.pause() : musicPlayer.play();
|
|
|
|
|
|
+ if (!unref(isPlayNormalBGM)) {
|
|
|
|
+ store.dispatch("audio/playBGM", 0);
|
|
|
|
+ } else {
|
|
|
|
+ if (unref(isCurrentPlaying)) {
|
|
|
|
+ store.dispatch("audio/pauseBGM");
|
|
|
|
+ } else {
|
|
|
|
+ store.dispatch("audio/playBGM", 0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
};
|
|
};
|
|
-
|
|
|
|
const onIsAutoRotate = (data) => {
|
|
const onIsAutoRotate = (data) => {
|
|
store.commit("functions/setAutoRotate", !isAutoRotate.value);
|
|
store.commit("functions/setAutoRotate", !isAutoRotate.value);
|
|
};
|
|
};
|
|
|
|
|
|
-const onIsCommentary = (data) => {
|
|
|
|
- showCommentaryPlaying.value ? soundPlayer.pause() : soundPlayer.play();
|
|
|
|
|
|
+const onIsCommentary = () => {
|
|
|
|
+ if (!unref(isPlayExplanationBGM)) {
|
|
|
|
+ store.dispatch("audio/playBGM", 3);
|
|
|
|
+ } else {
|
|
|
|
+ if (unref(isCurrentPlaying)) {
|
|
|
|
+ store.dispatch("audio/pauseBGM");
|
|
|
|
+ } else {
|
|
|
|
+ store.dispatch("audio/playBGM", 3);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
const onVR = (data) => {
|
|
const onVR = (data) => {
|
|
@@ -190,18 +212,6 @@ onMounted(() => {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
-
|
|
|
|
-// musicPlayer.on("play", () => {
|
|
|
|
-// showMusicPlaying.value = true;
|
|
|
|
-// soundPlayer.pause();
|
|
|
|
-// });
|
|
|
|
-// musicPlayer.on("pause", () => (showMusicPlaying.value = false));
|
|
|
|
-
|
|
|
|
-// soundPlayer.on("play", () => {
|
|
|
|
-// showCommentaryPlaying.value = true;
|
|
|
|
-// musicPlayer.pause();
|
|
|
|
-// });
|
|
|
|
-// soundPlayer.on("pause", () => (showCommentaryPlaying.value = false));
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|