lex 1 year ago
parent
commit
7a8fcab948

+ 33 - 8
src/components/card-preview/listen-modal/index.module.less

@@ -1,15 +1,40 @@
+// .musicScore {
+//   width: 100%;
+//   height: 100%;
+
+//   iframe {
+//     width: inherit;
+//     height: inherit;
+
+//     :global {
+//       .headTopBackBtn {
+//         display: none;
+//       }
+//     }
+//   }
+// }
+
 .musicScore {
+  position: relative;
   width: 100%;
   height: 100%;
+  -webkit-overflow-scrolling: touch;
+  // overflow: scroll;
 
-  iframe {
-    width: inherit;
-    height: inherit;
+  .container {
+    position: relative;
+    display: block;
+    border: none;
+    width: 100%;
+    height: 100%;
+    z-index: 10;
+  }
 
-    :global {
-      .headTopBackBtn {
-        display: none;
-      }
-    }
+  .musicModel {
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
   }
 }

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

@@ -21,28 +21,12 @@ export default defineComponent({
     const iframeRef = ref();
     const isLoaded = ref(false);
 
-    // const src = `${vaildMusicScoreUrl()}/instrument/#/view-figner?Authorization=${
-    //   userStore.getToken
-    // }&code=${item.code}&platform=pc&type=listenMode`;
-    // // const src = `http://192.168.3.220:3000/instrument.html#/view-figner?Authorization=${userStore.getToken}&code=${item.code}`;
-    // if (window.matchMedia('(display-mode: standalone)').matches) {
-    //   state.application = window.matchMedia(
-    //     '(display-mode: standalone)'
-    //   ).matches;
-    //   forms.previewModal = true;
-    //   forms.previewParams.src = src + '&matchMedia=1';
-    // } else {
-    //   window.open(src);
-    // }
-
-    const src = `${vaildMusicScoreUrl()}/instrument/#/view-figner?Authorization=${
+    let src = `${vaildMusicScoreUrl()}/instrument/#/view-figner?Authorization=${
       userStore.getToken
     }&code=${props.item.content}&platform=pc&type=listenMode`;
-    // if (/(localhost|192)/.test(location.host)) {
-    //   src = `http://localhost:9002/#/tempo-practice?v=${Date.now()}&Authorization=${
-    //     userStore.getToken
-    //   }&platform=modal`;
-    // }
+    if (/(localhost|192)/.test(location.host)) {
+      src = `http://localhost:3001/instrument.html#/view-figner?Authorization=${userStore.getToken}&code=${props.item.content}&platform=pc&type=listenMode`;
+    }
     // if (props.item.dataJson) {
     //   src += '&dataJson=' + props.item.dataJson;
     // }

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

@@ -20,14 +20,13 @@ export default defineComponent({
     const userStore = useUserStore();
     const iframeRef = ref();
     const isLoaded = ref(false);
-    const origin = /(localhost|192)/.test(location.host)
-      ? 'http://localhost:9002'
-      : location.origin;
-    let src = `${origin}/classroom-app/#/tempo-practice?v=${+new Date()}&platform=modal&dataJson=${
+    let src = `${
+      location.origin
+    }/classroom-app/#/tempo-practice?v=${+new Date()}&platform=modal&dataJson=${
       props.item.dataJson
     }&Authorization=${userStore.getToken}&win=pc`;
     if (/(localhost|192)/.test(location.host)) {
-      src = `${origin}/#/tempo-practice?v=${+new Date()}&platform=modal&dataJson=${
+      src = `http://localhost:9002/#/tempo-practice?v=${+new Date()}&platform=modal&dataJson=${
         props.item.dataJson
       }&Authorization=${userStore.getToken}&win=pc`;
     }

+ 1 - 1
src/views/attend-class/index.module.less

@@ -136,7 +136,7 @@
 .wraps {
   width: 100%;
   height: 100%;
-  transform-style: preserve-3d;
+  // transform-style: preserve-3d;
   perspective: (32rem);
   transition-timing-function: initial;
 }

+ 9 - 0
src/views/attend-class/index.tsx

@@ -1456,6 +1456,14 @@ export default defineComponent({
                   // if (isRender) {
                   //   m.isRender = true;
                   // }
+
+                  // const isRender =
+                  //   m.isRender || Math.abs(popupData.activeIndex - mIndex) < 2;
+                  // const isEmtry = Math.abs(popupData.activeIndex - mIndex) > 4;
+                  // if (isRender) {
+                  //   m.isRender = true;
+                  // }
+
                   return isRender ? (
                     <div
                       key={'index' + mIndex}
@@ -1591,6 +1599,7 @@ export default defineComponent({
                       ) : m.type === 'LISTEN' ? (
                         <ListenModal
                           item={m}
+                          data-vid={m.id}
                           activeStatus={popupData.activeIndex === mIndex}
                           onSetIframe={(el: any) => {
                             m.iframeRef = el;

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

@@ -280,7 +280,7 @@ export default defineComponent({
           v-model:show={forms.subjectSyncVisiable}
           preset="card"
           class={['modalTitle background', styles.subjectSyncModal]}
-          title={'请选择声部'}>
+          title={'选择乐器'}>
           <SubjectModal
             onClose={() => (forms.subjectSyncVisiable = false)}
             onConfirm={async (item: any) => {

+ 3 - 3
src/views/prepare-lessons/components/lesson-main/courseware/addCourseware.tsx

@@ -796,7 +796,7 @@ export default defineComponent({
                                 }}>
                                 <img src={iconAddMusic} />
 
-                                <p class={styles.addMusicName}>添加功能</p>
+                                <p class={styles.addMusicName}>添加资源</p>
                               </div>
                             </div>
                           </div>
@@ -820,7 +820,7 @@ export default defineComponent({
                             }}>
                             <img src={iconAddMusic} />
 
-                            <p class={styles.addMusicName}>添加功能</p>
+                            <p class={styles.addMusicName}>添加资源</p>
                           </div>
                         </div>
                       </div>
@@ -929,7 +929,7 @@ export default defineComponent({
           v-model:show={forms.addOtherSource}
           preset="card"
           class={['modalTitle background', styles.addOtherSource]}
-          title={'添加功能'}>
+          title={'添加资源'}>
           <AddOtherSource
             onClose={() => (forms.addOtherSource = false)}
             onComfirm={item => {

+ 6 - 6
src/views/prepare-lessons/model/add-other-source/index.tsx

@@ -54,12 +54,12 @@ export default defineComponent({
         image: icon4,
         name: '乐理知识',
         index: 5
-      },
-      {
-        image: icon7,
-        name: '制作曲谱',
-        index: 6
       }
+      // {
+      //   image: icon7,
+      //   name: '制作曲谱',
+      //   index: 6
+      // }
     ]);
     const state = reactive({
       listenStatus: false, // 听音练习
@@ -273,7 +273,7 @@ export default defineComponent({
           v-model:show={state.listenStatus}
           preset="card"
           class={['modalTitle background', styles.subjectSyncModal]}
-          title={'听音练习'}>
+          title={'选择乐器'}>
           <SubjectSync
             // subjectId={prepareStore.getSubjectId as any}
             onClose={() => (state.listenStatus = false)}