gemercheung 2 years ago
parent
commit
8beace9f4b

+ 2 - 2
packages/qjkankan-kankan-view/public/smg.html

@@ -28,8 +28,8 @@
 
         <script src="<%= BASE_URL %><%= VUE_APP_STATIC_DIR %>/static/lib/jweixin-1.6.0.js"></script>
 
-        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js?v=4.10.0-alpha.32"></script>
-        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk.js?v=4.10.0-alpha.32"></script>
+        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js?v=4.10.0-alpha.43"></script>
+        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk.js?v=4.10.0-alpha.43"></script>
 
 
         <!-- <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js"></script>

+ 2 - 2
packages/qjkankan-kankan-view/public/spg.html

@@ -16,8 +16,8 @@
             <strong>We're sorry but doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
         </noscript>
         <div id="app"></div>
-        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js?v=v=4.10.0-alpha.32"></script>
-        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk.js?v=v=4.10.0-alpha.32"></script>   
+        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js?v=v=4.10.0-alpha.43"></script>
+        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk.js?v=v=4.10.0-alpha.43"></script>   
         <!-- <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js"></script>
         <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk.js"></script> -->
 

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

@@ -146,7 +146,15 @@ const handleMessage = (res) => {
         setTimeout(() => {
           if (!isPlayTours.value) {
             console.error("toggleBgmStatus-恢复");
-            store.dispatch("audio/playBGM", 2);
+            if (store.getters["audio/isHasV4BGM"]) {
+              if (!store.getters["audio/isPauseByControl"]) {
+                store.dispatch("audio/playBGM", 2);
+              }
+            } else {
+              if (!store.getters["audio/isPauseByControl"]) {
+                store.dispatch("audio/playBGM", 0);
+              }
+            }
           }
         }, 500);
       }

+ 2 - 2
packages/qjkankan-view/src/components/UIGather/control.vue

@@ -191,7 +191,7 @@ const onIsBGM = () => {
     if (!unref(isCurrentPlaying)) {
       store.dispatch("audio/playBGM", 2);
     } else {
-      store.dispatch("audio/pauseBGM");
+      store.dispatch("audio/pauseBGM", 0);
     }
   } else {
     if (!unref(isPlayNormalBGM)) {
@@ -201,7 +201,7 @@ const onIsBGM = () => {
       if (!unref(isCurrentPlaying)) {
         store.dispatch("audio/playBGM", 0);
       } else {
-        store.dispatch("audio/pauseBGM");
+        store.dispatch("audio/pauseBGM", 0);
       }
     }
   }

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

@@ -281,6 +281,7 @@ const initMainSwiper = () => {
 };
 const initsencordNatSwiper = () => {
   nextTick(() => {
+    console.warn("initsencordNatSwiper");
     if (window.sencordNatSwiper) {
       window.sencordNatSwiper.update();
       window.sencordNatSwiper.slideReset();
@@ -317,11 +318,10 @@ const scenesSwiperFocus = () => {
 
 const sencordNatSwiperFocus = () => {
   nextTick(() => {
-    console.log("currentSecondary", currentSecondary.value);
     const current = Array.from(secondaryList.value).findIndex(
       (item) => item.id === currentSecondary.value.id
     );
-    if (window.sencordNatSwiper && window.sencordNatSwiper.slides.length > 0) {
+    if (window.sencordNatSwiper) {
       const index = current < 0 ? 0 : current;
       console.warn("sencordNatSwiperFocus", index);
       // window.sencordNatSwiper.slideTo(current);
@@ -343,7 +343,7 @@ onMounted(() => {
     }
   });
 
-  watch(currentSecondary, () => {
+  watch([currentSecondary, secondaryList], () => {
     if (unref(secondaryList).length > 1) {
       initsencordNatSwiper();
       sencordNatSwiperFocus();
@@ -359,6 +359,19 @@ onMounted(() => {
   watch(currentScenesList, () => {
     initScenesSwiper();
   });
+  watch(currentCatalogRoot, (val) => {
+    if (Array.from(unref(val).children).includes(currentScene.value.category)) {
+      //当前场景在一类的children
+      const activeSecond = Array.from(unref(secondaryList)).find(
+        (i) => i.id === currentScene.value.category
+      );
+      console.log("activeSecond", activeSecond);
+      store.commit("scene/setCurrentSecondary", activeSecond);
+      if (window.sencordNatSwiper) {
+        window.sencordNatSwiper.update();
+      }
+    }
+  });
 });
 </script>
 
@@ -565,3 +578,8 @@ $width: 1150px;
   }
 }
 </style>
+<style>
+.marquee-text-text {
+  padding: 0 5px;
+}
+</style>

+ 6 - 3
packages/qjkankan-view/src/components/UIGather/menu.vue

@@ -152,7 +152,7 @@ const openTours = () => {
   if (isShowScenesList.value) {
     store.commit("functions/setShowScenesList", false);
   }
-
+  // debugger;
   store.commit("fdkk/setShowToursList", !showTours.value);
 };
 
@@ -186,8 +186,11 @@ onMounted(() => {
     if (isPlayTours.value) {
       store.commit("functions/setShowScenesList", false);
     } else {
-      store.commit("functions/setShowScenesList", true);
-      store.commit("fdkk/setShowToursList", false);
+      setTimeout(() => {
+        console.log("tours-关闭");
+        store.commit("fdkk/setShowToursList", false);
+        store.commit("functions/setShowScenesList", true);
+      }, 100);
     }
   });
 });

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

@@ -334,6 +334,8 @@ onMounted(() => {
   watch(currentScenesList, () => {
     initScenesSwiper();
   });
+
+
 });
 </script>
 
@@ -529,4 +531,15 @@ onMounted(() => {
     -webkit-transform: translateX(-180%);
   }
 }
+.marquee {
+  .marquee-text-wrap {
+    height: 20px;
+    line-height: 20px;
+  }
+}
+</style>
+<style>
+.marquee-text-text {
+  padding: 0 5px;
+}
 </style>

+ 1 - 1
packages/qjkankan-view/src/hooks/useWxshared.js

@@ -4,7 +4,7 @@ import { onMounted } from "vue";
 const initWxShare = async () => {
   // onMounted(async () => {
   try {
-    await new Promise((r) => setTimeout(r, 1000));
+    // await new Promise((r) => setTimeout(r, 1000));
     const title = document.title;
     const link = window.location.href;
     // const desc = '测试微信分享'

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

@@ -43,6 +43,7 @@ export default {
         repeat: false,
       }, //解说音乐
       currentPlaying: false,
+      pauseByControl: false,
     };
   },
   getters: {
@@ -88,6 +89,9 @@ export default {
     isPlayExplanationBGM: (_, getters) => {
       return getters.currentAudio.type === 3;
     },
+    isPauseByControl: (state) => {
+      return state.pauseByControl;
+    },
   },
   mutations: {
     setNormalBGM(state, payload) {
@@ -151,6 +155,7 @@ export default {
       const index = getters["currentAudio"].order;
       const order = index + 1;
       const target = getters["bgmList"].find((i) => i.type === type);
+      state.pauseByControl = false;
       if (target.url.length > 0) {
         switch (type) {
           case 0:
@@ -174,11 +179,14 @@ export default {
         }
       }
     },
-    pauseBGM() {
+    pauseBGM({ commit, getters, state, dispatch }, from) {
       const { currentPlayer } = useAudio();
       if (unref(currentPlayer)) {
         currentPlayer.value.pause();
       }
+      if (from === 0) {
+        state.pauseByControl = true;
+      }
     },
     resumeBGM() {
       const { currentPlayer } = useAudio();