|
@@ -18,10 +18,11 @@ 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]; // [大雅金唐, 竖笛教程, 声部训练]
|
|
|
+const classIds = [1, 30, 97]; // [大雅金唐, 竖笛教程, 声部训练]
|
|
|
+const classKey = "sysMusicScoreCategoriesList";
|
|
|
export default defineComponent({
|
|
|
name: "music-list",
|
|
|
setup() {
|
|
@@ -35,6 +36,7 @@ export default defineComponent({
|
|
|
const detailData = reactive({
|
|
|
isLoading: true,
|
|
|
paddingLeft: "",
|
|
|
+ classList: [],
|
|
|
});
|
|
|
const getAPPData = async () => {
|
|
|
const screenData = await isSpecialShapedScreen();
|
|
@@ -53,31 +55,33 @@ export default defineComponent({
|
|
|
/** 获取曲谱数据 */
|
|
|
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[index] ? res.data[index] : res.data[0];
|
|
|
// console.log("🚀 ~ musicInfo:", musicInfo);
|
|
|
setState(musicInfo, index);
|
|
|
setCustom();
|
|
|
detailData.isLoading = false;
|
|
|
+ state.partListNames = res.data.map((n: any) => n.track);
|
|
|
};
|
|
|
- const getCategorId = (arr: any[], key = "sysMusicScoreCategoriesList"): any[] => {
|
|
|
+ const getCategorId = (arr: any[]): 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]));
|
|
|
+ if (Array.isArray(arr[i][classKey])) {
|
|
|
+ list.push(...getCategorId(arr[i][classKey]));
|
|
|
}
|
|
|
}
|
|
|
return list;
|
|
|
};
|
|
|
- const getIds = (arr: any[], key = "sysMusicScoreCategoriesList"): any[] => {
|
|
|
+ const getIds = (arr: any[], _classids?: any[]): any[] => {
|
|
|
+ const classids = _classids ? _classids : classIds;
|
|
|
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]));
|
|
|
+ ids.push(arr[i].id, ...getCategorId(arr[i][classKey]));
|
|
|
} else {
|
|
|
- ids.push(...getIds(arr[i][key]));
|
|
|
+ ids.push(...getIds(arr[i][classKey], classids));
|
|
|
}
|
|
|
}
|
|
|
return ids;
|
|
@@ -85,6 +89,7 @@ export default defineComponent({
|
|
|
/** 获取分类数据 */
|
|
|
const getCategory = (res: any) => {
|
|
|
console.log("特殊曲谱分类ids:");
|
|
|
+ detailData.classList = res.data;
|
|
|
console.log(getIds(res.data).toString());
|
|
|
};
|
|
|
|
|
@@ -125,6 +130,11 @@ export default defineComponent({
|
|
|
|
|
|
// 设置指法
|
|
|
state.fingeringInfo = subjectFingering(state.subjectId);
|
|
|
+
|
|
|
+ //小曲目 不需要计算音乐的节拍器
|
|
|
+ if (getIds(detailData.classList, [41]).toString().includes(data.parentCategoriesId)) {
|
|
|
+ state.isOpenMetronome = false;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const setCustom = () => {
|
|
@@ -135,10 +145,10 @@ export default defineComponent({
|
|
|
|
|
|
onBeforeMount(() => {
|
|
|
api_setStatusBarVisibility();
|
|
|
- const settting = store.get('musicscoresetting')
|
|
|
- if (settting){
|
|
|
- state.setting = settting
|
|
|
- if (state.setting.camera){
|
|
|
+ const settting = store.get("musicscoresetting");
|
|
|
+ if (settting) {
|
|
|
+ state.setting = settting;
|
|
|
+ if (state.setting.camera) {
|
|
|
api_openCamera();
|
|
|
}
|
|
|
// console.log("🚀 ~ settting:", settting)
|
|
@@ -213,11 +223,11 @@ export default defineComponent({
|
|
|
}
|
|
|
);
|
|
|
onMounted(() => {
|
|
|
- window.addEventListener('resize', resetMusicScore)
|
|
|
- })
|
|
|
+ window.addEventListener("resize", resetMusicScore);
|
|
|
+ });
|
|
|
onBeforeUnmount(() => {
|
|
|
- window.removeEventListener('resize', resetMusicScore)
|
|
|
- })
|
|
|
+ window.removeEventListener("resize", resetMusicScore);
|
|
|
+ });
|
|
|
return () => (
|
|
|
<div class={[styles.detail, state.setting.camera && styles.opencamera]} style={{ paddingLeft: detailData.paddingLeft }}>
|
|
|
{!state.musicRendered && (
|