liushengqiang 1 год назад
Родитель
Сommit
a5ec46a3e5

+ 31 - 11
orchestra.html

@@ -1,13 +1,33 @@
 <!DOCTYPE html>
 <html lang="en">
-  <head>
-    <meta charset="UTF-8" />
-    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
-    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>Vite + Vue + TS</title>
-  </head>
-  <body>
-    <div id="app"></div>
-    <script type="module" src="/src/main.ts"></script>
-  </body>
-</html>
+
+<head>
+  <meta charset="UTF-8" />
+  <!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->
+  <meta name="viewport"
+    content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
+  <title>管乐团云教练</title>
+  <!-- <link rel="icon" href="/favicon.ico" /> -->
+  <script src="/flexible.js" charset="UTF-8"></script>
+  <style>
+    #loading {
+      position: fixed;
+      left: 50%;
+      top: 50%;
+      transform: translate(-50%, -50%);
+      display: none;
+    }
+
+    #loading.show {
+      display: block;
+    }
+  </style>
+</head>
+
+<body>
+  <div id="app"></div>
+  <img id="loading" class="show" src="/loading.svg" alt="loading" />
+  <script type="module" src="/src/page-orchestra/main.ts"></script>
+</body>
+
+</html>

+ 2 - 2
src/page-orchestra/api.ts

