Browse Source

多个指法

liushengqiang 1 year ago
parent
commit
7a1aaa6455
2 changed files with 17 additions and 10 deletions
  1. 1 1
      src/page-instrument/view-figner/index.tsx
  2. 16 9
      src/view/fingering/fingering-config.ts

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

@@ -349,7 +349,7 @@ export default defineComponent({
 									class={styles.baseBtn}
 									onClick={() => {
 										data.viewIndex++;
-										if (data.viewIndex > 2) {
+										if (data.viewIndex > 3) {
 											data.viewIndex = 0;
 										}
 										getFingeringData();

+ 16 - 9
src/view/fingering/fingering-config.ts

@@ -43,6 +43,7 @@ export type IVocals =
 	| "pan-flute"
 	| "pan-flute1"
 	| "pan-flute2"
+	| "pan-flute3"
 	| "ocarina"
 	| "melodica";
 
@@ -89,9 +90,9 @@ export const mappingVoicePart = (
 		};
 		return subject[id];
 	} else if (soruce === "INSTRUMENT") {
-		let code = id
-		if (typeof code === 'string') {
-			code = code.toLocaleLowerCase().replace(/ /g, '')
+		let code = id;
+		if (typeof code === "string") {
+			code = code.toLocaleLowerCase().replace(/ /g, "");
 		}
 		const subject: { [_key: string | number]: any } = {
 			flute: 2,
@@ -201,7 +202,7 @@ export const subjectFingering = (subjectId: number | string): IFingering => {
 				direction: "vertical",
 				width: "3rem",
 				orientation: 1,
-				code: '竖笛',
+				code: "竖笛",
 				hasTizhi: true,
 			};
 		case "hulusi-flute": // 葫芦丝
@@ -210,7 +211,7 @@ export const subjectFingering = (subjectId: number | string): IFingering => {
 				direction: "vertical",
 				width: "3rem",
 				orientation: 1,
-				code: '葫芦丝',
+				code: "葫芦丝",
 				hasTizhi: false,
 			};
 		case "pan-flute": // 排箫
@@ -220,9 +221,9 @@ export const subjectFingering = (subjectId: number | string): IFingering => {
 				height: "2.6rem",
 				disabledFinger: true,
 				orientation: 0,
-				code: '排箫',
+				code: "排箫",
 				hasTizhi: false,
-				transform: 'scale(1.9) translateY(22px)',
+				transform: "scale(1.9) translateY(22px)",
 			};
 		case "ocarina": // 陶笛
 			return {
@@ -231,7 +232,7 @@ export const subjectFingering = (subjectId: number | string): IFingering => {
 				width: "3rem",
 				disabledFinger: true,
 				orientation: 0,
-				code: '陶笛',
+				code: "陶笛",
 				hasTizhi: false,
 			};
 		case "melodica": // 口风琴
@@ -240,7 +241,7 @@ export const subjectFingering = (subjectId: number | string): IFingering => {
 				direction: "transverse",
 				height: "1.8rem",
 				orientation: 0,
-				code: '口风琴',
+				code: "口风琴",
 				hasTizhi: false,
 			};
 		default:
@@ -353,6 +354,12 @@ export const getFingeringConfig = async (type: IVocals | undefined): Promise<ITy
 				json: pan2.default,
 				relationship: relationships.pan,
 			};
+		case "pan-flute3":
+			const pan3 = await import(`./fingering-img/pan-flute3/index.json`);
+			return {
+				json: pan3.default,
+				relationship: relationships.pan,
+			};
 		case "ocarina":
 			const ocarina = await import(`./fingering-img/ocarina/index.json`);
 			return {