|
@@ -238,7 +238,9 @@ export default defineComponent({
|
|
data.noteType = "all";
|
|
data.noteType = "all";
|
|
}
|
|
}
|
|
resetMode(true, 0);
|
|
resetMode(true, 0);
|
|
- __init(false);
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ __init(false);
|
|
|
|
+ }, 100);
|
|
};
|
|
};
|
|
|
|
|
|
const __init = async (loadSong = true) => {
|
|
const __init = async (loadSong = true) => {
|
|
@@ -300,11 +302,15 @@ export default defineComponent({
|
|
};
|
|
};
|
|
|
|
|
|
onBeforeMount(async () => {
|
|
onBeforeMount(async () => {
|
|
|
|
+ if (browser().isApp) {
|
|
|
|
+ state.platform = "APP" as IPlatform;
|
|
|
|
+ } else {
|
|
|
|
+ state.platform = query.platform?.toLocaleUpperCase() || "";
|
|
|
|
+ }
|
|
|
|
+
|
|
if (state.platform === IPlatform.PC) {
|
|
if (state.platform === IPlatform.PC) {
|
|
document.title = "听音练习";
|
|
document.title = "听音练习";
|
|
}
|
|
}
|
|
-
|
|
|
|
- state.platform = query.platform?.toLocaleUpperCase() || "";
|
|
|
|
await getSubjects();
|
|
await getSubjects();
|
|
__init();
|
|
__init();
|
|
});
|
|
});
|
|
@@ -329,7 +335,9 @@ export default defineComponent({
|
|
data.realKey = item.realKey;
|
|
data.realKey = item.realKey;
|
|
}
|
|
}
|
|
data.noteAudio = data.soundFonts[item.realKey];
|
|
data.noteAudio = data.soundFonts[item.realKey];
|
|
- data.noteAudio.play();
|
|
|
|
|
|
+ if (data.noteAudio) {
|
|
|
|
+ data.noteAudio.play();
|
|
|
|
+ }
|
|
};
|
|
};
|
|
const handleStop = () => {
|
|
const handleStop = () => {
|
|
if (data.noteAudio) {
|
|
if (data.noteAudio) {
|
|
@@ -348,14 +356,21 @@ export default defineComponent({
|
|
emit("close");
|
|
emit("close");
|
|
return;
|
|
return;
|
|
} else if (state.platform === IPlatform.PC) {
|
|
} else if (state.platform === IPlatform.PC) {
|
|
- // 老师端,首页
|
|
|
|
- window.parent.postMessage(
|
|
|
|
- {
|
|
|
|
- api: "iframe_exit",
|
|
|
|
- },
|
|
|
|
- "*"
|
|
|
|
- );
|
|
|
|
- return;
|
|
|
|
|
|
+ console.log(1, query);
|
|
|
|
+ if (query.matchMedia == 1) {
|
|
|
|
+ // 老师端,首页
|
|
|
|
+ window.parent.postMessage(
|
|
|
|
+ {
|
|
|
|
+ api: "iframe_exit",
|
|
|
|
+ },
|
|
|
|
+ "*"
|
|
|
|
+ );
|
|
|
|
+ return;
|
|
|
|
+ } else {
|
|
|
|
+ window.close();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
// if (fingerData.fingeringInfo.orientation === 0) {
|
|
// if (fingerData.fingeringInfo.orientation === 0) {
|
|
// api_setRequestedOrientation(1);
|
|
// api_setRequestedOrientation(1);
|
|
// }
|
|
// }
|
|
@@ -425,6 +440,7 @@ export default defineComponent({
|
|
if (val === "hidden") {
|
|
if (val === "hidden") {
|
|
console.log("页面隐藏停止播放");
|
|
console.log("页面隐藏停止播放");
|
|
handleStop();
|
|
handleStop();
|
|
|
|
+ gaumntPause();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
);
|
|
);
|
|
@@ -432,6 +448,7 @@ export default defineComponent({
|
|
const changePlay = (res: any) => {
|
|
const changePlay = (res: any) => {
|
|
if (res?.data?.api === "setPlayState") {
|
|
if (res?.data?.api === "setPlayState") {
|
|
handleStop();
|
|
handleStop();
|
|
|
|
+ gaumntPause();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -693,7 +710,7 @@ export default defineComponent({
|
|
paddingTop: "3.1rem",
|
|
paddingTop: "3.1rem",
|
|
paddingBottom: ".8rem",
|
|
paddingBottom: ".8rem",
|
|
};
|
|
};
|
|
- } else if (data.subject === "piccolo") {
|
|
|
|
|
|
+ } else if (data.subject === "piccolo" || data.subject === "baroque-recorder") {
|
|
return {
|
|
return {
|
|
paddingTop: "4rem",
|
|
paddingTop: "4rem",
|
|
paddingBottom: ".8rem",
|
|
paddingBottom: ".8rem",
|
|
@@ -725,7 +742,7 @@ export default defineComponent({
|
|
paddingTop: "3.1rem",
|
|
paddingTop: "3.1rem",
|
|
paddingBottom: "0rem",
|
|
paddingBottom: "0rem",
|
|
};
|
|
};
|
|
- } else if (data.subject === "piccolo") {
|
|
|
|
|
|
+ } else if (data.subject === "piccolo" || data.subject === "baroque-recorder") {
|
|
return {
|
|
return {
|
|
paddingTop: "3rem",
|
|
paddingTop: "3rem",
|
|
paddingBottom: ".5rem",
|
|
paddingBottom: ".5rem",
|
|
@@ -788,7 +805,7 @@ export default defineComponent({
|
|
|
|
|
|
// 屏幕方向 0 竖,1 横
|
|
// 屏幕方向 0 竖,1 横
|
|
const orientationDirection = computed(() => {
|
|
const orientationDirection = computed(() => {
|
|
- return ["hulusi-flute", "piccolo"].includes(data.subject) ? 1 : 0;
|
|
|
|
|
|
+ return ["hulusi-flute", "piccolo", "baroque-recorder"].includes(data.subject) ? 1 : 0;
|
|
});
|
|
});
|
|
|
|
|
|
const resultImg = (note: any) => {
|
|
const resultImg = (note: any) => {
|
|
@@ -864,18 +881,25 @@ export default defineComponent({
|
|
placement="bottom"
|
|
placement="bottom"
|
|
class={styles.popoverContainer}
|
|
class={styles.popoverContainer}
|
|
actions={data.subjects}
|
|
actions={data.subjects}
|
|
|
|
+ onUpdate:show={() => {
|
|
|
|
+ // 播放音阶时不能切换
|
|
|
|
+ if (playStatus.gamut) return;
|
|
|
|
+ // 开始答题不能切换
|
|
|
|
+ if (playStatus.action) return;
|
|
|
|
+ }}
|
|
onSelect={(val: any) => {
|
|
onSelect={(val: any) => {
|
|
if (data.subject === val.value) return;
|
|
if (data.subject === val.value) return;
|
|
data.subject = val.value;
|
|
data.subject = val.value;
|
|
data.viewIndex = 0;
|
|
data.viewIndex = 0;
|
|
data.loadingDom = true;
|
|
data.loadingDom = true;
|
|
fingerData.fingeringInfo = subjectFingering(data.subject);
|
|
fingerData.fingeringInfo = subjectFingering(data.subject);
|
|
- console.log(fingerData.fingeringInfo);
|
|
|
|
resetElement();
|
|
resetElement();
|
|
resetMode(true, 0);
|
|
resetMode(true, 0);
|
|
api_setRequestedOrientation(orientationDirection.value);
|
|
api_setRequestedOrientation(orientationDirection.value);
|
|
// 设置屏幕方向
|
|
// 设置屏幕方向
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
|
+ data.paddingTop = "";
|
|
|
|
+ data.paddingLeft = "";
|
|
__init();
|
|
__init();
|
|
}, 100);
|
|
}, 100);
|
|
}}
|
|
}}
|
|
@@ -884,8 +908,19 @@ export default defineComponent({
|
|
reference: () => (
|
|
reference: () => (
|
|
<div
|
|
<div
|
|
class={styles.baseBtn}
|
|
class={styles.baseBtn}
|
|
- onClick={() => {
|
|
|
|
|
|
+ onClick={(e) => {
|
|
//
|
|
//
|
|
|
|
+ // 播放音阶时不能切换
|
|
|
|
+ if (playStatus.gamut) {
|
|
|
|
+ e.stopPropagation();
|
|
|
|
+ e.preventDefault();
|
|
|
|
+ }
|
|
|
|
+ // 开始答题不能切换
|
|
|
|
+ // if (playStatus.action) return;
|
|
|
|
+ if (playAction.listenLock) {
|
|
|
|
+ e.stopPropagation();
|
|
|
|
+ e.preventDefault();
|
|
|
|
+ }
|
|
}}
|
|
}}
|
|
>
|
|
>
|
|
<img src={icons.icon_change_instrument} />
|
|
<img src={icons.icon_change_instrument} />
|
|
@@ -972,7 +1007,7 @@ export default defineComponent({
|
|
{playAction.userAnswerStatus === 1 && <div class={[styles.tipsT, styles.playSuccess]}></div>}
|
|
{playAction.userAnswerStatus === 1 && <div class={[styles.tipsT, styles.playSuccess]}></div>}
|
|
{playAction.userAnswerStatus === 2 && <div class={[styles.tipsT, styles.playError]}></div>}
|
|
{playAction.userAnswerStatus === 2 && <div class={[styles.tipsT, styles.playError]}></div>}
|
|
|
|
|
|
- {(data.noteType !== "#c" && orientationDirection.value === 0 || orientationDirection.value === 1) && (
|
|
|
|
|
|
+ {((data.noteType !== "#c" && (orientationDirection.value === 0 || (orientationDirection.value === 1 && state.platform === IPlatform.PC))) || (orientationDirection.value === 1 && state.platform === IPlatform.APP)) && (
|
|
<Button class={styles.noteBtn} onClick={() => scrollNoteBox("left")}>
|
|
<Button class={styles.noteBtn} onClick={() => scrollNoteBox("left")}>
|
|
<Icon name="arrow-left" />
|
|
<Icon name="arrow-left" />
|
|
</Button>
|
|
</Button>
|
|
@@ -1056,7 +1091,7 @@ export default defineComponent({
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- {(data.noteType !== "#c" && orientationDirection.value === 0 || orientationDirection.value === 1) && (
|
|
|
|
|
|
+ {((data.noteType !== "#c" && (orientationDirection.value === 0 || (orientationDirection.value === 1 && state.platform === IPlatform.PC))) || (orientationDirection.value === 1 && state.platform === IPlatform.APP)) && (
|
|
<Button class={styles.noteBtn} onClick={() => scrollNoteBox("right")}>
|
|
<Button class={styles.noteBtn} onClick={() => scrollNoteBox("right")}>
|
|
<Icon name="arrow" />
|
|
<Icon name="arrow" />
|
|
</Button>
|
|
</Button>
|