@@ -2,7 +2,7 @@ import request from "../utils/request";
 
 /** 获取学生信息 */
 export const studentQueryUserInfo = async () => {
-	return await request.get(`/student/queryUserInfo`);
+	return await request.get(`/user/getUserInfo`);
 };
 /** 获取老师信息 */
 export const teacherQueryUserInfo = () => {
@@ -15,7 +15,7 @@ export const employeeQueryUserInfo = () => {
 
 /** 获取曲谱信息 */
 export const sysMusicScoreAccompanimentQueryPage = (sysMusicScoreId: string) => {
-	return request.get("/music/sheet/detail/" + sysMusicScoreId);
+	return request.get("/musicSheet/detail/" + sysMusicScoreId);
 };
 
 /** 获取曲谱分类 */

+ 24 - 17
src/page-orchestra/detail/index.tsx

@@ -70,8 +70,8 @@ export default defineComponent({
 		};
 
 		const setState = (data: any, index: number) => {
+			// console.log("🚀 ~ data:", data)
 			state.scrollContainer = "scrollContainer";
-			state.appName = "COLEXIU";
 			state.detailId = data.id;
 			state.xmlUrl = data.xmlFileUrl;
 			state.partIndex = index;
@@ -90,19 +90,20 @@ export default defineComponent({
 				}
 			}
 			state.isOpenMetronome = data.mp3Type === "MP3_METRONOME" ? true : false;
-			state.needTick = true; // data.isOpenMetronome;
+			state.needTick = data.isOpenMetronome;
 			state.isShowFingering = data.showFingering ? true : false;
 			state.music = data.audioFileUrl;
 			state.accompany = data.metronomeUrl || data.metronomeUrl;
 			state.midiUrl = data.midiUrl;
 			state.parentCategoriesId = data.musicTag;
 			state.playMode = data.audioType === "MP3" ? "mp3" : "midi";
-			state.originSpeed = state.speed = data.playSpeed;
+			state.originSpeed = state.speed = data.speed;
 			state.track = data.track;
 			state.enableNotation = data.notation ? true : false;
 
 			// 映射声部ID
-			state.subjectId = mappingVoicePart(state.track as any, "COLEXIU");
+			state.subjectId = mappingVoicePart(state.subjectId as any, "ORCHESTRA");
+			console.log("🚀 ~ state.subjectId:", state.subjectId)
 			// 是否打击乐
 			state.isPercussion = state.subjectId == 23 || state.subjectId == 113 || state.subjectId == 121 || isRhythmicExercises();
 
@@ -130,7 +131,8 @@ export default defineComponent({
 			state.osmd = osmd;
 			const saveSpeed = (store.get("speeds") || {})[state.examSongId];
 			const bpm = (osmd as any).bpm || osmd.Sheet.userStartTempoInBPM;
-			state.originSpeed = state.speed = saveSpeed || bpm || 100;
+			// state.originSpeed = 
+			// state.speed = saveSpeed || bpm || 100;
 			state.times = formateTimes(osmd);
 			console.log("🚀 ~ state.times:", state.times);
 			try {
@@ -153,7 +155,12 @@ export default defineComponent({
 							paddingBottom: state.fingeringInfo.height,
 						},
 						fingerBox: {
+							position: 'absolute',
+							width: '100%',
 							height: state.fingeringInfo.height,
+							left: 0,
+							bottom:0,
+							background: 'var(--container-background)'
 						},
 					};
 				} else {
@@ -166,7 +173,7 @@ export default defineComponent({
 							width: state.fingeringInfo.width,
 							height: "100%",
 							right: 0,
-							top: 0,
+							top: 0, //"calc(var(--header-height) / 2)",
 						},
 					};
 				}
@@ -209,6 +216,11 @@ export default defineComponent({
 			<div
 				class={[styles.detail, state.setting.eyeProtection && "eyeProtection"]}
 				style={{ paddingLeft: detailData.paddingLeft, opacity:  state.setting.camera ? `${state.setting.cameraOpacity / 100}` : ''}}
+				onClick={(e: Event) => {
+					if (state.playState === "play") {
+						detailData.headerHide = !detailData.headerHide;
+					}
+				}}
 			>
 				{!state.musicRendered && (
 					<div class={styles.skeleton}>
@@ -222,11 +234,6 @@ export default defineComponent({
 					id="scrollContainer"
 					style={{ ...fingerConfig.value.container }}
 					class={[styles.container, !state.setting.displayCursor && "hideCursor"]}
-					onClick={(e: Event) => {
-						if (state.playState === "play") {
-							detailData.headerHide = !detailData.headerHide;
-						}
-					}}
 				>
 					{/* 曲谱渲染 */}
 					{!detailData.isLoading && <MusicScore onRendered={handleRendered} />}
@@ -239,13 +246,13 @@ export default defineComponent({
 							{evaluatingData.rendered && <EvaluatModel />}
 						</>
 					)}
-					{/* 指法 */}
-					{state.setting.displayFingering && state.fingeringInfo?.name && (
-						<div style={{ ...fingerConfig.value.fingerBox }}>
-							<Fingering />
-						</div>
-					)}
 				</div>
+				{/* 指法 */}
+				{state.setting.displayFingering && state.fingeringInfo?.name && (
+					<div style={{ ...fingerConfig.value.fingerBox }}>
+						<Fingering />
+					</div>
+				)}
 
 				{/* 公用的插件 */}
 				<div class={styles.plugins}>

+ 4 - 4
src/page-orchestra/main.ts

@@ -13,10 +13,10 @@ import "./theme.css";
 (function () {
 	const u = navigator.userAgent;
 	setStoreData({
-		isApp: u.includes("COLEXIUTEACHER") || u.includes("COLEXIUSTUDENT"),
-		platformApi: u.includes("COLEXIUTEACHER") ? "/api-teacher" : "/api-student",
-		platformType: u.includes("COLEXIUTEACHER") ? "TEACHER" : "STUDENT",
-		proxy: import.meta.env.DEV ? "/colexiu" : ""
+		isApp: u.includes("ORCHESTRAAPPI") || u.includes("ORCHESTRAAPPA"),
+		platformApi: u.includes("ORCHESTRATEACHER") ? "/api-teacher" : u.includes("ORCHESTRASTUDENT") ? "/api-student" : "/api-backend",
+		platformType: u.includes("ORCHESTRATEACHER") ? "TEACHER" : "STUDENT",
+		proxy: import.meta.env.DEV ? "/orchestra" : ""
 	});
 })();
 

+ 1 - 0
src/page-orchestra/theme.css

@@ -1,6 +1,7 @@
 :root {
     --van-primary-color: #2dc7aa;
     --color-primary    : #2dc7aa;
+    --active-stave-box    : rgba(255, 159, 88, .19);
 }
 
 .vf-StaveSection {

+ 1 - 1
src/store.ts

@@ -12,7 +12,7 @@ type IUser = {
 };
 type IStatus = "init" | "login" | "logout" | "error";
 type IPlatformType = "STUDENT" | "TEACHER" | "WEB";
-type IPlatformApi = "/api-student" | "/api-teacher" | "/api-web";
+type IPlatformApi = "/api-student" | "/api-teacher" | "/api-web" | "/api-backend";
 type IProxy = "" | "/gym" | "/colexiu" | "/orchestra";
 
 export interface IStoreData {

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

@@ -48,6 +48,19 @@ export const mappingVoicePart = (id: number, soruce: "GYM" | "COLEXIU" | "ORCHES
 			Piano: 150
 		  }
 		return subject[id];
+	} else if (soruce === 'ORCHESTRA'){
+		const subject: { [_key: string | number]: number } = {
+			1: 23,
+			2: 2,
+			3: 5,
+			4: 4,
+			5: 12,
+			6: 14,
+			7: 13,
+			8: 15,
+			9: 17,
+		  }
+		return subject[id];
 	}
 	return 0;
 };

+ 1 - 1
vite.config.ts

@@ -60,7 +60,7 @@ export default defineConfig({
 				rewrite: (path) => path.replace(/^\/colexiu/, ""),
 			},
 			"^/orchestra/.*": {
-				target: "https://test.lexiaoya.cn",
+				target: "https://online.lexiaoya.cn",
 				changeOrigin: true,
 				rewrite: (path) => path.replace(/^\/orchestra/, ""),
 			},