瀏覽代碼

Merge branch 'feature-3.8'

TIANYONG 1 年之前
父節點
當前提交
e8550d8238

+ 1 - 1
src/views/courseware-list/component/book/index.tsx

@@ -344,7 +344,6 @@ export default defineComponent({
         const url =
           location.origin + location.pathname + '#/courseware-play?' + query;
         console.log('🚀 ~ url:', url);
-        debounceSkip.value = false;
         postMessage({
           api: 'openWebView',
           content: {
@@ -367,6 +366,7 @@ export default defineComponent({
         //     coursewareDetailKnowledgeId: item.coursewareDetailKnowledgeId
         //   }
         // });
+        debounceSkip.value = false;
       }
     };
 

+ 2 - 1
src/views/courseware-play/component/instrument-info/index.tsx

@@ -68,6 +68,7 @@ export default defineComponent({
           '<video class="video-music" style="width: 100% !important;" controlslist="nodownload" poster="https://oss.dayaedu.com/ktqy/1701759849244.png"'
         );
         forms.dataInfo = data || {};
+        
         forms.musicList = data.knowledgeWikiResources.map((item: any) => {
           return {
             id: item.id,
@@ -236,7 +237,7 @@ export default defineComponent({
               </>
             )}
 
-            {forms.musicList.length <= 0 && forms.loading && (
+            {forms.musicList.length <= 0 && (
               <div class={styles.emptyBox}>
                 <img src={emptyIcon} />
                 <span>暂无曲目~</span>

+ 31 - 23
src/views/courseware-play/index.tsx

@@ -53,7 +53,7 @@ import Theory from './component/theory';
 import InstrumentInfo from './component/instrument-info';
 // import TempoPractice from '../../views/tempo-practice';
 import SelectCoursewarePop from '@/components/select-courseware-pop';
-import { debounce } from "../../helpers/utils"
+import { debounce } from '../../helpers/utils';
 import TempoItem from './component/tempo-item';
 
 export default defineComponent({
@@ -323,6 +323,10 @@ export default defineComponent({
         clearInterval(activeData.timer);
         activeData.model = !ev.data.state;
       }
+
+      if (ev.data?.api === 'clickTempo') {
+        setModelOpen();
+      }
     };
 
     onMounted(() => {
@@ -880,7 +884,7 @@ export default defineComponent({
 
     // 加载新的章节里的课件
     const loadNewCourseware = async (item: any) => {
-      if( debounceSkip.value ) return;
+      if (debounceSkip.value) return;
       debounceSkip.value = true;
       data.itemList = [];
       loadingClass.value = true;
@@ -1132,27 +1136,31 @@ export default defineComponent({
                       // />
                     )}
                     {m.type === 'THEORY' && <Theory id={m.bizId} />}
-                    {m.type === 'MUSIC_WIKI' && (
-                      <InstrumentInfo
-                        type={'wiki'}
-                        id={m.bizId}
-                        show={popupData.activeIndex === mIndex}
-                      />
-                    )}
-                    {m.type === 'INSTRUMENT' && (
-                      <InstrumentInfo
-                        type={'instrument'}
-                        id={m.bizId}
-                        show={popupData.activeIndex === mIndex}
-                      />
-                    )}
-                    {m.type === 'MUSICIAN' && (
-                      <InstrumentInfo
-                        type={'musician'}
-                        id={m.bizId}
-                        show={popupData.activeIndex === mIndex}
-                      />
-                    )}
+                    {popupData.activeIndex === mIndex && 
+                    <>
+                      {m.type === 'MUSIC_WIKI' && (
+                        <InstrumentInfo
+                          type={'wiki'}
+                          id={m.bizId}
+                          show={popupData.activeIndex === mIndex}
+                        />
+                      )}
+                      {m.type === 'INSTRUMENT' && (
+                        <InstrumentInfo
+                          type={'instrument'}
+                          id={m.bizId}
+                          show={popupData.activeIndex === mIndex}
+                        />
+                      )}
+                      {m.type === 'MUSICIAN' && (
+                        <InstrumentInfo
+                          type={'musician'}
+                          id={m.bizId}
+                          show={popupData.activeIndex === mIndex}
+                        />
+                      )}
+                    </>
+                    }
                   </div>
                 ) : (
                   <div

+ 2 - 2
src/views/tempo-practice/index.module.less

@@ -103,6 +103,7 @@
   flex: 1 auto;
   flex-wrap: wrap;
   gap: 15px 0;
+  // margin-bottom: 15px;
   max-width: 900px;
   margin: 0 auto;
 }
@@ -111,6 +112,7 @@
   display: flex;
   align-items: center;
   justify-content: center;
+  // margin-bottom: 15px;
 
   &.small {
     width: 50%;
@@ -133,8 +135,6 @@
       cursor: pointer;
       margin: 0 7px;
 
-
-
       &::before,
       &::after {
         width: 19px;

+ 17 - 2
src/views/tempo-practice/index.tsx

@@ -225,6 +225,14 @@ export default defineComponent({
     });
     return () => (
       <div
+        onClick={() => {
+          window.parent.postMessage(
+            {
+              api: 'clickTempo'
+            },
+            '*'
+          );
+        }}
         class={[
           styles.tempoPractice,
           state.win === 'pc' ? styles.pc : '',
@@ -268,7 +276,10 @@ export default defineComponent({
                 ]}>
                 {item.map((child: any, jIndex: number) => (
                   <div
-                    class={[styles.beat, child.selected ? styles.active : '']}>
+                    class={[styles.beat, child.selected ? styles.active : '']}
+                    onClick={(e: any) => {
+                      e.stopPropagation();
+                    }}>
                     <div class={styles.direction}>
                       <div
                         class={styles.up}
@@ -309,7 +320,11 @@ export default defineComponent({
           </div>
         </div>
 
-        <div class={styles.footer}>
+        <div
+          class={styles.footer}
+          onClick={(e: any) => {
+            e.stopPropagation();
+          }}>
           {/* 播放 */}
           <div class={styles.play} onClick={handlePlay}>
             {setting.playState === 'pause' ? (