|
@@ -27,6 +27,7 @@ import VipModel from "../custom-plugins/vip-verify";
|
|
|
import GuidePage from "../custom-plugins/guide-page";
|
|
|
import { handleSetCustomRender, setCustomGradual, setCustomNoteRealValue } from "../custom-plugins/custom-gradual";
|
|
|
import { getStorageSpeed, setGlobalData } from "/src/utils";
|
|
|
+import { getInstrumentsClassfiy } from "/src/constant/instrumentsClassfiy";
|
|
|
|
|
|
//特殊教材分类id
|
|
|
const classIds = [1, 30, 97]; // [大雅金唐, 竖笛教程, 声部训练]
|
|
@@ -65,10 +66,10 @@ export default defineComponent({
|
|
|
const index = query["part-index"] ? parseInt(query["part-index"] as string) : 0;
|
|
|
const musicInfo = res.data[index] ? res.data[index] : res.data[0];
|
|
|
// console.log("🚀 ~ musicInfo:", musicInfo);
|
|
|
+ state.partListNames = res.data.map((n: any) => n.track);
|
|
|
setState(musicInfo, index);
|
|
|
setCustom();
|
|
|
detailData.isLoading = false;
|
|
|
- state.partListNames = res.data.map((n: any) => n.track);
|
|
|
};
|
|
|
const getCategorId = (arr: any[]): any[] => {
|
|
|
const list = [];
|
|
@@ -94,6 +95,13 @@ export default defineComponent({
|
|
|
}
|
|
|
return ids;
|
|
|
};
|
|
|
+
|
|
|
+ // 获取轨道声部ID
|
|
|
+ const getVoiceSubjectId = () => {
|
|
|
+ const { partListNames, partIndex } = state;
|
|
|
+ const subjectId = getInstrumentsClassfiy(partListNames[partIndex]);
|
|
|
+ return isNaN(Number(subjectId)) ? 0 : Number(subjectId)
|
|
|
+ };
|
|
|
/** 获取分类数据 */
|
|
|
const getCategory = (res: any) => {
|
|
|
detailData.classList = res.data;
|
|
@@ -116,8 +124,8 @@ export default defineComponent({
|
|
|
} catch (error) {
|
|
|
console.error("解析扩展字段错误:", error);
|
|
|
}
|
|
|
- state.gradualTimes = state.extConfigJson.gradualTimes
|
|
|
- state.repeatedBeats = state.extConfigJson.repeatedBeats || 0
|
|
|
+ state.gradualTimes = state.extConfigJson.gradualTimes;
|
|
|
+ state.repeatedBeats = state.extConfigJson.repeatedBeats || 0;
|
|
|
}
|
|
|
state.isOpenMetronome = !data.isOpenMetronome;
|
|
|
state.needTick = data.isOpenMetronome;
|
|
@@ -136,16 +144,23 @@ export default defineComponent({
|
|
|
// 是否打击乐
|
|
|
state.isPercussion = state.subjectId == 23 || state.subjectId == 113 || state.subjectId == 121 || isRhythmicExercises();
|
|
|
|
|
|
- // 设置指法
|
|
|
- state.fingeringInfo = subjectFingering(state.subjectId);
|
|
|
-
|
|
|
//小曲目 不需要计算音乐的节拍器
|
|
|
if (getIds(detailData.classList, [41]).includes(data.parentCategoriesId)) {
|
|
|
state.isOpenMetronome = false;
|
|
|
}
|
|
|
// 设置是否特殊曲谱
|
|
|
- state.isSpecialBookCategory = !getIds(detailData.classList).includes(state.parentCategoriesId)
|
|
|
+ state.isSpecialBookCategory = !getIds(detailData.classList).includes(state.parentCategoriesId);
|
|
|
// console.log('state.isSpecialBookCategory', state.isSpecialBookCategory, state.parentCategoriesId);
|
|
|
+ // 仅在合奏与流行曲目中读取xml声部,否则使用后台设置的声部
|
|
|
+ // this.setMusicUrl()
|
|
|
+ if (state.isSpecialBookCategory) {
|
|
|
+ // console.log(state.partListNames)
|
|
|
+ state.subjectId = getVoiceSubjectId();
|
|
|
+ // console.log("🚀 ~ state.subjectId:", state.subjectId)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 设置指法
|
|
|
+ state.fingeringInfo = subjectFingering(state.subjectId);
|
|
|
};
|
|
|
|
|
|
const setCustom = () => {
|
|
@@ -188,11 +203,11 @@ export default defineComponent({
|
|
|
} catch (error) {}
|
|
|
|
|
|
// 设置设置过的速度
|
|
|
- const storeSpeed = getStorageSpeed(state.examSongId)
|
|
|
- if (storeSpeed){
|
|
|
- handleSetSpeed(storeSpeed)
|
|
|
+ const storeSpeed = getStorageSpeed(state.examSongId);
|
|
|
+ if (storeSpeed) {
|
|
|
+ handleSetSpeed(storeSpeed);
|
|
|
}
|
|
|
- handleSetCustomRender()
|
|
|
+ handleSetCustomRender();
|
|
|
};
|
|
|
/** 指法配置 */
|
|
|
const fingerConfig = computed<any>(() => {
|