Ver código fonte

Merge branch 'feature-tianyong-newVersion' into ktyq-test-new

TIANYONG 10 meses atrás
pai
commit
cfb0cea19d

+ 23 - 0
src/helpers/customMusicScore.ts

@@ -618,6 +618,10 @@ export const resetFormate = () => {
 	if (!state.isCombineRender && state.isSingleLine) {
 	if (!state.isCombineRender && state.isSingleLine) {
 		transSinglePage();
 		transSinglePage();
 	}
 	}
+	// 多行谱,拍号可能被遮挡,需要移动谱面的位置
+	if (!state.isSingleLine) {
+		transMultiPosition();
+	}
 	// setTimeout(() => this.resetGlobalText());
 	// setTimeout(() => this.resetGlobalText());
 };
 };
 
 
@@ -644,6 +648,25 @@ const transSinglePage = () => {
 			// document.getElementById('osmdSvgPage1').style.transform = `translateY(${needTransDistance}px)`
 			// document.getElementById('osmdSvgPage1').style.transform = `translateY(${needTransDistance}px)`
 		}
 		}
 	}
 	}
+	if (state.isSimplePage) {
+		const svgPage = document?.getElementById('osmdSvgPage1')?.getBoundingClientRect();
+		const staffLine = document?.querySelector('.staffline')?.getBoundingClientRect();
+		if (svgPage && staffLine) {
+			const needY = svgPage.height - (staffLine.y+staffLine.height) - 10;
+			// @ts-ignore
+			document.getElementById('osmdSvgPage1').style.transform = `translateY(${needY}px)`;
+		}
+	}
+}
+
+const transMultiPosition = () => {
+	const svgPage = document?.getElementById('osmdSvgPage1')?.getBoundingClientRect();
+	const staffLine = document?.querySelector('.staffline')?.getBoundingClientRect();
+	if (svgPage && staffLine && staffLine.y < svgPage.y) {
+		const needY = svgPage.y - staffLine.y + 5;
+		// @ts-ignore
+		document.querySelector('.staffline').style.transform = `translateY(${needY}px)`;
+	}
 }
 }
 
 
 // 技巧文本
 // 技巧文本

+ 1 - 1
src/helpers/formateMusic.ts

