Browse Source

fix:默认曲谱

liushengqiang 1 year ago
parent
commit
1fc085acd5
2 changed files with 15 additions and 5 deletions
  1. 13 3
      src/page-instrument/view-detail/index.tsx
  2. 2 2
      vite.config.ts

+ 13 - 3
src/page-instrument/view-detail/index.tsx

@@ -13,7 +13,13 @@ import {
 } from "vue";
 import { formateTimes } from "../../helpers/formateMusic";
 import Metronome, { metronomeData } from "../../helpers/metronome";
-import state, { EnumMusicRenderType, handleSetSpeed, IAudioState, IPlatform, isRhythmicExercises } from "/src/state";
+import state, {
+	EnumMusicRenderType,
+	handleSetSpeed,
+	IAudioState,
+	IPlatform,
+	isRhythmicExercises,
+} from "/src/state";
 import { setGlobalData } from "../../utils";
 import AudioList from "../../view/audio-list";
 import MusicScore, { resetMusicScore } from "../../view/music-score";
@@ -145,7 +151,7 @@ export default defineComponent({
 			}
 
 			//课堂乐器,默认简谱
-			state.musicRenderType = EnumMusicRenderType.firstTone
+			state.musicRenderType = EnumMusicRenderType.firstTone;
 		};
 
 		const setCustom = () => {
@@ -156,7 +162,7 @@ export default defineComponent({
 
 		onMounted(() => {
 			(window as any).appName = "colexiu";
-			const id = query.id || "43541";
+			const id = query.id || "43554";
 			Promise.all([sysMusicScoreAccompanimentQueryPage(id)]).then((values) => {
 				getMusicInfo(values[0]);
 			});
@@ -167,6 +173,10 @@ export default defineComponent({
 		const handleRendered = (osmd: any) => {
 			detailData.skeletonLoading = false;
 			state.osmd = osmd;
+			// 没有设置速度使用读取的速度
+			if (state.originSpeed === 0) {
+				state.originSpeed = state.speed = (osmd as any).bpm || osmd.Sheet.userStartTempoInBPM || 100;
+			}
 			const saveSpeed =
 				(store.get("speeds") || {})[state.examSongId] ||
 				(osmd as any).bpm ||

+ 2 - 2
vite.config.ts

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