瀏覽代碼

Merge branch 'hqyDevNewVersion' of http://git.dayaedu.com/liushengqiang/music-score into feature-tianyong-newVersion

TIANYONG 11 月之前
父節點
當前提交
99865f354a

+ 2 - 1
src/page-instrument/header-top/index.tsx

@@ -415,6 +415,7 @@ export default defineComponent({
     });
     /** 模式切换按钮 */
     const toggleBtn = computed(() => {
+      if(state.isCombineRender) return { display: false, disabled: false };
       // 没有音源不显示
       if(state.noMusicSource) return { display: false, disabled: false };
       // 不是演奏模式 影藏
@@ -543,7 +544,7 @@ export default defineComponent({
     const changePlay = (res: any) => {
       // console.log('监听上课页面message',res)
       if (res?.data?.api === "setPlayState") {
-        togglePlay("paused", "courseware");
+        togglePlay("paused", true);
       }
       // 上课页面,按钮方向
       if (res?.data?.api === "imagePos") {

+ 2 - 2
src/page-instrument/view-detail/index.tsx

@@ -166,8 +166,8 @@ export default defineComponent({
         return
       }
       detailData.isLoading = false;
-      // 如果后台设置了不显示指法,关闭指法开关
-      if (!state.isShowFingering) {
+      // 如果后台设置了不显示指法,关闭指法开关   如果默认进来是演奏模式 不显示指法开关
+      if (!state.isShowFingering || state.playType === "sing") {
         state.setting.displayFingering = false
       }      
       // api_setEventTracking();

二進制
src/page-instrument/view-evaluat-report/component/share-top/image/videobg.png


+ 1 - 1
src/page-instrument/view-evaluat-report/component/share-top/index.module.less

@@ -221,7 +221,7 @@
 }
 
 .playerBox {
-    width: 537px;
+    width: 536px;
     height: 314px;
     background: #FFF8F8;
     box-shadow: inset 4px -3px 6px 0px #B2E8FF;

+ 6 - 3
src/page-instrument/view-evaluat-report/component/share-top/index.tsx

@@ -200,6 +200,9 @@ export default defineComponent({
 			}
 			const pauseVisualDraw = () => {
 				isPause = true
+        requestAnimationFrame(()=>{
+          canvasCtx.clearRect(0, 0, width, height);
+        })
 				//audioCtx?.suspend()  // 暂停   加了暂停和恢复音频音质发生了变化  所以这里取消了
 				// source?.disconnect()
 				// analyser?.disconnect()
@@ -435,9 +438,9 @@ export default defineComponent({
               {mediaType.value === "audio" ? (
                 <div class={styles.audioBox}>
                   <canvas class={styles.audioVisualizer} id="audioVisualizer"></canvas>
-                  <Vue3Lottie class={styles.audioBga} animationData={audioBga} autoPlay={false} loop={true}></Vue3Lottie>
-                  <Vue3Lottie class={styles.audioBga1} animationData={audioBga1} autoPlay={false} loop={true}></Vue3Lottie>
-                  <Vue3Lottie class={styles.audioBga2} animationData={audioBga2} autoPlay={false} loop={true}></Vue3Lottie>
+                  <Vue3Lottie class={styles.audioBga} animationData={audioBga} autoPlay={true} loop={true}></Vue3Lottie>
+                  <Vue3Lottie class={styles.audioBga1} animationData={audioBga1} autoPlay={true} loop={true}></Vue3Lottie>
+                  <Vue3Lottie class={styles.audioBga2} animationData={audioBga2} autoPlay={true} loop={true}></Vue3Lottie>
                   <audio crossorigin="anonymous" id="audioSrc" src={scoreData.value.videoFilePath} controls="false" preload="metadata" playsinline />
                 </div>
               ) : (

+ 9 - 7
src/state.ts

@@ -779,10 +779,10 @@ export const skipNotePlay = async (itemIndex: number, isStart = false) => {
  * 切换曲谱播放状态
  * @param playState 需要切换的状态 play:播放, paused: 暂停
  */
-export const togglePlay = async (playState: "play" | "paused", sourceType?: string) => {
+export const togglePlay = async (playState: "play" | "paused", isForceCLoseToast?:boolean) => {
   // 如果mp3资源还在加载中,给出提示
   if (!state.isAppPlay && !state.audioDone) {
-    if (sourceType !== 'courseware') showToast('音频资源加载中,请稍后')
+    if (!isForceCLoseToast) showToast('音频资源加载中,请稍后')
     return
   }
   // 播放之前  当为评测模式和不为MIDI时候按  是否禁用节拍器  切换音源
@@ -1293,7 +1293,7 @@ export const handleRessetState = () => {
   if (state.modeType === "evaluating") {
     handleStartEvaluat();
   } else if (state.modeType === "practise") {
-    togglePlay("paused");
+    togglePlay("paused", true);
   } else if (state.modeType === "follow") {
     toggleFollow(false);
   }
@@ -1390,14 +1390,16 @@ function initMusicSource(data: any, tracks: string[], partIndex: number) {
         // 总谱渲染
         state.isCombineRender = true
         state.partListNames = tracks
-        banSongObj = musicSheetAccompanimentList.find((item: any) => {
+        // 总谱演唱模式是 范唱
+        fanSongObj = musicSheetAccompanimentList.find((item: any) => {
           return item.audioPlayType === "SING"
         })
         // 先取scoreAudioFileUrl的值
-        if(banSongObj?.scoreAudioFileUrl){
-          banSongObj.audioFileUrl = banSongObj.scoreAudioFileUrl
-          banSongObj.audioBeatMixUrl = banSongObj.scoreAudioBeatMixUrl
+        if(fanSongObj?.scoreAudioFileUrl){
+          fanSongObj.audioFileUrl = fanSongObj.scoreAudioFileUrl
+          fanSongObj.audioBeatMixUrl = fanSongObj.scoreAudioBeatMixUrl
         }
+        // 总谱演奏模式是 伴奏
         accompanyObj = musicSheetAccompanimentList.find((item: any) => {
           return item.audioPlayType === "PLAY"
         })