TIANYONG пре 1 година
родитељ
комит
a08a9f6ec6

+ 23 - 0
src/page-instrument/header-top/image/tickoff.svg

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="29px" height="29px" viewBox="0 0 29 29" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>节拍器关</title>
+    <g id="蓝色" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="曲谱评测(按钮合集)备份" transform="translate(-1007.000000, -13.000000)">
+            <g id="节拍器关" transform="translate(1007.000000, 13.000000)">
+                <g id="列表" fill="#1CACF1">
+                    <rect id="矩形备份-33" x="0" y="0" width="29" height="29" rx="14.5"></rect>
+                </g>
+                <g id="节拍器(开)" transform="translate(7.400000, 6.200000)" stroke="#FFFFFF" stroke-width="2">
+                    <path d="M3.90828041,0 L10.1523256,0 C11.152177,-1.83669718e-16 11.9984118,0.738386518 12.1338828,1.72901783 L13.7500444,13.5471996 C13.8997037,14.6415834 13.1338532,15.6500796 12.0394694,15.7997389 C11.9496643,15.81202 11.8591282,15.8181818 11.7684873,15.8181818 L2.2921188,15.8181818 C1.1875493,15.8181818 0.292118795,14.9227513 0.292118795,13.8181818 C0.292118795,13.7275409 0.298280624,13.6370048 0.310561665,13.5471996 L1.92672328,1.72901783 C2.06219423,0.738386518 2.90842904,1.07184814e-15 3.90828041,0 Z" id="矩形"></path>
+                    <line x1="1.31818182" y1="10.1060606" x2="11.8636364" y2="10.1060606" id="直线-2" stroke-linecap="square"></line>
+                    <line x1="5.71212121" y1="10.1060606" x2="14.0606061" y2="0.878787879" id="直线-2备份" stroke-linecap="round"></line>
+                    <circle id="椭圆形" fill="#1CACF1" cx="11.8636364" cy="3.51515152" r="1.63636364"></circle>
+                </g>
+                <g id="编组-14" transform="translate(15.000000, 14.000000)">
+                    <circle id="椭圆形备份-2" fill="#FFFFFF" cx="5" cy="5" r="5"></circle>
+                    <path d="M3.28357161,7.18249653 C4.30635242,8.04462452 5.78187623,8.02724986 6.78526562,7.14126323 C7.788655,6.25527659 8.03118905,4.75561675 7.36084427,3.58228991 L3.28357161,7.18249653 Z M2.53425343,6.1905957 L6.55152611,2.68873619 C5.5381078,1.97165993 4.18431677,2.04180535 3.24583741,2.86001735 C2.30735805,3.67822936 2.01621964,5.04221354 2.53493525,6.1905957 L2.53425343,6.1905957 Z M5,9.09090909 C2.7406533,9.09090909 0.909090909,7.2593467 0.909090909,5 C0.909090909,2.7406533 2.7406533,0.909090909 5,0.909090909 C7.2593467,0.909090909 9.09090909,2.7406533 9.09090909,5 C9.09090909,7.2593467 7.2593467,9.09090909 5,9.09090909 Z" id="形状备份" fill="#FF9100" fill-rule="nonzero"></path>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 19 - 0
src/page-instrument/header-top/image/tickon.svg

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="29px" height="29px" viewBox="0 0 29 29" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>节拍器</title>
+    <g id="蓝色" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="曲谱评测(按钮合集)备份" transform="translate(-961.000000, -13.000000)">
+            <g id="节拍器" transform="translate(961.000000, 13.000000)">
+                <g id="列表" fill="#1CACF1">
+                    <rect id="矩形备份-33" x="0" y="0" width="29" height="29" rx="14.5"></rect>
+                </g>
+                <g id="节拍器(开)" transform="translate(7.400000, 6.200000)" stroke="#FFFFFF" stroke-width="2">
+                    <path d="M3.90828041,0 L10.1523256,0 C11.152177,-1.83669718e-16 11.9984118,0.738386518 12.1338828,1.72901783 L13.7500444,13.5471996 C13.8997037,14.6415834 13.1338532,15.6500796 12.0394694,15.7997389 C11.9496643,15.81202 11.8591282,15.8181818 11.7684873,15.8181818 L2.2921188,15.8181818 C1.1875493,15.8181818 0.292118795,14.9227513 0.292118795,13.8181818 C0.292118795,13.7275409 0.298280624,13.6370048 0.310561665,13.5471996 L1.92672328,1.72901783 C2.06219423,0.738386518 2.90842904,1.07184814e-15 3.90828041,0 Z" id="矩形"></path>
+                    <line x1="1.31818182" y1="10.1060606" x2="11.8636364" y2="10.1060606" id="直线-2" stroke-linecap="square"></line>
+                    <line x1="5.71212121" y1="10.1060606" x2="14.0606061" y2="0.878787879" id="直线-2备份" stroke-linecap="round"></line>
+                    <circle id="椭圆形" fill="#1CACF1" cx="11.8636364" cy="3.51515152" r="1.63636364"></circle>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

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

