lex 10 месяцев назад
Родитель
Сommit
3ca4abd64e

+ 4 - 4
src/components/card-preview/listen-modal/index.tsx

@@ -22,12 +22,12 @@ export default defineComponent({
     const iframeRef = ref();
     const isLoaded = ref(false);
 
-    const src = `${vaildMusicScoreUrl()}/instrument?v=${new Date().getTime()}/#/view-figner?Authorization=${
+    let src = `${vaildMusicScoreUrl()}/instrument?v=${new Date().getTime()}/#/view-figner?Authorization=${
       userStore.getToken
     }&code=${props.item.content}&platform=pc&type=listenMode&linkSource=class`;
-    // if (/(192)/.test(location.host)) {
-    //   src = `http://192.168.3.220:3000/instrument.html#/view-figner?Authorization=${userStore.getToken}&code=${props.item.content}&platform=pc&type=listenMode&linkSource=class`;
-    // }
+    if (/(localhost)/.test(location.host)) {
+      src = `http://localhost:3000/instrument.html#/view-figner?Authorization=${userStore.getToken}&code=${props.item.content}&platform=pc&type=listenMode&linkSource=class`;
+    }
     // if (props.item.dataJson) {
     //   src += '&dataJson=' + props.item.dataJson;
     // }

+ 2 - 2
src/components/card-preview/rhythm-modal/index.tsx

@@ -23,8 +23,8 @@ export default defineComponent({
     let src = `${origin}/classroom-app/#/tempo-practice?v=${Date.now()}&Authorization=${
       userStore.getToken
     }&platform=modal`;
-    if (/(localhost|192)/.test(location.host)) {
-      src = `http://192.168.3.220:9002/#/tempo-practice?v=${Date.now()}&Authorization=${
+    if (/(localhost)/.test(location.host)) {
+      src = `https://test.kt.colexiu.com/classroom-app/#/tempo-practice?v=${Date.now()}&Authorization=${
         userStore.getToken
       }&platform=modal`;
     }

+ 5 - 1
src/views/attend-class/component/audio-pay.tsx

@@ -428,7 +428,8 @@ export default defineComponent({
     });
 
     expose({
-      toggleHideControl
+      toggleHideControl,
+      onToggleAudio
     });
 
     return () => (
@@ -445,6 +446,9 @@ export default defineComponent({
             onPlay={() => {
               audioForms.paused = audio.value?.paused;
             }}
+            onPause={() => {
+              // audioForms.paused = audio.value?.paused;
+            }}
             onTimeupdate={() => {
               audioForms.currentTime = timeFormat(
                 Math.round(audio.value?.currentTime || 0)

+ 2 - 2
src/views/attend-class/component/rhythm-modal/index.tsx

@@ -30,8 +30,8 @@ export default defineComponent({
     }/classroom-app/#/tempo-practice?v=${+new Date()}&platform=modal&dataJson=${
       props.item.dataJson
     }&Authorization=${userStore.getToken}&win=pc&imagePos=${props.imagePos}`;
-    if (/(localhost|192)/.test(location.host)) {
-      src = `https://test.kt.colexiu.com/classroom-app/#/tempo-practice?v=${+new Date()}&platform=modal&dataJson=${
+    if (/(localhost)/.test(location.host)) {
+      src = `http://localhost:9002/#/tempo-practice?v=${+new Date()}&platform=modal&dataJson=${
         props.item.dataJson
       }&Authorization=${userStore.getToken}&win=pc&imagePos=${props.imagePos}`;
     }

+ 51 - 38
src/views/attend-class/index.tsx

@@ -327,10 +327,14 @@ export default defineComponent({
           setModalOpen();
           handlePreAndNext('down');
         }
+
+        if (ev.data?.code === 'Tab') {
+          onTabClick();
+        }
       }
 
-      // 点名返回
       if (ev.data?.api === 'callBack') {
+        // 点名返回
         closeStudyTool();
         studyData.callShow = false;
       }
@@ -349,6 +353,50 @@ export default defineComponent({
       }
     };
 
+    const onTabClick = () => {
+      const activeItem = data.itemList[popupData.activeIndex];
+      // console.log(activeItem, activeItem.videoEle);
+      // 暂停视频和曲谱的播放
+      if (activeItem.type === 'VIDEO' && activeItem.videoEle) {
+        if (activeItem.videoEle?.paused()) {
+          activeItem.videoEle?.play();
+        } else {
+          activeItem.videoEle?.pause();
+        }
+      }
+      if (activeItem.type === 'SONG' && activeItem.audioEle) {
+        data.audioRefs[popupData.activeIndex]?.onToggleAudio();
+      }
+      if (activeItem.type === 'MUSIC') {
+        activeItem.iframeRef?.contentWindow?.postMessage(
+          { api: 'startPlayState' },
+          '*'
+        );
+      }
+      if (activeItem.type === 'LISTEN') {
+        console.log(activeItem.type, 'listening');
+        activeItem.iframeRef?.contentWindow?.postMessage(
+          { api: 'startPlayState' },
+          '*'
+        );
+      }
+      if (activeItem.type === 'RHYTHM') {
+        activeItem.iframeRef?.contentWindow?.postMessage(
+          { api: 'setPlayState', data: true },
+          '*'
+        );
+      }
+
+      if (activeItem.type === 'PPT') {
+        console.log(activeItem.iframeRef, 'activeItem.iframeRef;');
+        activeItem.iframeRef?.focus();
+
+        // 将焦点传递给 iframe 内部内容
+        const iframeWindow = activeItem.iframeRef?.contentWindow;
+        iframeWindow.postMessage({ type: 'focus' }, '*');
+      }
+    };
+
     onMounted(async () => {
       // initMoveable();
       const query = route.query;
@@ -412,6 +460,7 @@ export default defineComponent({
           popupData.open
         )
           return;
+        console.log(e.code, 'code');
         if (e.code === 'ArrowUp' || e.code === 'PageUp') {
           // if (popupData.activeIndex === 0) return;
           setModalOpen();
@@ -423,43 +472,7 @@ export default defineComponent({
         } else if (e.code === 'Tab') {
           console.log('Space clicked');
 
-          const activeItem = data.itemList[popupData.activeIndex];
-          // console.log(activeItem, activeItem.videoEle);
-          // 暂停视频和曲谱的播放
-          if (activeItem.type === 'VIDEO' && activeItem.videoEle) {
-            activeItem.videoEle?.play();
-          }
-          if (activeItem.type === 'SONG' && activeItem.audioEle) {
-            activeItem.audioEle?.play();
-          }
-          if (activeItem.type === 'MUSIC') {
-            activeItem.iframeRef?.contentWindow?.postMessage(
-              { api: 'startPlayState' },
-              '*'
-            );
-          }
-          if (activeItem.type === 'LISTEN') {
-            console.log(activeItem.type, 'listening');
-            activeItem.iframeRef?.contentWindow?.postMessage(
-              { api: 'startPlayState' },
-              '*'
-            );
-          }
-          if (activeItem.type === 'RHYTHM') {
-            activeItem.iframeRef?.contentWindow?.postMessage(
-              { api: 'setPlayState', data: true },
-              '*'
-            );
-          }
-
-          if (activeItem.type === 'PPT') {
-            console.log(activeItem.iframeRef, 'activeItem.iframeRef;');
-            activeItem.iframeRef?.focus();
-
-            // 将焦点传递给 iframe 内部内容
-            const iframeWindow = activeItem.iframeRef?.contentWindow;
-            iframeWindow.postMessage({ type: 'focus' }, '*');
-          }
+          onTabClick();
         }
       });
     });

+ 2 - 2
src/views/home/index.tsx

@@ -166,8 +166,8 @@ export default defineComponent({
               <div
                 class={[styles.topSection, styles.topSection2]}
                 onClick={() => {
-                  const origin = /(localhost|192)/.test(location.host)
-                    ? 'http://192.168.3.220:9002'
+                  const origin = /(localhost)/.test(location.host)
+                    ? 'https://test.kt.colexiu.com'
                     : location.origin;
                   const src = `${origin}/classroom-app/#/tempo-practice?Authorization=${userStore.getToken}&win=pc&platform=modal&back=show`;
                   if (window.matchMedia('(display-mode: standalone)').matches) {

+ 2 - 2
src/views/prepare-lessons/model/source-rhythm/index.tsx

@@ -14,8 +14,8 @@ export default defineComponent({
     let src = `${origin}/classroom-app/#/tempo-practice?v=${Date.now()}&Authorization=${
       userStore.getToken
     }&platform=modal`;
-    if (/(localhost|192)/.test(location.host)) {
-      src = `http://localhost:9002/#/tempo-practice?v=${Date.now()}&Authorization=${
+    if (/(localhost)/.test(location.host)) {
+      src = `https://test.kt.colexiu.com/classroom-app/#/tempo-practice?v=${Date.now()}&Authorization=${
         userStore.getToken
       }&platform=modal`;
     }

+ 3 - 0
src/views/xiaoku-music/index.module.less

@@ -515,6 +515,8 @@
   width: 85%;
   height: 85vh;
   position: relative;
+  box-shadow: none !important;
+
 
   .previewClose {
     position: absolute;
@@ -522,6 +524,7 @@
     top: 0px;
     width: 60px;
     height: 65px;
+    cursor: pointer;
   }
 
   .previewIframe {