liushengqiang 1 年間 前
コミット
32e80b7cac

+ 35 - 30
src/page-instrument/view-detail/index.tsx

@@ -75,20 +75,12 @@ const resetFrequency = (list: any[]) => {
  * 乐器指法处理
  */
 const setNoteHalfTone = (list: any[]) => {
-	const instrumentNames = ["melodica"];
+	const instrumentNames = ["hulusi-flute"];
 	if (!state.fingeringInfo?.name || !instrumentNames.includes(state.fingeringInfo.name)) return list;
 	for (let i = 0; i < list.length; i++) {
 		const note = list[i];
-		if (note.noteElement?.pitch?.accidentalXml) {
-			const accidentalXml = note.noteElement?.pitch?.accidentalXml;
-			if ([]) {
-			}
-			if (accidentalXml === "flat") {
-				// note.realKey = note.realKey + 1;
-			} else if (accidentalXml === "sharp") {
-				// note.realKey = note.realKey + 1;
-			}
-		}
+		if (note.realKey === 0) continue;
+		note.realKey = note.realKey + 12;
 	}
 	return list;
 };
@@ -105,6 +97,7 @@ export default defineComponent({
 			headerHide: false,
 			fingerPreView: false,
 			orientation: 0,
+			fingerPreViewGuide: false,
 		});
 		const getAPPData = async () => {
 			const screenData = await isSpecialShapedScreen();
@@ -132,7 +125,7 @@ export default defineComponent({
 		//给app传伴奏
 		const pushAppMusic = () => {
 			api_cloudAccompanyMessage(state.accompany);
-		  }
+		};
 		// console.log(route.params, query)
 		/** 获取曲谱数据 */
 		const getMusicInfo = (res: any) => {
@@ -194,7 +187,7 @@ export default defineComponent({
 			// 	isRhythmicExercises();
 
 			// 设置指法
-			const code = mappingVoicePart(state.subjectId, "INSTRUMENT")
+			const code = mappingVoicePart(state.subjectId, "INSTRUMENT");
 			state.fingeringInfo = subjectFingering(code);
 			console.log("🚀 ~ state.fingeringInfo:", state.fingeringInfo, state.subjectId, state.track);
 
@@ -246,7 +239,7 @@ export default defineComponent({
 			}
 			state.times = formateTimes(osmd);
 			state.times = resetFrequency(state.times);
-			// state.times = setNoteHalfTone(state.times);
+			state.times = setNoteHalfTone(state.times);
 			console.log("🚀 ~ state.times:", state.times, state.subjectId);
 			try {
 				metronomeData.metro = new Metronome();
@@ -341,16 +334,19 @@ export default defineComponent({
 			}
 		);
 		/** 指法预览切换 */
-		watch(() => detailData.fingerPreView, () => {
-			console.log(2342)
-			window.parent.postMessage(
-				{
-					api: "api_fingerPreView",
-					state: detailData.fingerPreView,
-				},
-				"*"
-			);
-		})
+		watch(
+			() => detailData.fingerPreView,
+			() => {
+				console.log(2342);
+				window.parent.postMessage(
+					{
+						api: "api_fingerPreView",
+						state: detailData.fingerPreView,
+					},
+					"*"
+				);
+			}
+		);
 		onMounted(() => {
 			window.addEventListener("resize", resetMusicScore);
 		});
@@ -373,13 +369,13 @@ export default defineComponent({
 			// 	url: url,
 			// 	orientation: state.fingeringInfo.orientation || 0,
 			// });
-			
-			if (state.playState === 'play') {
-				togglePlay('paused')
+
+			if (state.playState === "play") {
+				togglePlay("paused");
 				setTimeout(() => {
 					detailData.fingerPreView = true;
-				}, 500)
-				return
+				}, 500);
+				return;
 			}
 			detailData.fingerPreView = true;
 		};
@@ -388,6 +384,7 @@ export default defineComponent({
 				api_setRequestedOrientation(0);
 			}
 			detailData.fingerPreView = false;
+			detailData.fingerPreViewGuide = false;
 		};
 		return () => (
 			<div
@@ -476,8 +473,16 @@ export default defineComponent({
 					</>
 				)}
 
-				<Popup teleport="body" v-model:show={detailData.fingerPreView} position="bottom">
+				<Popup
+					teleport="body"
+					v-model:show={detailData.fingerPreView}
+					position="bottom"
+					onOpened={() => {
+						detailData.fingerPreViewGuide = true;
+					}}
+				>
 					<ViewFigner
+						show={detailData.fingerPreViewGuide}
 						subject={state.fingeringInfo.name}
 						isComponent={true}
 						onClose={handleCloseFignerView}

+ 7 - 5
src/page-instrument/view-figner/index.tsx

@@ -36,6 +36,10 @@ export default defineComponent({
 	name: "viewFigner",
 	emits: ["close"],
 	props: {
+		show: {
+			type: Boolean,
+			default: true,
+		},
 		isComponent: {
 			type: Boolean,
 			default: false,
@@ -80,7 +84,7 @@ export default defineComponent({
 
 			huaweiPad: navigator?.userAgent?.includes("UAWEIVRD-W09") ? true : false,
 			paddingTop: '',
-			paddingLeft:''
+			paddingLeft:'',
 		});
 		const fingerData = reactive({
 			relationshipIndex: 0,
@@ -166,9 +170,7 @@ export default defineComponent({
 			}
 			data.loadingSoundProgress = 100;
 			api_cloudLoading();
-			nextTick(() => {
-				data.loadingSoundFonts = false;
-			})
+			data.loadingSoundFonts = false;
 			// console.log("🚀 ~ data.soundFonts:", data.soundFonts);
 		};
 		onBeforeMount(() => {
@@ -592,7 +594,7 @@ export default defineComponent({
 						</div>
 					</Popup>
 
-					{!data.loading && !data.loadingSoundFonts && <GuideIndex showGuide={false} list={["finger"]} />}
+					{props.show && !data.loading && !data.loadingSoundFonts && <GuideIndex showGuide={false} list={["finger"]} />}
 				</div>
 			);
 		};

+ 0 - 2
src/view/fingering/index.tsx

@@ -43,7 +43,6 @@ export default defineComponent({
 				<>
 					{state.fingeringInfo.direction === "transverse" ? (
 						<div onClick={() => doubeClick()} class={[styles.fingeringContainer]}>
-							<span class={[styles.yidiao, rs.includes(0) && styles.canDisplay]}>转调</span>
 
 							<div class={styles.imgs}>
 								<img src={fingerData.subject?.json?.full} />
@@ -82,7 +81,6 @@ export default defineComponent({
 									style={{ display: state.fingeringInfo.disabledFinger ? "none" : "" }}
 									class={styles.rightContent}
 								>
-									<span class={[styles.yidiao, rs.includes(0) && styles.canDisplay]}>转调</span>
 									<div
 										class={[styles.tizhi, canTizhi && styles.canDisplay]}
 										onClick={() =>

+ 2 - 2
vite.config.ts

@@ -64,8 +64,8 @@ export default defineConfig({
 				rewrite: (path) => path.replace(/^\/orchestra/, ""),
 			},
 			"^/instrument/.*": {
-				// target: "https://dev.kt.colexiu.com",
-				target: "https://test.lexiaoya.cn",
+				target: "https://kt.colexiu.com",
+				// target: "https://test.lexiaoya.cn",
 				changeOrigin: true,
 				rewrite: (path) => path.replace(/^\/instrument/, ""),
 			},