Explorar o código

Merge branch 'new-feature-tianyong' into kt-dev

TIANYONG hai 1 ano
pai
achega
fcd81e67aa

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

+ 8 - 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) {
@@ -837,6 +837,11 @@ const setState = (data: any, index: number) => {
   state.fingeringInfo = subjectFingering(code);
   console.log("🚀 ~ state.fingeringInfo:", code, state.fingeringInfo, state.trackId, state.track);
 
+  // 如果切换的声轨没有指法,择指法开关置灰并且不可点击
+  if (!state.fingeringInfo.name && state.setting.displayFingering) {
+    state.setting.displayFingering = false
+  }
+
   // 检测是否原音和伴奏都有
   if (!state.music || !state.accompany) {
     state.playSource = state.music ? "music" : "background";
@@ -852,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)
 };
 
 // 多分轨合并显示标示

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

@@ -255,6 +255,7 @@ export const matchVoicePart = (id: number | string, type: "SINGLE" | "CONCERT"):
       "Flute 1": 2,
       "Flute 2": 2,
       Oboe: 1,
+      "Clarinet in Bb": 4,
       "Clarinet in Bb 1": 4,
       "Clarinet in Bb 2": 4,
       "Alto Clarinet in Eb": 4,

+ 2 - 2
src/view/plugins/toggleMusicSheet/choosePartName/index.tsx

@@ -21,7 +21,7 @@ export default defineComponent({
     const columns = computed(() => {
       return partListNames.value
     })
-    console.log(partListNames.value, partIndex.value, selectIndex.value, columns.value, 999999)
+    // console.log(partListNames.value, partIndex.value, selectIndex.value, columns.value, 999999)
     /**
      * 默认选中的
      * picker组件,3.x的版本可以使用defaultIndex,4.x的版本只能使用v-model传递
@@ -29,7 +29,7 @@ export default defineComponent({
     const selValues = ref([partIndex.value]);
     const myPicker = ref();
     onMounted(() => {
-			console.log(myPicker.value)
+			// console.log(myPicker.value,99999,selValues.value,props.partIndex)
 		});
     return () => (
       <div class={styles.container}>

+ 4 - 2
src/view/plugins/toggleMusicSheet/index.tsx

@@ -38,8 +38,10 @@ export default defineComponent({
 
     const trackIdx: any = computed(() => {
       if (partListNames && partListNames.value.length) {
-        // console.log(3333,partListNames)
-        return partListNames.value.findIndex((item: any) => item.value == state.partIndex)
+        
+        const idx = partListNames.value.find((item: any) => item.value == state.partIndex).value
+        console.log(3333,idx)
+        return idx
       } else {
         return 0
       }