Bläddra i källkod

Merge branch 'feature-tianyong-newVersion' into feature-wxl-newVersion

lex 11 månader sedan
förälder
incheckning
87f49e8a77

+ 2 - 2
public/flexible.js

@@ -16,8 +16,8 @@
       f.style.fontSize = c + "px", k.rem = a.rem = c
       window.fontSize = c
     } catch (error) {
-      f.style.fontSize = 64 + "px"
-      window.fontSize = 64
+      f.style.fontSize = 37.5 + "px"
+      window.fontSize = 37.5
     }
 
   }

+ 10 - 8
src/page-instrument/view-detail/index.tsx

@@ -86,6 +86,8 @@ const setNoteHalfTone = (list: any[]) => {
 
 export const musicScoreRef = ref();
 
+export const headerColumnHide = ref(false); // 是否隐藏功能按钮,播放时自动隐藏
+
 export default defineComponent({
   name: "music-list",
   setup() {
@@ -296,7 +298,7 @@ export default defineComponent({
         if (state.fingeringInfo.direction === "transverse") {
           return {
             container: {
-              paddingBottom: detailData.headerHide ? state.fingeringInfo.height : state.fingeringInfo.scaleData?.offset,
+              paddingBottom: headerColumnHide.value ? state.fingeringInfo.height : state.fingeringInfo.scaleData?.offset,
             },
             // 横向指法,跟练&评测模式,默认展示贴底展示
             fingerBox:
@@ -307,7 +309,7 @@ export default defineComponent({
                     bottom: 0,
                     width: "100%",
                   }
-                : detailData.headerHide
+                : headerColumnHide.value
                 ? {
                     height: state.fingeringInfo.height,
                   }
@@ -391,9 +393,9 @@ export default defineComponent({
       () => state.playState,
       () => {
         // if (state.platform != IPlatform.PC) {
-        //   detailData.headerHide = state.playState === "play" ? true : false;
+        //   headerColumnHide.value = state.playState === "play" ? true : false;
         // }
-        detailData.headerHide = state.playState === "play" ? true : false;
+        headerColumnHide.value = state.playState === "play" ? true : false;
         sendParentMessage(state.playState);
       }
     );
@@ -401,7 +403,7 @@ export default defineComponent({
     watch(
       () => followData.start,
       () => {
-        detailData.headerHide = followData.start;
+        headerColumnHide.value = followData.start;
       }
     );
     /** 指法预览切换 */
@@ -490,7 +492,7 @@ export default defineComponent({
         {/* 曲目加载错误的缺省 */}
         <EmptyMusic></EmptyMusic>
         {/** 功能按钮 */}
-        {!state.isPreView && <div class={["headHeight", styles.headHeight, detailData.headerHide && styles.headHide]}>{state.musicRendered && <HeaderTop />}</div>}
+        {!state.isPreView && <div class={["headHeight", styles.headHeight, headerColumnHide.value && styles.headHide]}>{state.musicRendered && <HeaderTop />}</div>}
         <div
           id="scrollContainer"
           style={{ ...fingerConfig.value.container }}
@@ -498,11 +500,11 @@ export default defineComponent({
           onClick={(e: Event) => {
             e.stopPropagation();
             // if (state.playState === "play" && state.platform != IPlatform.PC) {
-            //   detailData.headerHide = !detailData.headerHide;
+            //   headerColumnHide.value = !headerColumnHide.value;
             // }
             // 点击谱面跟练也需要切换显示按钮栏
             if (state.playState === "play" || followData.start) {
-              detailData.headerHide = !detailData.headerHide;
+              headerColumnHide.value = !headerColumnHide.value;
             }
           }}
         >

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
src/page-instrument/view-evaluat-report/component/share-top/image/audioBga.json


+ 23 - 10
src/state.ts

@@ -18,7 +18,7 @@ import { changeSongSourceByBate } from "/src/view/audio-list"
 import { moveSmoothAnimation, smoothAnimationState, moveSmoothAnimationByPlayTime, moveTranslateXNum, destroySmoothAnimation, calcClientWidth } from "/src/page-instrument/view-detail/smoothAnimation"
 import { storeData } from "/src/store";
 import { downloadXmlStr } from "./view/music-score"
-import { musicScoreRef } from "/src/page-instrument/view-detail/index"
+import { musicScoreRef, headerColumnHide } from "/src/page-instrument/view-detail/index"
 import { headTopData } from "/src/page-instrument/header-top/index";
 
 const query: any = getQuery();
@@ -637,11 +637,18 @@ export const onEnded = () => {
 
 // 根据当前小节动态设置,右上角展示的速度
 const dynamicShowPlaySpeed = (index: number) => {
-  const item: any = state.times[index];
-  if (item && item.measureSpeed ) {
-    // console.log('速度1',item.measureSpeed)
-    state.speed = Math.floor(state.basePlayRate * item.measureSpeed)
+  if (!headerColumnHide.value) {
+    console.log('动态计算速度')
+    const item: any = state.times[index];
+    if (item && item.measureSpeed ) {
+      // console.log('速度1',item.measureSpeed)
+      const newSpeed = Math.floor(state.basePlayRate * item.measureSpeed)
+      if (state.speed !== newSpeed) {
+        state.speed = newSpeed;
+      }
+    }
   }
+
 }
 
 // 开始播放时,计算mp3的播放倍率
@@ -1332,10 +1339,11 @@ const getMusicInfo = async (res: any) => {
   downloadXmlStr.value = xmlString //给musice-score 赋值xmlString 以免加载2次
   const tracks = xmlToTracks(xmlString) //获取声轨列表
   // 设置音源  track 为当前的声轨 index为当前的
-  const { track, index } = state.isSimplePage ? { track:tracks[0], index:0} : initMusicSource(res.data, tracks, partIndex)
+  const { track, index, musicalInstrumentId } = state.isSimplePage ? { track:tracks[0], index:0, musicalInstrumentId: '' } : initMusicSource(res.data, tracks, partIndex)
+  const realTrack = musicalInstrumentId && res.data?.musicalInstruments?.length ? res.data?.musicalInstruments.find((item: any) => item?.id == musicalInstrumentId)?.code?.split(',')?.[0] : '';
   const musicInfo = {
     ...res.data,
-    track
+    track: res.data.musicSheetType === 'CONCERT' ? track : realTrack
   };
   console.log("🚀 ~ musicInfo:", musicInfo);
   setState(musicInfo, index);
@@ -1354,7 +1362,7 @@ function xmlToTracks(xmlString: string) {
 }
 // 设置音源
 function initMusicSource(data: any, tracks: string[], partIndex: number) {
-  let track:string,index:number
+  let track:string,index:number, musicalInstrumentId: string
   const instrumentId = query.instrumentId || storeData.user?.instrumentId
   let { musicSheetType, isAllSubject, musicSheetSoundList, musicSheetAccompanimentList } = data
   musicSheetSoundList || (musicSheetSoundList = [])
@@ -1383,6 +1391,7 @@ function initMusicSource(data: any, tracks: string[], partIndex: number) {
     index = tracks.findIndex(item => {
       return item === track
     })
+    musicalInstrumentId = musicObj?.musicalInstrumentId
   } else {
     /* 合奏 */
     // 支持总谱 并且当前是总谱。partIndex是999时候,或者默认是总谱并且partIndex为-1时候  -1就是partIndex没有值
@@ -1410,6 +1419,7 @@ function initMusicSource(data: any, tracks: string[], partIndex: number) {
         }
         track = "总谱"
         index = 999
+        musicalInstrumentId = ''
     }else{
       // 合奏只显示一个声轨
       track = tracks[partIndex===-1?0:partIndex]
@@ -1429,6 +1439,7 @@ function initMusicSource(data: any, tracks: string[], partIndex: number) {
       index = tracks.findIndex(item => {
         return item === track
       })
+      musicalInstrumentId = musicObj?.musicalInstrumentId
     }
   }
   // 当没有任何曲目的时候报错
@@ -1473,7 +1484,8 @@ function initMusicSource(data: any, tracks: string[], partIndex: number) {
   }
   return {
     index,
-    track
+    track,
+    musicalInstrumentId
   }
 }
 const setState = (data: any, index: number) => {
@@ -1589,7 +1601,8 @@ const setState = (data: any, index: number) => {
    * 各平台的乐器声部id不统一,为了兼容处理老的数据,加上乐器code码,此码唯一
    * 获取指法code
    */
-  const code = state.isConcert ? matchVoicePart(state.trackId, "CONCERT") : matchVoicePart(state.musicalCodeId, "SINGLE");
+  // const code = state.isConcert ? matchVoicePart(state.trackId, "CONCERT") : matchVoicePart(state.musicalCodeId, "SINGLE");
+  const code = matchVoicePart(state.trackId, "CONCERT")
   state.fingeringInfo = subjectFingering(code);
   console.log("🚀 ~ state.fingeringInfo:", code, state.fingeringInfo, state.trackId, state.track);
   state.musicalCodeId = state.fingeringInfo?.id || 0

+ 3 - 3
src/view/audio-list/index.tsx

@@ -269,9 +269,9 @@ export default defineComponent({
 			const time = currentTime / 1000;
 			audioData.progress = time;
 			tickAnimate(time);
-			audioData.songEle && (audioData.songEle.currentTime = time);
-			audioData.backgroundEle && (audioData.backgroundEle.currentTime = time);
-			audioData.mingSongEle && (audioData.mingSongEle.currentTime = time);
+			// audioData.songEle && (audioData.songEle.currentTime = time);
+			// audioData.backgroundEle && (audioData.backgroundEle.currentTime = time);
+			// audioData.mingSongEle && (audioData.mingSongEle.currentTime = time);
 			audioData.duration = total / 1000;
 			if (
 				res?.content?.totalDuration > 1000 &&

+ 1 - 1
src/view/fingering/fingering-config.ts

@@ -343,7 +343,7 @@ export const matchVoicePart = (id: number | string, type: "SINGLE" | "CONCERT"):
       code = code.toLocaleLowerCase().replace(/ /g, "");
       for (let sKey in subject) {
         let pitchKey = sKey;
-        if (typeof sKey === "string") {
+        if (typeof sKey === "string" && isNaN(Number(sKey)) ) {
           pitchKey = pitchKey.toLocaleLowerCase().replace(/ /g, "");
           pitchKey = pitchKey.replace(/[_0-9]+$/, '');
         }

+ 1 - 0
src/view/selection/index.module.less

@@ -311,5 +311,6 @@
         background: linear-gradient(rgba(7, 24, 56, 0.5) 0%, #010D31 100%);
         filter: blur(5Px);
         opacity: 0.7;
+        margin-top: -4px;
     }
 }

Vissa filer visades inte eftersom för många filer har ändrats