浏览代码

pc端不隐藏头部

liushengqiang 2 年之前
父节点
当前提交
068fef78b0
共有 3 个文件被更改,包括 6 次插入4 次删除
  1. 1 1
      src/page-instrument/view-detail/index.module.less
  2. 4 2
      src/page-instrument/view-detail/index.tsx
  3. 1 1
      src/state.ts

+ 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;