Browse Source

feat: 评测频率

TIANYONG 1 year ago
parent
commit
afbd10dd14

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

@@ -200,16 +200,16 @@
 .operateHz {
     display: flex;
     align-items: center;
-    font-size: 12px;
+    font-size: 14px;
     color: var(--van-primary-color);
     font-weight: 500;
     img {
-        width: 22px;
-        height: 22px;
+        width: 28px;
+        height: 28px;
     }
     span {
         margin: 0 6px;
-        width: 40px;
+        width: 50px;
         text-align: center;
     }
 }

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

@@ -136,7 +136,7 @@ export default defineComponent({
 							</Cell>
 							<Cell class={[state.modeType == "evaluating" && styles.disabled]} title="显示指法" center>
 								{{
-									extra: () => <Switch v-model={state.setting.displayFingering}></Switch>,
+									extra: () => <Switch v-model={state.setting.displayFingering} disabled={!state.fingeringInfo.name}></Switch>,
 								}}
 							</Cell>
 						</Tab>

+ 3 - 2
src/state.ts

@@ -360,7 +360,7 @@ const handlePlaying = () => {
   // console.log(11111,currentTime,duration,state.playSource, item.i)
   // console.log(item.i,item.noteId,item.measureSpeed)
   // 练习模式下,实时刷新小节速度
-  if (state.modeType === "practise" && state.playState === "play" && item.measureSpeed && item.measureSpeed !== state.playIngSpeed) {
+  if (item && state.modeType === "practise" && state.playState === "play" && item.measureSpeed && item.measureSpeed !== state.playIngSpeed) {
     state.playIngSpeed = item.measureSpeed
   }
   if (item) {
@@ -857,7 +857,8 @@ const setState = (data: any, index: number) => {
   state.musicRenderType = query.musicRenderType || EnumMusicRenderType.firstTone;
   console.log("state对象", state);
   // 评测基准频率
-  state.baseFrequency = data.evaluationFrequency || 440
+  state.baseFrequency = data.evaluationFrequency ? data.evaluationFrequency.split(",")[0] : 440
+  state.baseFrequency = Number(state.baseFrequency)
 };
 
 // 多分轨合并显示标示