|
@@ -13,7 +13,7 @@ import { sysMusicScoreAccompanimentQueryPage, sysMusicScoreCategoriesQueryTree }
|
|
|
import EvaluatModel from "../evaluat-model";
|
|
|
import HeaderTop from "../header-top";
|
|
|
import styles from "./index.module.less";
|
|
|
-import { isSpecialShapedScreen } from "/src/helpers/communication";
|
|
|
+import { api_setStatusBarVisibility, isSpecialShapedScreen } from "/src/helpers/communication";
|
|
|
import { getQuery } from "/src/utils/queryString";
|
|
|
import Evaluating, { evaluatingData } from "/src/view/evaluating";
|
|
|
import MeasureSpeed from "/src/view/plugins/measure-speed";
|
|
@@ -107,11 +107,11 @@ export default defineComponent({
|
|
|
console.error("解析扩展字段错误:", error);
|
|
|
}
|
|
|
}
|
|
|
- state.isOpenMetronome = data.isOpenMetronome;
|
|
|
+ state.isOpenMetronome = !data.isOpenMetronome;
|
|
|
state.needTick = data.isOpenMetronome;
|
|
|
state.isShowFingering = data.isShowFingering;
|
|
|
- state.music = data.metronomeMp3Url;
|
|
|
- state.accompany = data.metronomeUrl;
|
|
|
+ state.music = data.isOpenMetronome ? data.mp3Url : data.metronomeMp3Url;
|
|
|
+ state.accompany = data.isOpenMetronome ? data.url : data.metronomeUrl;
|
|
|
state.midiUrl = data.midiUrl;
|
|
|
state.parentCategoriesId = data.parentCategoriesId;
|
|
|
state.playMode = data.playMode;
|
|
@@ -124,7 +124,8 @@ export default defineComponent({
|
|
|
// 是否打击乐
|
|
|
state.isPercussion = state.subjectId == 23 || state.subjectId == 113 || state.subjectId == 121 || isRhythmicExercises();
|
|
|
|
|
|
- state.fingeringInfo = subjectFingering[state.subjectId];
|
|
|
+ // 设置指法
|
|
|
+ state.fingeringInfo = subjectFingering(state.subjectId);
|
|
|
};
|
|
|
|
|
|
const setCustom = () => {
|
|
@@ -133,6 +134,10 @@ export default defineComponent({
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ onBeforeMount(() => {
|
|
|
+ api_setStatusBarVisibility();
|
|
|
+ });
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
(window as any).appName = "gym";
|
|
|
Promise.all([sysMusicScoreCategoriesQueryTree(storeData.platformType === "WEB"), sysMusicScoreAccompanimentQueryPage(paramsId)]).then((values) => {
|
|
@@ -153,34 +158,54 @@ export default defineComponent({
|
|
|
} catch (error) {}
|
|
|
};
|
|
|
/** 指法配置 */
|
|
|
- const fingerConfig = computed(() => {
|
|
|
+ const fingerConfig = computed<any>(() => {
|
|
|
if (state.setting.displayFingering && state.fingeringInfo?.name) {
|
|
|
if (state.fingeringInfo.direction === "transverse") {
|
|
|
return {
|
|
|
- "--fingerin-bottom": "1.6rem",
|
|
|
+ container: {
|
|
|
+ paddingBottom: state.fingeringInfo.height,
|
|
|
+ },
|
|
|
+ fingerBox: {
|
|
|
+ height: state.fingeringInfo.height,
|
|
|
+ },
|
|
|
};
|
|
|
} else {
|
|
|
return {
|
|
|
- "--fingerin-right": "3rem",
|
|
|
+ container: {
|
|
|
+ paddingRight: state.fingeringInfo.width,
|
|
|
+ },
|
|
|
+ fingerBox: {
|
|
|
+ position: "absolute",
|
|
|
+ width: state.fingeringInfo.width,
|
|
|
+ height: "100%",
|
|
|
+ right: 0,
|
|
|
+ top: 0,
|
|
|
+ },
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ container: {},
|
|
|
+ fingerBox: {},
|
|
|
+ };
|
|
|
});
|
|
|
|
|
|
- watch(() => state.setting.displayFingering, () => {
|
|
|
- if (state.fingeringInfo.direction === 'vertical'){
|
|
|
- if (state.setting.displayFingering){
|
|
|
- document.getElementById("musicAndSelection")?.style.removeProperty('--music-zoom')
|
|
|
- } else {
|
|
|
- nextTick(() => {
|
|
|
- resetMusicScore()
|
|
|
- })
|
|
|
+ watch(
|
|
|
+ () => state.setting.displayFingering,
|
|
|
+ () => {
|
|
|
+ if (state.fingeringInfo.direction === "vertical") {
|
|
|
+ if (state.setting.displayFingering) {
|
|
|
+ document.getElementById("musicAndSelection")?.style.removeProperty("--music-zoom");
|
|
|
+ } else {
|
|
|
+ nextTick(() => {
|
|
|
+ resetMusicScore();
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
+ );
|
|
|
return () => (
|
|
|
- <div class={[styles.detail, state.setting.camera && styles.opencamera]} style={{ paddingLeft: detailData.paddingLeft, ...fingerConfig.value }}>
|
|
|
+ <div class={[styles.detail, state.setting.camera && styles.opencamera]} style={{ paddingLeft: detailData.paddingLeft }}>
|
|
|
{!state.musicRendered && (
|
|
|
<div class={styles.skeleton}>
|
|
|
<Skeleton class={styles.skeleton} row={8} />
|
|
@@ -189,7 +214,10 @@ export default defineComponent({
|
|
|
<div class={styles.headHeight}>
|
|
|
<Transition name="van-slide-down">{state.musicRendered && <HeaderTop />}</Transition>
|
|
|
</div>
|
|
|
- <div class={[styles.container, state.setting.eyeProtection && "eyeProtection", !state.setting.displayCursor && "hideCursor"]}>
|
|
|
+ <div
|
|
|
+ style={{ ...fingerConfig.value.container }}
|
|
|
+ class={[styles.container, state.setting.eyeProtection && "eyeProtection", !state.setting.displayCursor && "hideCursor"]}
|
|
|
+ >
|
|
|
{/* 曲谱渲染 */}
|
|
|
{!detailData.isLoading && <MusicScore onRendered={handleRendered} />}
|
|
|
{/* 播放 */}
|
|
@@ -203,7 +231,7 @@ export default defineComponent({
|
|
|
)}
|
|
|
{/* 指法 */}
|
|
|
{state.setting.displayFingering && state.fingeringInfo?.name && (
|
|
|
- <div class={[state.fingeringInfo.direction === "transverse" ? styles.fingeringBottm : styles.fingeringRight]}>
|
|
|
+ <div style={{ ...fingerConfig.value.fingerBox }}>
|
|
|
<Fingering />
|
|
|
</div>
|
|
|
)}
|