|
@@ -18,10 +18,8 @@ import Evaluating, { evaluatingData } from "/src/view/evaluating";
|
|
|
import MeasureSpeed from "/src/view/plugins/measure-speed";
|
|
|
import { mappingVoicePart, subjectFingering } from "/src/view/fingering/fingering-config";
|
|
|
import Fingering from "/src/view/fingering";
|
|
|
-import store from 'store'
|
|
|
+import store from "store";
|
|
|
|
|
|
-//特殊教材分类id
|
|
|
-const classids = [1, 30, 97]; // [大雅金唐, 竖笛教程, 声部训练]
|
|
|
export default defineComponent({
|
|
|
name: "music-list",
|
|
|
setup() {
|
|
@@ -31,7 +29,6 @@ export default defineComponent({
|
|
|
...route.query,
|
|
|
};
|
|
|
|
|
|
- const paramsId = route.params.id as string;
|
|
|
const detailData = reactive({
|
|
|
isLoading: true,
|
|
|
paddingLeft: "",
|
|
@@ -48,56 +45,40 @@ export default defineComponent({
|
|
|
};
|
|
|
onBeforeMount(() => {
|
|
|
getAPPData();
|
|
|
+ api_setStatusBarVisibility();
|
|
|
+ const settting = store.get("musicscoresetting");
|
|
|
+ if (settting) {
|
|
|
+ state.setting = settting;
|
|
|
+ if (state.setting.camera) {
|
|
|
+ api_openCamera();
|
|
|
+ }
|
|
|
+ // console.log("🚀 ~ settting:", settting)
|
|
|
+ }
|
|
|
});
|
|
|
// console.log(route.params, query)
|
|
|
/** 获取曲谱数据 */
|
|
|
const getMusicInfo = (res: any) => {
|
|
|
const index = query["part-index"] ? parseInt(query["part-index"] as string) : 0;
|
|
|
- const musicInfo = res.data[index];
|
|
|
+ const musicInfo = {
|
|
|
+ ...res.data,
|
|
|
+ ...res.data.background[index],
|
|
|
+ };
|
|
|
// console.log("🚀 ~ musicInfo:", musicInfo);
|
|
|
setState(musicInfo, index);
|
|
|
setCustom();
|
|
|
detailData.isLoading = false;
|
|
|
};
|
|
|
- const getCategorId = (arr: any[], key = "sysMusicScoreCategoriesList"): any[] => {
|
|
|
- const list = [];
|
|
|
- if (!Array.isArray(arr)) return [];
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
- list.push(arr[i].id);
|
|
|
- if (Array.isArray(arr[i][key])) {
|
|
|
- list.push(...getCategorId(arr[i][key]));
|
|
|
- }
|
|
|
- }
|
|
|
- return list;
|
|
|
- };
|
|
|
- const getIds = (arr: any[], key = "sysMusicScoreCategoriesList"): any[] => {
|
|
|
- if (!Array.isArray(arr)) return [];
|
|
|
- const ids = [];
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
- if (classids.includes(arr[i].id)) {
|
|
|
- ids.push(arr[i].id, ...getCategorId(arr[i][key]));
|
|
|
- } else {
|
|
|
- ids.push(...getIds(arr[i][key]));
|
|
|
- }
|
|
|
- }
|
|
|
- return ids;
|
|
|
- };
|
|
|
- /** 获取分类数据 */
|
|
|
- const getCategory = (res: any) => {
|
|
|
- console.log("特殊曲谱分类ids:");
|
|
|
- console.log(getIds(res.data).toString());
|
|
|
- };
|
|
|
|
|
|
const setState = (data: any, index: number) => {
|
|
|
state.detailId = data.id;
|
|
|
- state.xmlUrl = data.xmlUrl;
|
|
|
+ state.xmlUrl = data.xmlFileUrl;
|
|
|
state.partIndex = index;
|
|
|
- state.subjectId = data.subjectId;
|
|
|
+ state.subjectId = data.musicSubject;
|
|
|
state.categoriesId = data.categoriesId;
|
|
|
- state.categoriesName = data.categoriesName;
|
|
|
- state.enableEvaluation = data.enableEvaluation;
|
|
|
- state.examSongId = data.examSongId + "";
|
|
|
- state.examSongName = data.examSongName;
|
|
|
+ state.categoriesName = data.musicTagNames;
|
|
|
+ state.enableEvaluation = data.canEvaluate ? true : false;
|
|
|
+ state.examSongId = data.id + "";
|
|
|
+ state.examSongName = data.musicSheetName;
|
|
|
// 解析扩展字段
|
|
|
if (data.extConfigJson) {
|
|
|
try {
|
|
@@ -106,25 +87,25 @@ export default defineComponent({
|
|
|
console.error("解析扩展字段错误:", error);
|
|
|
}
|
|
|
}
|
|
|
- state.isOpenMetronome = !data.isOpenMetronome;
|
|
|
+ state.isOpenMetronome = data.mp3Type === "MP3_METRONOME" ? true : false;
|
|
|
state.needTick = data.isOpenMetronome;
|
|
|
- state.isShowFingering = data.isShowFingering;
|
|
|
- state.music = data.isOpenMetronome ? data.mp3Url : data.metronomeMp3Url;
|
|
|
- state.accompany = data.isOpenMetronome ? data.url : data.metronomeUrl;
|
|
|
+ state.isShowFingering = data.showFingering ? true : false;
|
|
|
+ state.music = data.audioFileUrl;
|
|
|
+ state.accompany = data.metronomeUrl || data.metronomeUrl;
|
|
|
state.midiUrl = data.midiUrl;
|
|
|
- state.parentCategoriesId = data.parentCategoriesId;
|
|
|
- state.playMode = data.playMode;
|
|
|
- state.originSpeed = state.speed = data.speed;
|
|
|
+ state.parentCategoriesId = data.musicTag;
|
|
|
+ state.playMode = data.audioType === "MP3" ? "mp3" : "midi";
|
|
|
+ state.originSpeed = state.speed = data.playSpeed;
|
|
|
state.track = data.track;
|
|
|
- state.isOpenPrepare = true;
|
|
|
|
|
|
// 映射声部ID
|
|
|
- state.subjectId = mappingVoicePart(state.subjectId, "GYM");
|
|
|
+ state.subjectId = mappingVoicePart(state.track as any, "COLEXIU");
|
|
|
// 是否打击乐
|
|
|
state.isPercussion = state.subjectId == 23 || state.subjectId == 113 || state.subjectId == 121 || isRhythmicExercises();
|
|
|
|
|
|
// 设置指法
|
|
|
state.fingeringInfo = subjectFingering(state.subjectId);
|
|
|
+ console.log("🚀 ~ state.fingeringInfo:", state.fingeringInfo, state.subjectId)
|
|
|
};
|
|
|
|
|
|
const setCustom = () => {
|
|
@@ -133,23 +114,10 @@ export default defineComponent({
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- onBeforeMount(() => {
|
|
|
- api_setStatusBarVisibility();
|
|
|
- const settting = store.get('musicscoresetting')
|
|
|
- if (settting){
|
|
|
- state.setting = settting
|
|
|
- if (state.setting.camera){
|
|
|
- api_openCamera();
|
|
|
- }
|
|
|
- // console.log("🚀 ~ settting:", settting)
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
onMounted(() => {
|
|
|
- (window as any).appName = "gym";
|
|
|
- Promise.all([sysMusicScoreCategoriesQueryTree(storeData.platformType === "WEB"), sysMusicScoreAccompanimentQueryPage(paramsId)]).then((values) => {
|
|
|
- getCategory(values[0]);
|
|
|
- getMusicInfo(values[1]);
|
|
|
+ (window as any).appName = "colexiu";
|
|
|
+ Promise.all([sysMusicScoreAccompanimentQueryPage(query.id)]).then((values) => {
|
|
|
+ getMusicInfo(values[0]);
|
|
|
});
|
|
|
});
|
|
|
|