|
@@ -17,12 +17,16 @@ import state from "/src/state";
|
|
|
import { storeData } from "/src/store";
|
|
|
import { browser } from "/src/utils";
|
|
|
import { getNoteByMeasuresSlursStart } from "/src/helpers/formateMusic";
|
|
|
-import { Icon, NoticeBar, showToast, Swipe, SwipeItem } from "vant";
|
|
|
-import iconStudent from "./icons/student.png";
|
|
|
+import { Icon } from "vant";
|
|
|
import EvaluatResult from "./evaluat-result";
|
|
|
import EvaluatAudio from "./evaluat-audio";
|
|
|
import { api_openWebView, api_proxyServiceMessage, api_videoUpdate } from "/src/helpers/communication";
|
|
|
import EvaluatShare from "./evaluat-share";
|
|
|
+import { Vue3Lottie } from "vue3-lottie";
|
|
|
+import startData from "./data/start.json";
|
|
|
+import startingData from "./data/starting.json";
|
|
|
+import iconTastBg from "./icons/task-bg.svg";
|
|
|
+import iconEvaluat from './icons/evaluating.json'
|
|
|
|
|
|
// frequency 频率, amplitude 振幅, decibels 分贝
|
|
|
type TCriteria = "frequency" | "amplitude" | "decibels";
|
|
@@ -41,18 +45,7 @@ export default defineComponent({
|
|
|
* 铜管乐器一级的1a,1b,5,6测评要放原音音频
|
|
|
*/
|
|
|
const getMusicMode = () => {
|
|
|
- const muguan = [2, 4, 5, 6];
|
|
|
- const tongguan = [12, 13, 14, 15, 17];
|
|
|
- if (muguan.includes(state.subjectId) && (state.examSongName || "").search(/[^\u0000-\u00FF](1-2|1-3|1-6)/gi) > -1) {
|
|
|
- return "music";
|
|
|
- }
|
|
|
- if (tongguan.includes(state.subjectId) && (state.examSongName || "").search(/[^\u0000-\u00FF](1-1-1|1-1-2|1-5|1-6)/gi) > -1) {
|
|
|
- return "music";
|
|
|
- }
|
|
|
- if ([23, 113, 121].includes(state.subjectId)) {
|
|
|
- return "music";
|
|
|
- }
|
|
|
- return "background";
|
|
|
+ return "music";
|
|
|
};
|
|
|
const browserInfo = browser();
|
|
|
/** 是否是节奏练习 */
|
|
@@ -120,9 +113,10 @@ export default defineComponent({
|
|
|
// 重复的情况index会自然累加,render的index是谱面渲染的index
|
|
|
measureIndex: note.measureOpenIndex,
|
|
|
measureRenderIndex: item.measureListIndex,
|
|
|
- dontEvaluating: ListenMode || dontEvaluatingMode,
|
|
|
+ dontEvaluating: ListenMode || dontEvaluatingMode || item.skipMode,
|
|
|
musicalNotesIndex: item.i,
|
|
|
denominator: note.noteElement?.Length.denominator,
|
|
|
+ isOrnament: !!note?.voiceEntry?.ornamentContainer
|
|
|
};
|
|
|
datas.push(data);
|
|
|
}
|
|
@@ -134,24 +128,23 @@ export default defineComponent({
|
|
|
const rate = state.speed / state.originSpeed;
|
|
|
const content = {
|
|
|
musicXmlInfos: formatTimes(),
|
|
|
- id: state.examSongId,
|
|
|
subjectId: state.subjectId,
|
|
|
detailId: state.detailId,
|
|
|
examSongId: state.examSongId,
|
|
|
xmlUrl: state.xmlUrl,
|
|
|
partIndex: state.partIndex,
|
|
|
behaviorId,
|
|
|
- tenantId: storeData.user.tenantId,
|
|
|
platform: browserInfo.ios ? "IOS" : browserInfo.android ? "ANDROID" : "WEB",
|
|
|
clientId: storeData.platformType === "STUDENT" ? "student" : storeData.platformType === "TEACHER" ? "teacher" : "education",
|
|
|
+ hertz: state.setting.frequency,
|
|
|
+ reactionTimeMs: state.setting.reactionTimeMs,
|
|
|
speed: state.speed,
|
|
|
heardLevel: state.setting.evaluationDifficulty,
|
|
|
beatLength: Math.round((state.fixtime * 1000) / rate),
|
|
|
- campId: sessionStorage.getItem("campId") || "",
|
|
|
- evaluationCriteria: getEvaluationCriteria(),
|
|
|
+ // evaluationCriteria: getEvaluationCriteria(),
|
|
|
};
|
|
|
- const result = await connectWebsocket(content);
|
|
|
- state.playSource = getMusicMode();
|
|
|
+ await connectWebsocket(content);
|
|
|
+ state.playSource = 'music';
|
|
|
};
|
|
|
|
|
|
/** 评测结果按钮处理 */
|
|
@@ -214,54 +207,34 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
- watch(
|
|
|
- () => evaluatingData.startBegin,
|
|
|
- () => {
|
|
|
- if (evaluatingData.startBegin) {
|
|
|
- evaluatModel.tips = false;
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
return () => (
|
|
|
<div>
|
|
|
- {evaluatingData.websocketState && (
|
|
|
+ {!evaluatingData.websocketState && (
|
|
|
<>
|
|
|
{!evaluatingData.startBegin && (
|
|
|
<div class={styles.btn} onClick={handleStartBegin}>
|
|
|
- 开始演奏
|
|
|
+ <img src={iconEvaluat.evaluatingStart} />
|
|
|
</div>
|
|
|
)}
|
|
|
{evaluatingData.startBegin && (
|
|
|
<div class={[styles.btn, styles.endBtn]} onClick={() => handleEndBegin(false)}>
|
|
|
- <Icon name="success" />
|
|
|
- <span>结束演奏</span>
|
|
|
+ <img src={iconEvaluat.evaluatingEnd} />
|
|
|
</div>
|
|
|
)}
|
|
|
</>
|
|
|
)}
|
|
|
- {evaluatModel.tips && (
|
|
|
- <>
|
|
|
- <div class={styles.notice}>
|
|
|
- <img src={iconStudent} />
|
|
|
- <NoticeBar
|
|
|
- scrollable={false}
|
|
|
- style="background: #fff;color: #01C1B5;"
|
|
|
- mode="closeable"
|
|
|
- onClose={() => {
|
|
|
- evaluatModel.tips = false;
|
|
|
- }}
|
|
|
- >
|
|
|
- <Swipe style="height: 32px;" show-indicators={false} autoplay={3000} vertical>
|
|
|
- <SwipeItem>请在周围安静的环境下演奏,减少杂音</SwipeItem>
|
|
|
- <SwipeItem>请选择稳定、良好的网络环境,避免信号中断</SwipeItem>
|
|
|
- <SwipeItem>演奏前请调试好乐器,保证最佳演奏状态</SwipeItem>
|
|
|
- <SwipeItem>演奏时请佩戴耳机,评测收音更精准</SwipeItem>
|
|
|
- </Swipe>
|
|
|
- </NoticeBar>
|
|
|
- </div>
|
|
|
- <div style={{ height: "40px" }}></div>
|
|
|
- </>
|
|
|
- )}
|
|
|
+ <div style={{ display: !evaluatingData.startBegin ? "" : "none" }} class={styles.dialogueBox} key="start">
|
|
|
+ <div class={styles.dialogue}>
|
|
|
+ <img class={styles.dialoguebg} src={iconTastBg} />
|
|
|
+ <div>演奏前请调整好乐器,保证最佳演奏状态。</div>
|
|
|
+ </div>
|
|
|
+ <Vue3Lottie class={styles.dialogueIcon} animationData={startData}></Vue3Lottie>
|
|
|
+ </div>
|
|
|
+ <div style={{ display: evaluatingData.startBegin ? "" : "none" }} class={styles.dialogueBox} key="start">
|
|
|
+ <div class={styles.dialogueing}>收音中...</div>
|
|
|
+ <Vue3Lottie class={styles.dialogueIcon} animationData={startingData}></Vue3Lottie>
|
|
|
+ </div>
|
|
|
+
|
|
|
<Popup teleport="body" closeOnClickOverlay={false} defaultStyle={false} v-model:show={evaluatingData.earphoneMode}>
|
|
|
<Earphone
|
|
|
onClose={() => {
|