Browse Source

更新暂停问题

aamin 1 year ago
parent
commit
d3fd15eb51

+ 3 - 1
scene/src/views/gui/menu.vue

@@ -322,7 +322,7 @@ export default {
         if (_this.isBg) {
           const audio = document.getElementById("musicAudio");
           audio.play();
-          audio.volume = 0.1
+          audio.volume = 0.1;
           console.log(audio.volume);
           _this.isBg = false;
           document.querySelector("#openMusic").style.display = "none";
@@ -376,6 +376,7 @@ export default {
         audio.play();
         // console.log("音乐打开");
         // window.manage.switchBgmState(true);
+        window.player.director.stopTour();
         document.querySelector("#openMusic").style.display = "none";
         document.querySelector("#closeMusic").style.display = "block";
       } else {
@@ -385,6 +386,7 @@ export default {
         // console.log("音乐关闭");
 
         // window.manage.switchBgmState(false);
+        window.player.director.stopTour();
         document.querySelector("#openMusic").style.display = "block";
         document.querySelector("#closeMusic").style.display = "none";
       }

+ 2 - 6
yangjiagou/src/store/index.ts

@@ -1,18 +1,14 @@
-
 import { defineStore } from "pinia";
 
-
 export const useStore = defineStore("home", {
   // 相当于data
   state: () => {
     return {
-
+      moduleIndex: 0,
     };
   },
   // 相当于计算属性
   getters: {},
   // 相当于vuex的 mutation + action,可以同时写同步和异步的代码
-  actions: {
-    
-  },
+  actions: {},
 });

+ 0 - 1
yangjiagou/src/view/home/components/scene/index.vue

@@ -13,7 +13,6 @@ const close = () => {
 const router = useRouter();
 
 const goDetail = (name: string) => {
-  console.log(name);
   router.push({
     name: "sceneDetail",
     query: {

+ 10 - 4
yangjiagou/src/view/home/index.vue

@@ -16,6 +16,7 @@ import Welcomeimg from "@/assets/img/home/welcome.png";
 
 import Bg from "@/assets/img/home/bg.png";
 import BgM from "@/assets/img/home/bgM.png";
+import { useStore } from "@/store/index";
 
 const allBg = computed(() => {
   return screenWidth.value > 480 ? `url(${Bg})` : `url(${BgM})`;
@@ -25,9 +26,10 @@ const router = useRouter();
 
 const moduleIndex = ref(0);
 const screenWidth = ref();
+const store = useStore();
 
 watch(moduleIndex, (newValue: number) => {
-  // console.log(moduleIndex.value);
+  store.moduleIndex = newValue;
   if (newValue === 3) {
     router.push({
       path: "/product",
@@ -36,7 +38,11 @@ watch(moduleIndex, (newValue: number) => {
 });
 
 onMounted(() => {
-  moduleIndex.value = 0;
+  if (store.moduleIndex == 2) {
+    moduleIndex.value = 2;
+  } else {
+    moduleIndex.value = 0;
+  }
   screenWidth.value = window.innerWidth;
   window.onresize = () => {
     screenWidth.value = window.innerWidth;
@@ -125,8 +131,6 @@ onMounted(() => {
       "
     />
 
-    <!--  -->
-
     <img class="wave" :src="screenWidth > 480 ? Bolang : BolangM" alt="" />
 
     <!-- title -->
@@ -169,6 +173,8 @@ onMounted(() => {
       display: flex;
       justify-content: center;
       align-items: center;
+      position: relative;
+      z-index: 2;
       img {
         width: 90%;
       }