Browse Source

fix: bug修复

TIANYONG 7 months ago
parent
commit
a4ce0bd0f4

+ 2 - 0
src/page-instrument/component/authorName/index.module.less

@@ -1,5 +1,7 @@
 .authorName{
     height: 1.8rem;
+    position: relative;
+    top: 36px;
 }
 .title{
     width: 280px;

+ 1 - 1
src/page-instrument/component/authorName/index.tsx

@@ -15,7 +15,7 @@ export default defineComponent({
       return () => (
          <>
             {
-               !smoothAnimationState.isShow.value && 
+               !smoothAnimationState.isShow.value && !state.isCombineRender && 
                <div class={["authorName", styles.authorName]}>
                   <div class={styles.title}>
                      <NoticeBar text={state.examSongName} background="none" />

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

@@ -584,7 +584,7 @@ export default defineComponent({
     const noticeBarWidth = ref<number>()
     watch(()=>smoothAnimationState.isShow.value, ()=>{
       // NoticeBar能不能滚动
-      if(smoothAnimationState.isShow.value && isMusicList.value){
+      if((smoothAnimationState.isShow.value || state.isCombineRender) && isMusicList.value){
         nextTick(()=>{
           const widthCon = (document.querySelector("#noticeBarRollDom .van-notice-bar__content") as any)?.offsetWidth || undefined
           noticeBarWidth.value = widthCon
@@ -646,7 +646,7 @@ export default defineComponent({
               <div id="noticeBarRollDom" class={styles.headTopLeftBox}>
                 <img src={iconBack} class={['headTopBackBtn', styles.img, !headTopData.showBack && styles.hidenBack]} onClick={handleBack} />
                 {
-                  smoothAnimationState.isShow.value ?
+                  smoothAnimationState.isShow.value || state.isCombineRender ?
                     <div 
                       style={
                         noticeBarWidth.value ? {

+ 4 - 0
src/page-instrument/view-detail/index.module.less

@@ -67,6 +67,10 @@
         transition: padding-bottom .2s;
         overflow: hidden;
     }
+    .multiContainer {
+        top: 0;
+        height: calc(100vh);
+    }
     .pcContainer {
         // height: calc(100vh - var(--header-height) - var(--pc-header-height));
     }

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

@@ -499,7 +499,7 @@ export default defineComponent({
         <div
           id="scrollContainer"
           style={{ ...fingerConfig.value.container }}
-          class={[styles.container, !state.setting.displayCursor && "hideCursor", browsInfo.xiaomi && styles.xiaomi, state.platform === IPlatform.PC && styles.pcContainer]}
+          class={[styles.container, !state.setting.displayCursor && "hideCursor", browsInfo.xiaomi && styles.xiaomi, state.platform === IPlatform.PC && styles.pcContainer, (!state.isSingleLine || state.isCombineRender) && styles.multiContainer]}
           onClick={(e: Event) => {
             e.stopPropagation();
             // if (state.playState === "play" && state.platform != IPlatform.PC) {

+ 1 - 0
src/page-instrument/view-detail/smoothAnimation/index.less

@@ -26,6 +26,7 @@
     }
     .authorName{
         position: fixed;
+        // position: absolute;
         left: 0;
         top: 36px;
         width: 100vw;

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

@@ -505,6 +505,7 @@ export const subjectFingering = (subjectId: number | string): IFingering => {
         hasTizhi: false,
         id: 39,
       };
+    case 137: // 口风琴
     case "melodica": // 口风琴
       return {
         name: "melodica",

+ 44 - 12
src/view/selection/index.tsx

@@ -145,19 +145,51 @@ const calcNoteData = () => {
 				MeasureNumberXMLList.push(item.MeasureNumberXML);
 			} else {
 				if (item.multipleRestMeasures) {
-					const preItem = selectData.staves.find(
-						(n: any) => n.MeasureNumberXML === item.MeasureNumberXML - 1
-					);
-					if (preItem?.staveBox) {
-						noteItem.staveBox = {
-							left: preItem.staveBox.left,
-							top: preItem.staveBox.top,
-							width: preItem.staveBox.width,
-							// height: preItem.staveBox.height,
-						};
-						selectData.staves.push(noteItem);
-						MeasureNumberXMLList.push(item.MeasureNumberXML);
+					console.log(111111)
+					if (state.isCombineRender) {
+						state.vfmeasures.forEach((item: any, idx: number) => {
+							const measureNum = item.getAttribute('data-num') ? Number(item.getAttribute('data-num')) : -1;
+							
+						})
+						let currentItem = null;
+						for (let index = 0; index < state.vfmeasures.length; index++) {
+							const element = state.vfmeasures[index];
+							const measureNum = element.getAttribute('data-num') ? Number(element.getAttribute('data-num')) : -1;
+							if (measureNum === item.MeasureNumberXML) {
+								currentItem = element
+								break;
+							}
+							
+						}
+						const staveBbox = currentItem?.querySelector('.vf-stave')?.getBoundingClientRect() || { x: 0, width: 0, y: 0, height: 0 };
+						if (currentItem) {
+							noteItem.staveBox = {
+								left: staveBbox.x - parentLeft + "px",
+								// top: ((item.stave.y || 0) - 5) * state.zoom + "px",
+								top: staveBbox.y - parentTop  + "px",
+								width: staveBbox.width + "px",
+								height: staveBbox.height + "px",
+								// height: preItem.staveBox.height,
+							};
+							selectData.staves.push(noteItem);
+							MeasureNumberXMLList.push(item.MeasureNumberXML);
+						}
+					} else {
+						const preItem = selectData.staves.find(
+							(n: any) => n.MeasureNumberXML === item.MeasureNumberXML - 1
+						);
+						if (preItem?.staveBox) {
+							noteItem.staveBox = {
+								left: preItem.staveBox.left,
+								top: preItem.staveBox.top,
+								width: preItem.staveBox.width,
+								// height: preItem.staveBox.height,
+							};
+							selectData.staves.push(noteItem);
+							MeasureNumberXMLList.push(item.MeasureNumberXML);
+						}
 					}
+
 				}
 			}
 		}