@@ -352,7 +352,7 @@ export default defineComponent({
                 </>}
               </span>
             </div>
-            {state.musicRendered && !query.lessonTrainingId && !query.questionId && (
+            {state.musicRendered && !query.lessonTrainingId && !query.questionId && state.isConcert && (
               <div class={[styles.btn]} onClick={() => {
                 toggleMusicSheet.toggle(true)
               }}>
@@ -372,6 +372,17 @@ export default defineComponent({
               <img style={{ display: state.playSource === "music" ? "none" : "" }} class={styles.iconBtn} src={headImg(`background.svg`)} />
               <span>{state.playSource === "music" ? "原声" : "伴奏"}</span>
             </div>
+            <div
+              class={styles.btn}
+              onClick={async () => {
+                metronomeData.disable = !metronomeData.disable;
+                metronomeData.metro?.initPlayer();
+              }}
+            >
+              <img style={{ display: metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickoff.svg")} />
+              <img style={{ display: !metronomeData.disable ? "block" : "none" }} class={styles.iconBtn} src={headImg("tickon.svg")} />
+              <span style={{ whiteSpace: "nowrap" }}>节拍器</span>
+            </div>            
             <div id={state.platform === IPlatform.PC ? "teacherTop-2" : "studnetT-2"} style={{ display: selectBtn.value.display ? "" : "none" }} class={[styles.btn, selectBtn.value.disabled && styles.disabled]} onClick={() => handleChangeSection()}>
               <img style={{ display: state.section.length === 0 ? "" : "none" }} class={styles.iconBtn} src={headImg(`section0.svg`)} />
               <img style={{ display: state.section.length === 1 ? "" : "none" }} class={styles.iconBtn} src={headImg(`section1.svg`)} />

+ 10 - 8
src/page-instrument/view-detail/index.tsx

@@ -162,19 +162,19 @@ export default defineComponent({
 
       // console.log("🚀 ~ state.subjectId:", state.subjectId, state.track as any , state.subjectId)
       // 是否打击乐
-      state.isPercussion =
-      	state.subjectId == 23 ||
-      	state.subjectId == 113 ||
-      	state.subjectId == 121 ||
-      	isRhythmicExercises();
-
+      // state.isPercussion =
+      // 	state.subjectId == 23 ||
+      // 	state.subjectId == 113 ||
+      // 	state.subjectId == 121 ||
+      // 	isRhythmicExercises();
+      state.isPercussion = isRhythmicExercises();
       // 设置是否特殊曲谱, 是特殊曲谱取反(不理解之前的思考逻辑), 使用后台设置的速度
       state.isSpecialBookCategory = !classids.includes(data.musicSheetCategoriesId) 
 
       // 设置指法
       const code = mappingVoicePart(state.trackId, "INSTRUMENT");
       state.fingeringInfo = subjectFingering(code);
-      console.log("🚀 ~ state.fingeringInfo:", state.fingeringInfo, state.trackId, state.track);
+      console.log("🚀 ~ state.fingeringInfo:", code, state.fingeringInfo, state.trackId, state.track);
 
       // 检测是否原音和伴奏都有
       if (!state.music || !state.accompany) {
@@ -189,6 +189,8 @@ export default defineComponent({
 
       //课堂乐器, 渲染类型: 五线谱, 简谱
       state.musicRenderType = query.musicRenderType || EnumMusicRenderType.firstTone;
+      // 是否是合奏,先根据background判断
+      state.isConcert = data.background?.length > 1
       console.log('state对象', state)
     };
 
@@ -442,7 +444,7 @@ export default defineComponent({
         )}
 
         {/* 切换曲谱 */}
-        {!query.lessonTrainingId && !query.questionId && (
+        {!query.lessonTrainingId && !query.questionId && state.isConcert && (
           <ToggleMusicSheet />
         )}
 

+ 3 - 1
src/state.ts

@@ -160,7 +160,7 @@ const state = reactive({
   /** 是否重复节拍器的时间 */
   repeatedBeats: 0,
   /**当前曲谱中所有声部名字 */
-  partListNames: [] as string[],
+  partListNames: [] as any,
   /** 渐变速度信息 */
   gradual: [] as GradualNote[],
   /** 渐变速度版本 */
@@ -179,6 +179,8 @@ const state = reactive({
   isReport: false,
   /** 是否隐藏评测报告弹窗,保存演奏按钮,默认不隐藏 */
   isHideEvaluatReportSaveBtn: false,
+  /** 是否是合奏 */
+  isConcert: false
 });
 const browserInfo = browser();
 let offset_duration = 0;

+ 49 - 6
src/view/fingering/fingering-config.ts

@@ -57,7 +57,8 @@ export type IVocals =
 export const mappingVoicePart = (
 	id: number | string,
 	soruce: "GYM" | "COLEXIU" | "ORCHESTRA" | "INSTRUMENT"
-): number => {
+): number | string => {
+	console.log(1)
 	if (soruce === "GYM") {
 		return Number(id);
 	} else if (soruce === "COLEXIU") {
@@ -97,11 +98,41 @@ export const mappingVoicePart = (
 		return subject[id];
 	} else if (soruce === "INSTRUMENT") {
 		let code = id;
-		if (typeof code === "string") {
-			code = code.toLocaleLowerCase().replace(/ /g, "");
-		}
+		// if (typeof code === "string") {
+		// 	//code = code.toLocaleLowerCase().replace(/ /g, "");
+		// 	code = code.toLocaleLowerCase().split(' ')[0]
+		// }
 		const subject: { [_key: string | number]: any } = {
+			"Flute 1": 2,
+			"Flute 2": 2,
+			"Oboe": 4,
+			"Clarinet in Bb 1": 4,
+			"Clarinet in Bb 2": 4,
+			"Alto Clarinet in Eb": 4,
+			"Bass Clarinet in Bb": 4,
+			"Bassoon": 1,
+			"Alto Saxophone": 5,
+			"Tenor Saxophone": 5,
+			"Baritone Saxophone": 5,
+			"Trumpet in Bb 1": 12,
+			"Trumpet in Bb 2": 12,
+			"Horn in F": 13,
+			"Trombone 1": 14,
+			"Trombone 2": 14,
+			"Euphonium": 15,
+			"Tuba": 17,
+			"Chimes": 1,
+			"Bells": 1,
+			"Xylophone": 1,
+			"Snare Drum": 1,
+			"Bass Drum": 1,
+			"Triangle": 1,
+			"Suspended Cymbal": 1,
+			"Crash Cymbals": 1,
+			"Concert Toms": 1,
+			"Timpani": 1,
 			flute: 2,
+			oboe: 4,
 			clarinet: 4,
 			trombone: 14,
 			tuba: 17,
@@ -130,14 +161,26 @@ export const mappingVoicePart = (
 			ocarina: "ocarina",
 			nai: "melodica",
 		};
-		const _track = typeof code === 'string' ? Object.keys(subject).filter((key) => key.includes(String(code)) || String(code).includes(key))[0] : code
-		return subject[_track] || 0;
+		let _track;
+		if (typeof code === 'string') {
+			for (let sKey in subject) {
+				if(sKey === code) {
+					_track = subject[sKey]
+					break;
+				}
+			}
+		} else {
+			_track = subject.code
+		}
+		// const _track = typeof code === 'string' ? Object.keys(subject).filter((key) => key.includes(String(code)) || String(code).includes(key))[0] : code
+		return _track;
 	}
 	return 0;
 };
 
 /** 声部的指法配置信息 */
 export const subjectFingering = (subjectId: number | string): IFingering => {
+	subjectId = isNaN(Number(subjectId)) ? subjectId : Number(subjectId)
 	switch (subjectId) {
 		case 2: // 长笛
 			return {

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

@@ -21,6 +21,7 @@ export default defineComponent({
     const columns = computed(() => {
       return partListNames.value
     })
+    console.log(partListNames.value, partIndex.value, selectIndex.value, columns.value, 999999)
     return () => (
       <div class={styles.container}>
         <div class={styles.top}>
@@ -29,12 +30,12 @@ export default defineComponent({
         </div>
         <Picker
           class={styles.picker}
-          defaultIndex={partIndex.value}
+          defaultIndex={props.partIndex}
           showToolbar={false}
           columns={columns.value}
           visibleItemCount={Math.ceil(document.body.clientHeight / 44 / 3)}
           onChange={(row) => {
-            //console.log('选择的索引', row)
+            // console.log('选择的索引', row)
             selectIndex.value = row.selectedValues[0]
           }}
         />