|
@@ -23,6 +23,8 @@ import { headTopData } from "../header-top/index";
|
|
|
import { getQuery } from "/src/utils/queryString";
|
|
|
import Countdown from "./countdown";
|
|
|
import { IPostMessage } from "/src/utils/native-message";
|
|
|
+import tipErjiBg from "./icons/tip_erji.png"
|
|
|
+import tipErjiBtn from "./icons/tip_btn.png"
|
|
|
|
|
|
// const DelayCheck = defineAsyncComponent(() =>
|
|
|
// import('./delay-check')
|
|
@@ -40,6 +42,12 @@ let actualBeatLength = 0;
|
|
|
let calculateInfo: any = {};
|
|
|
let checkErjiTimer: any = null
|
|
|
|
|
|
+export const reCheckDelay = () => {
|
|
|
+ headTopData.settingMode = false
|
|
|
+ state.setting.soundEffect = false
|
|
|
+ api_startDelayCheck({});
|
|
|
+}
|
|
|
+
|
|
|
export default defineComponent({
|
|
|
name: "evaluat-model",
|
|
|
setup() {
|
|
@@ -188,6 +196,11 @@ export default defineComponent({
|
|
|
}
|
|
|
// 阶段评测beatLength需要加上预备小节的持续时长
|
|
|
actualBeatLength = preTimes.length ? actualBeatLength + preTimes[preTimes.length - 1].relaMeasureLength * 1000 : actualBeatLength;
|
|
|
+ // 如果是弱起,并且预备小节是第一节
|
|
|
+ if (state.section.length && state.sectionFirst && state.sectionFirst.measureListIndex == 0) {
|
|
|
+ actualBeatLength = actualBeatLength < Math.round((state.times[0].fixtime * 1000) / 1) ? Math.round((state.times[0].fixtime * 1000) / 1) : actualBeatLength;
|
|
|
+ }
|
|
|
+
|
|
|
let firstNoteTime = unitTestIdx > 1 ? preTime : 0;
|
|
|
let measureIndex = -1;
|
|
|
let recordMeasure = -1;
|
|
@@ -198,7 +211,8 @@ export default defineComponent({
|
|
|
// #8701 bug: 评测模式,是以曲谱本身的速度进行评测,所以rate取1,不需要转换
|
|
|
// const rate = state.speed / state.originSpeed;
|
|
|
const rate = state.basePlayRate * state.originAudioPlayRate; // 播放倍率
|
|
|
- const difftime = item.difftime;
|
|
|
+ // const difftime = item.difftime;
|
|
|
+ const difftime = 0;
|
|
|
const start = difftime + (item.sourceRelativeTime || item.relativeTime) - starTime;
|
|
|
const end = difftime + (item.sourceRelaEndtime || item.relaEndtime) - starTime;
|
|
|
const isStaccato = note.noteElement.voiceEntry.isStaccato();
|
|
@@ -405,6 +419,11 @@ export default defineComponent({
|
|
|
});
|
|
|
}
|
|
|
// console.log('异常流程3')
|
|
|
+ // 非选段状态,从头开始评测,重置速度
|
|
|
+ if (!state.sectionStatus && state.section.length === 0) {
|
|
|
+ state.activeNoteIndex = 0;
|
|
|
+ state.speed = state.times[0].measureSpeed * state.basePlayRate
|
|
|
+ }
|
|
|
initSetPlayRate();
|
|
|
// 检测APP端socket状态
|
|
|
const res: any = await startCheckDelay();
|
|
@@ -435,7 +454,7 @@ export default defineComponent({
|
|
|
if (res?.content) {
|
|
|
evaluatingData.checkEnd = true;
|
|
|
state.setting.soundEffect = false;
|
|
|
- checkEarphoneStatus();
|
|
|
+ evaluatingData.tipErjiShow = true;
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -448,15 +467,20 @@ export default defineComponent({
|
|
|
return evaluatingData.earphoneMode && !state.isLoading && !state.hasDriverPop;
|
|
|
});
|
|
|
|
|
|
- watch(
|
|
|
- () => state.setting.soundEffect,
|
|
|
- (val) => {
|
|
|
- if (val) {
|
|
|
- headTopData.settingMode = false
|
|
|
- api_startDelayCheck({});
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
+ const tipErjiPopShow = computed(() => {
|
|
|
+ return evaluatingData.tipErjiShow && !state.isLoading && !state.hasDriverPop;
|
|
|
+ });
|
|
|
+
|
|
|
+ // watch(
|
|
|
+ // () => state.setting.soundEffect,
|
|
|
+ // (val) => {
|
|
|
+ // if (val) {
|
|
|
+ // headTopData.settingMode = false
|
|
|
+ // api_startDelayCheck({});
|
|
|
+ // state.setting.soundEffect = false
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // );
|
|
|
|
|
|
// 手动取消评测,需要自动再次评测
|
|
|
watch(
|
|
@@ -474,7 +498,7 @@ export default defineComponent({
|
|
|
// 如果打开了延迟检测开关,需要先发送开始检测的消息
|
|
|
const delayData = await api_getDeviceDelay();
|
|
|
console.log('设备的延迟值',delayData.content?.value)
|
|
|
- if (state.setting.soundEffect || (delayData && delayData.content?.value <= 0)) {
|
|
|
+ if (delayData && delayData.content?.value <= 0) {
|
|
|
await api_startDelayCheck({});
|
|
|
} else {
|
|
|
evaluatingData.checkEnd = true;
|
|
@@ -546,6 +570,15 @@ export default defineComponent({
|
|
|
{
|
|
|
evaluatingData.isBeginMask && <div class={styles.beginMask}></div>
|
|
|
}
|
|
|
+ <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={tipErjiPopShow.value}>
|
|
|
+ <div class={styles.earphoneBox}>
|
|
|
+ <img class={styles.earphoneBg} src={tipErjiBg} />
|
|
|
+ <img class={styles.earphoneBtn} src={tipErjiBtn} onClick={() => {
|
|
|
+ evaluatingData.tipErjiShow = false;
|
|
|
+ checkEarphoneStatus();
|
|
|
+ }} />
|
|
|
+ </div>
|
|
|
+ </Popup>
|
|
|
<Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={earPhonePopShow.value}>
|
|
|
<Earphone
|
|
|
earphoneType={evaluatingData.earPhoneType}
|
|
@@ -555,7 +588,7 @@ export default defineComponent({
|
|
|
// #11035,可能刚好关闭耳机弹窗的时候,第二次又出现了弹窗
|
|
|
setTimeout(() => {
|
|
|
evaluatingData.earphoneMode = false;
|
|
|
- }, 0);
|
|
|
+ }, 300);
|
|
|
// handlePerformDetection();
|
|
|
checkEarphoneStatus("start");
|
|
|
}}
|