liushengqiang 2 anni fa
parent
commit
1eaf517f9b

+ 8 - 2
src/page-orchestra/detail/index.tsx

@@ -69,6 +69,7 @@ export default defineComponent({
 			const index = query["part-index"] ? parseInt(query["part-index"] as string) : 0;
 			const musicInfo = {
 				...res.data,
+
 				...res.data.background[index],
 			};
 			// console.log("🚀 ~ musicInfo:", musicInfo);
@@ -85,7 +86,7 @@ export default defineComponent({
 			state.categoriesId = data.categoriesId;
 			state.categoriesName = data.musicTagNames;
 			state.enableEvaluation = data.canEvaluate ? true : false;
-			state.examSongId = data.id + "";
+			state.examSongId = data.musicId + "";
 			state.examSongName = data.musicSheetName;
 			// 解析扩展字段
 			if (data.extConfigJson) {
@@ -99,7 +100,7 @@ export default defineComponent({
 			state.needTick = data.isOpenMetronome;
 			state.isShowFingering = data.showFingering ? true : false;
 			state.music = data.audioFileUrl;
-			state.accompany = data.metronomeUrl || data.metronomeUrl;
+			state.accompany = data.metronomeUrl;
 			state.midiUrl = data.midiUrl;
 			state.parentCategoriesId = data.musicTag;
 			state.playMode = data.audioType === "MP3" ? "MP3" : "MIDI";
@@ -117,6 +118,11 @@ export default defineComponent({
 			state.fingeringInfo = subjectFingering(state.subjectId);
 			// console.log("🚀 ~ state.fingeringInfo:", state.fingeringInfo, state.subjectId, state.track)
 			// state.isOpenPrepare = true
+
+			// 检测是否原音和伴奏都有
+			if (!state.music || !state.accompany) {
+				state.playSource = state.music ? "music" : "background"
+			}
 		};
 
 		const setCustom = () => {

+ 2 - 0
src/page-orchestra/header-top/index.tsx

@@ -126,6 +126,8 @@ export default defineComponent({
 			if (state.modeType === "follow") return { display: false, disabled: true };
 			// 评测开始 禁用
 			if (state.modeType === "evaluating") return { display: true, disabled: true };
+			// 原声, 伴奏 少一个,就不能切换
+			if (!state.music || !state.accompany) return { display: true, disabled: true}
 
 			return {
 				disabled: false,

+ 2 - 1
src/report-share/orchestra-share/index.tsx

@@ -45,12 +45,13 @@ export default defineComponent({
 		const getAPPData = async () => {
 			const screenData = await isSpecialShapedScreen();
 			if (screenData?.content) {
-				// console.log("🚀 ~ screenData:", screenData.content);
 				const { isSpecialShapedScreen, notchHeight } = screenData.content;
 				if (isSpecialShapedScreen) {
 					detailData.paddingLeft = 25 + "px";
 				}
 			}
+			// 普通webview 没有获取异性屏的方法
+			detailData.paddingLeft = 20 + "px";
 		};
 		onBeforeMount(() => {
 			getAPPData();

+ 8 - 2
src/view/evaluating/index.tsx

@@ -21,7 +21,7 @@ import {
 	api_startCapture,
 	api_endCapture,
 } from "/src/helpers/communication";
-import state, { clearSelection, handleStopPlay, resetPlaybackToStart, togglePlay } from "/src/state";
+import state, { IPlayState, clearSelection, handleStopPlay, resetPlaybackToStart, togglePlay } from "/src/state";
 import { IPostMessage } from "/src/utils/native-message";
 import { usePageVisibility } from "@vant/use";
 import { browser } from "/src/utils";
@@ -349,6 +349,8 @@ export default defineComponent({
 		const record_old_data = reactive({
 			/** 指法 */
 			finger: false,
+			/** 原音伴奏 */
+			play_mode: ''  as IPlayState
 		});
 		/** 记录状态 */
 		const hanlde_record = () => {
@@ -356,12 +358,16 @@ export default defineComponent({
 			record_old_data.finger = state.setting.displayFingering;
 			state.setting.displayFingering = false;
 			// 切换为伴奏
-			// if (state.)
+			record_old_data.play_mode = state.playSource
+			if (state.accompany) {
+				state.playSource = 'background'
+			}
 		};
 		/** 还原状态 */
 		const handle_reduction = () => {
 			// 还原指法
 			state.setting.displayFingering = record_old_data.finger;
+			state.playSource = record_old_data.play_mode
 		};
 
 		watch(pageVisibility, (value) => {