|
@@ -23,6 +23,7 @@ import useDrag from "/src/hooks/useDrag";
|
|
|
import Dragbom from "/src/hooks/useDrag/dragbom";
|
|
|
import useDragGuidance from "/src/hooks/useDrag/useDragGuidance";
|
|
|
import { FINER_INSTRUMENT_POINT } from "./fingeringPoint";
|
|
|
+import { useClickAway } from "@vant/use";
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: "viewFigner",
|
|
@@ -232,6 +233,7 @@ export default defineComponent({
|
|
|
// 切换当前模式
|
|
|
const onChangeFingeringModel = (e: any) => {
|
|
|
e.stopPropagation();
|
|
|
+ isMoreFunShow.value = false;
|
|
|
//
|
|
|
if (playAction.listenLock) return;
|
|
|
if (playAction.showAnswerLoading) return;
|
|
@@ -283,7 +285,12 @@ export default defineComponent({
|
|
|
data.viewIndex = 1;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ // 音阶模式 默认设置正反面
|
|
|
+ if(data.fingeringMode === "scaleMode"){
|
|
|
+ if(["hulusi-flute", "ocarina", "whistling", "piccolo", "baroque-recorder"].includes(data.subject)){
|
|
|
+ data.viewIndex = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
const o: any = {
|
|
|
"pan-flute": 2,
|
|
|
ocarina: 2,
|
|
@@ -780,6 +787,7 @@ export default defineComponent({
|
|
|
|
|
|
/** 音符切换 */
|
|
|
const noteChangeShow = () => {
|
|
|
+ isMoreFunShow.value = false;
|
|
|
if (playStatus.action) {
|
|
|
if (playAction.listenLock) return;
|
|
|
playAction.resetAction = true;
|
|
@@ -811,7 +819,9 @@ export default defineComponent({
|
|
|
};
|
|
|
|
|
|
// 开始播放音阶
|
|
|
- const onGamutPlayOrPause = async () => {
|
|
|
+ const onGamutPlayOrPause = async (e:Event) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ isMoreFunShow.value = false;
|
|
|
playAction.resetAction = false;
|
|
|
if (playStatus.gamut) {
|
|
|
playStatus.gamut = false;
|
|
@@ -876,7 +886,9 @@ export default defineComponent({
|
|
|
userAnswer: {} as any, // 用户答的数据
|
|
|
timer: null as any,
|
|
|
});
|
|
|
- const onActionPlay = async () => {
|
|
|
+ const onActionPlay = async (e:Event) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ isMoreFunShow.value = false;
|
|
|
playAction.resetAction = false;
|
|
|
if (playAction.listenLock) return;
|
|
|
if (playAction.showAnswerLoading) return;
|
|
@@ -949,7 +961,9 @@ export default defineComponent({
|
|
|
};
|
|
|
|
|
|
// 显示答案
|
|
|
- const onShowAnswer = async () => {
|
|
|
+ const onShowAnswer = async (e:Event) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ isMoreFunShow.value = false;
|
|
|
if (playAction.listenLock) return;
|
|
|
playAction.showAnswerLoading = true;
|
|
|
scrollAnswer(playAction.standardAnswer.realKey);
|
|
@@ -1253,6 +1267,11 @@ export default defineComponent({
|
|
|
tnoteShowBoxClass = "tnoteShowBoxClass_drag";
|
|
|
tnoteShowBoxDragData = useDrag([`${tnoteShowBoxClass} .dragTopBox`, `${tnoteShowBoxClass} .dragbomBox`], tnoteShowBoxClass, toRef(data, "tnoteShow"), storeData.user.id as string);
|
|
|
}
|
|
|
+ const moreFunDom = ref()
|
|
|
+ const isMoreFunShow = ref(false)
|
|
|
+ useClickAway(moreFunDom, () => {
|
|
|
+ isMoreFunShow.value = false;
|
|
|
+ });
|
|
|
return () => {
|
|
|
const relationship = fingerData.subject?.relationship?.[data.realKey] || [];
|
|
|
const rs: number[] = Array.isArray(relationship[1]) ? relationship[fingerData.relationshipIndex] : relationship;
|
|
@@ -1497,6 +1516,7 @@ export default defineComponent({
|
|
|
class={styles.noteBtn}
|
|
|
onClick={(e: any) => {
|
|
|
e.stopPropagation();
|
|
|
+ isMoreFunShow.value = false;
|
|
|
scrollNoteBox("left");
|
|
|
}}
|
|
|
>
|
|
@@ -1512,7 +1532,10 @@ export default defineComponent({
|
|
|
{!!data.tones.length && data.fingeringMode === "scaleMode" && (
|
|
|
<>
|
|
|
{fingerData.fingeringInfo.name == "hulusi-flute" ? (
|
|
|
- <div id="finger-note-1" class={[styles.note, styles.btnGrToggleBtn]} onClick={() => (data.tnoteShow = true)}>
|
|
|
+ <div id="finger-note-1" class={[styles.note, styles.btnGrToggleBtn]} onClick={() => {
|
|
|
+ isMoreFunShow.value = false;
|
|
|
+ data.tnoteShow = true
|
|
|
+ }}>
|
|
|
<img draggable={false} src={noteImg} />
|
|
|
<div class={styles.nameBox}>
|
|
|
<div class={styles.name}>全按作</div>
|
|
@@ -1527,7 +1550,10 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</div>
|
|
|
) : (
|
|
|
- <div id="finger-note-1" class={[styles.note, styles.btnGrToggleBtn]} onClick={() => (data.tnoteShow = true)}>
|
|
|
+ <div id="finger-note-1" class={[styles.note, styles.btnGrToggleBtn]} onClick={() => {
|
|
|
+ isMoreFunShow.value = false;
|
|
|
+ data.tnoteShow = true
|
|
|
+ }}>
|
|
|
<img draggable={false} src={noteImg} />
|
|
|
<div>
|
|
|
<div class={styles.name}>
|
|
@@ -1577,6 +1603,7 @@ export default defineComponent({
|
|
|
onTouchstart={(e: any) => {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
+ isMoreFunShow.value = false;
|
|
|
isTouch = true;
|
|
|
startNotePress(note, false);
|
|
|
}}
|
|
@@ -1625,6 +1652,7 @@ export default defineComponent({
|
|
|
class={styles.noteBtn}
|
|
|
onClick={(e: any) => {
|
|
|
e.stopPropagation();
|
|
|
+ isMoreFunShow.value = false;
|
|
|
scrollNoteBox("right");
|
|
|
}}
|
|
|
>
|
|
@@ -1632,13 +1660,79 @@ export default defineComponent({
|
|
|
</Button>
|
|
|
)}
|
|
|
</div>
|
|
|
+ <div class={styles.restoreBox}>
|
|
|
+ {instrumentTranstion.value && (
|
|
|
+ <div class={[styles.restoreBtn]} onClick={() => resetElement()}>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ <div ref={moreFunDom} class={styles.moreFun} onClick={()=>{ isMoreFunShow.value = !isMoreFunShow.value }}>
|
|
|
+ 更多功能
|
|
|
+ <div class={[styles.btnBox, isMoreFunShow.value ? styles.isMoreFunShow : ""]} >
|
|
|
+ <div class={styles.btnCon}>
|
|
|
+ <div
|
|
|
+ class={[styles.btnGr]}
|
|
|
+ onClick={(e) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ isMoreFunShow.value = false;
|
|
|
+ //
|
|
|
+ // 播放音阶时不能切换
|
|
|
+ if (playStatus.gamut) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 开始答题不能切换
|
|
|
+ if (playAction.listenLock) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ data.changeSubjectShow = true;
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <img src={icons.icon_change_instrument} />
|
|
|
+ <span>切换乐器</span>
|
|
|
+ </div>
|
|
|
+ {data.subject !== "melodica" && data.fingeringMode === "scaleMode" && (
|
|
|
+ <div
|
|
|
+ class={styles.btnGr}
|
|
|
+ onClick={(e) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ data.viewIndex++;
|
|
|
+ if (data.viewIndex > data.viewTotal) {
|
|
|
+ if (["pan-flute", "ocarina", "whistling"].includes(data.subject)) {
|
|
|
+ data.viewIndex = 1;
|
|
|
+ } else {
|
|
|
+ data.viewIndex = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ getFingeringData();
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <img src={icons.icon_toggle} />
|
|
|
+ <span>视图</span>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ <div
|
|
|
+ class={styles.btnGr}
|
|
|
+ onClick={(e) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ isMoreFunShow.value = false;
|
|
|
+ resetElement();
|
|
|
+ data.tipShow = !data.tipShow;
|
|
|
+ onResize();
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <img src={icons.icon_2_1} />
|
|
|
+ <span>说明</span>
|
|
|
+ </div>
|
|
|
+ <div class={styles.triangle}></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
{data.fingeringMode !== "scaleMode" && (
|
|
|
<div
|
|
|
class={styles.optionBtns}
|
|
|
- onClick={(e: any) => {
|
|
|
- e.stopPropagation();
|
|
|
- }}
|
|
|
>
|
|
|
<Button class={[styles.oBtn, styles.gamut, playStatus.action && styles.disabled]} round onClick={onGamutPlayOrPause}>
|
|
|
{playStatus.gamut ? "暂停" : "播放音阶"}
|
|
@@ -1654,7 +1748,7 @@ export default defineComponent({
|
|
|
</>
|
|
|
) : (
|
|
|
<>
|
|
|
- <div class={styles.btnBox}>
|
|
|
+ {/* <div class={styles.btnBox}>
|
|
|
<div class={styles.btnCon}>
|
|
|
<div
|
|
|
class={[styles.btnGr]}
|
|
@@ -1714,7 +1808,7 @@ export default defineComponent({
|
|
|
</div>
|
|
|
)}
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> */}
|
|
|
</>
|
|
|
)}
|
|
|
</Tab>
|