@@ -1022,7 +1022,7 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 			activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[0]] || [];
 			activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[0]] || [];
 			// 某些情况下,合并显示的妙极客曲子,note.sourceMeasure?.verticalMeasureList可能为空数组
 			// 某些情况下,合并显示的妙极客曲子,note.sourceMeasure?.verticalMeasureList可能为空数组
 			if (state.isCombineRender && state.isEvxml && note.sourceMeasure?.verticalMeasureList.length === 0) {
 			if (state.isCombineRender && state.isEvxml && note.sourceMeasure?.verticalMeasureList.length === 0) {
-				activeVerticalMeasureList = osmd.GraphicSheet.MeasureList.find((item: any) => item[0].MeasureNumber === note.sourceMeasure.MeasureNumberXML) || [];
+				activeVerticalMeasureList = osmd.GraphicSheet.MeasureList.find((item: any) => item[0]?.MeasureNumber === note.sourceMeasure.MeasureNumberXML) || [];
 			}
 			}
 			let currenrtVfVoices = activeVerticalMeasureList[0]?.vfVoices['1'] ? activeVerticalMeasureList[0]?.vfVoices['1'] : activeVerticalMeasureList[0]?.vfVoices['2'] ? activeVerticalMeasureList[0]?.vfVoices['2'] : null;
 			let currenrtVfVoices = activeVerticalMeasureList[0]?.vfVoices['1'] ? activeVerticalMeasureList[0]?.vfVoices['1'] : activeVerticalMeasureList[0]?.vfVoices['2'] ? activeVerticalMeasureList[0]?.vfVoices['2'] : null;
 			/**
 			/**

+ 2 - 2
src/page-instrument/header-top/settting/index.module.less

@@ -277,8 +277,8 @@
                     width: 118px;
                     width: 118px;
                     height: 39px;
                     height: 39px;
                     cursor: pointer;
                     cursor: pointer;
-                    &:first-child{
-                        margin-right: 20px;
+                    & + img{
+                        margin-left: 20px;
                     }
                     }
                 }
                 }
             }
             }

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

@@ -253,7 +253,9 @@ export default defineComponent({
 
 
                         <div class={styles.cellBtnBox}>
                         <div class={styles.cellBtnBox}>
                             <img  src={headImg("tpbz.png")} onClick={() => (helperData.screenModelShow = true)} />
                             <img  src={headImg("tpbz.png")} onClick={() => (helperData.screenModelShow = true)} />
-                            <img  src={headImg("yjfk.png")} onClick={() => (helperData.recommendationShow = true)} />
+                            {
+                                !query.isCbs && <img  src={headImg("yjfk.png")} onClick={() => (helperData.recommendationShow = true)} />
+                            }
                         </div>
                         </div>
                     </div>  
                     </div>  
                 </div>
                 </div>

+ 1 - 1
src/page-instrument/simple-detail/index.module.less

@@ -20,7 +20,7 @@ body {
     overflow: hidden;
     overflow: hidden;
     --header-height: 62px;
     --header-height: 62px;
     // background: var(--container-background);
     // background: var(--container-background);
-    background: brown;
+    background: transparent;
     position: relative;
     position: relative;
     .mask{
     .mask{
         position: absolute;
         position: absolute;

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

@@ -501,7 +501,7 @@ export default defineComponent({
                     <span>玫红色音符:演奏偏高</span>
                     <span>玫红色音符:演奏偏高</span>
                   </div>
                   </div>
                   <div class={styles.item}>
                   <div class={styles.item}>
-                    <Note fill="#4BED98" />
+                    <Note fill="#24E37E" />
                     <span>绿色音符:演奏正确</span>
                     <span>绿色音符:演奏正确</span>
                   </div>
                   </div>
                   <div class={styles.item}>
                   <div class={styles.item}>
@@ -518,7 +518,7 @@ export default defineComponent({
                   </div>
                   </div>
                   <div class={styles.item}>
                   <div class={styles.item}>
                     <Note fill="#7AB2FF" />
                     <Note fill="#7AB2FF" />
-                    <span>蓝色音符:时值不足</span>
+                    <span>蓝色音符:时值不足</span>
                   </div>
                   </div>
                   <div class={styles.item}>
                   <div class={styles.item}>
                     <Note fill="#FF7B00" />
                     <Note fill="#FF7B00" />
@@ -539,7 +539,7 @@ export default defineComponent({
                     <span>玫红色音符:演奏偏高</span>
                     <span>玫红色音符:演奏偏高</span>
                   </div>
                   </div>
                   <div class={styles.itemTone}>
                   <div class={styles.itemTone}>
-                    <i style={{ background: bgColors.right }}></i>
+                    <i style={{ background: "#24E37E" }}></i>
                     <span>绿色音符:演奏正确</span>
                     <span>绿色音符:演奏正确</span>
                   </div>
                   </div>
                   <div class={styles.itemTone}>
                   <div class={styles.itemTone}>
@@ -556,7 +556,7 @@ export default defineComponent({
                   </div>
                   </div>
                   <div class={styles.itemTone}>
                   <div class={styles.itemTone}>
                     <i style={{ background: bgColors.lack }}></i>
                     <i style={{ background: bgColors.lack }}></i>
-                    <span>蓝色音符:时值不足</span>
+                    <span>蓝色音符:时值不足</span>
                   </div>
                   </div>
                   <div class={styles.itemTone}>
                   <div class={styles.itemTone}>
                     <i style={{ background: bgColors.slow }}></i>
                     <i style={{ background: bgColors.slow }}></i>

+ 4 - 2
src/state.ts

@@ -1273,9 +1273,11 @@ let offsetTop = 0;
  * @returns void
  * @returns void
  */
  */
 export const scrollViewNote = () => {
 export const scrollViewNote = () => {
-  const cursorElement = document.getElementById("cursorImg-0")!;
+  // const cursorElement = document.getElementById("cursorImg-0")!;
+  const cursorElement: any = document.querySelector(`.noteIndex_${state.activeNoteIndex}`)!;
   const musicAndSelection = document.getElementById(state.scrollContainer)!;
   const musicAndSelection = document.getElementById(state.scrollContainer)!;
-  if (!cursorElement || !musicAndSelection || offsetTop === cursorElement.offsetTop) return;
+  // console.log('滑动',cursorElement.offsetTop,offsetTop, cursorElement, )
+  if (!cursorElement || !musicAndSelection || offsetTop === cursorElement.offsetTop || Math.abs(offsetTop - cursorElement.offsetTop) < 30) return;
   offsetTop = cursorElement.offsetTop;
   offsetTop = cursorElement.offsetTop;
   if (offsetTop > 50) {
   if (offsetTop > 50) {
     musicAndSelection.scrollTo({
     musicAndSelection.scrollTo({

+ 4 - 2
src/view/music-score/index.tsx

@@ -72,8 +72,10 @@ export default defineComponent({
 		};
 		};
 		const getXML = async () => {
 		const getXML = async () => {
 			// 当有下载的xml的时候直接使用,否则需要下载
 			// 当有下载的xml的时候直接使用,否则需要下载
-			const xmlStr = downloadXmlStr.value || await fetch(state.xmlUrl).then((response) => response.text());
-			downloadXmlStr.value = "" // 清空内存
+			if(!downloadXmlStr.value){
+				downloadXmlStr.value = await fetch(state.xmlUrl).then((response) => response.text())
+			}
+			const xmlStr = downloadXmlStr.value;
 			const xml = formatXML(xmlStr);
 			const xml = formatXML(xmlStr);
 			musicData.score = state.isCombineRender ? xml : onlyVisible(xml, state.partIndex);
 			musicData.score = state.isCombineRender ? xml : onlyVisible(xml, state.partIndex);
 			if (state.gradualTimes) {
 			if (state.gradualTimes) {

+ 2 - 1
src/view/tick/index.tsx

@@ -111,7 +111,8 @@ export const handleStartTick = async () => {
 	tickData.show = true;
 	tickData.show = true;
 	tickData.tickEnd = false;
 	tickData.tickEnd = false;
 	tickData.index = 0;
 	tickData.index = 0;
-	tickData.beatLengthInMilliseconds = (60 / state.speed) * 1000;
+	// tickData.beatLengthInMilliseconds = (60 / state.speed) * 1000;
+	tickData.beatLengthInMilliseconds = (state.times[0].xmlMp3BeatFixTime * 1000) / tickData.len || (60 / state.speed) * 1000;
 	for(let i = 0; i <= useLen.value; i++){
 	for(let i = 0; i <= useLen.value; i++){
 		// 提前结束, 直接放回false
 		// 提前结束, 直接放回false
 		if (tickData.tickEnd) return false;
 		if (tickData.tickEnd) return false;