Przeglądaj źródła

pc端不隐藏头部

liushengqiang 2 lat temu
rodzic
commit
068fef78b0

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

@@ -120,6 +120,6 @@
     }
 
     .headHeight.headHide {
-        margin-top: 0 !important;
+        // margin-top: 0 !important;
     }
 }

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

@@ -326,7 +326,9 @@ export default defineComponent({
 		watch(
 			() => state.playState,
 			() => {
-				detailData.headerHide = state.playState === "play" ? true : false;
+				if (state.platform != IPlatform.PC) {
+					detailData.headerHide = state.playState === "play" ? true : false;
+				}
 				sendParentMessage(state.playState);
 			}
 		);
@@ -391,7 +393,7 @@ export default defineComponent({
 						browsInfo.xiaomi && styles.xiaomi,
 					]}
 					onClick={(e: Event) => {
-						if (state.playState === "play") {
+						if (state.playState === "play" && state.platform != IPlatform.PC) {
 							detailData.headerHide = !detailData.headerHide;
 						}
 					}}

+ 1 - 1
src/state.ts

@@ -349,7 +349,7 @@ const setCursorPosition = (note: any, cursor: any) => {
 		state.musicRenderType === EnumMusicRenderType.firstTone ||
 		state.musicRenderType === EnumMusicRenderType.fixedTone
 	) {
-		const noteBox = note?.svgElement.attrs.el
+		const noteBox = note?.svgElement?.attrs?.el
 			?.querySelector(".vf-numbered-note-head")
 			?.getBoundingClientRect();
 		if (!noteBox) return;