Pārlūkot izejas kodu

fix: 自测bug修复

TIANYONG 7 mēneši atpakaļ
vecāks
revīzija
714d5a682b

+ 6 - 2
src/page-instrument/evaluat-model/index.tsx

@@ -1,4 +1,4 @@
-import { Transition, defineComponent, onMounted, reactive, watch, defineAsyncComponent } from "vue";
+import { Transition, defineComponent, onMounted, reactive, watch, defineAsyncComponent, computed } from "vue";
 import { connectWebsocket, evaluatingData, handleEndBegin, handleStartBegin, handleStartEvaluat, handleViewReport, startCheckDelay, checkUseEarphone, handleCancelEvaluat } from "/src/view/evaluating";
 import Earphone from "./earphone";
 import styles from "./index.module.less";
@@ -404,6 +404,10 @@ export default defineComponent({
       handleEvaluatResult("tryagain");
     };
 
+    const earPhonePopShow = computed(() => {
+			return evaluatingData.earphoneMode && state.audioDone && !state.hasDriverPop;
+		});
+
     onMounted(async () => {
       // 如果打开了延迟检测开关,需要先发送开始检测的消息
       if (state.setting.soundEffect) {
@@ -454,7 +458,7 @@ 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={evaluatingData.earphoneMode}>
+        <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={earPhonePopShow.value}>
           <Earphone
             earphoneType={evaluatingData.earPhoneType}
             onClose={() => {

+ 1 - 1
src/page-instrument/header-top/index.tsx

@@ -80,7 +80,7 @@ export const headTopData = reactive({
       state.playIngSpeed = state.originSpeed;
       handleStartEvaluat();
       // 开发模式,把此处打开
-      state.modeType = "evaluating";
+      // state.modeType = "evaluating";
       // evaluatingData.rendered = true;
       // evaluatingData.soundEffectMode = true;
     } else if (value === "follow") {

+ 1 - 0
src/page-instrument/header-top/speed/index.module.less

@@ -93,6 +93,7 @@
                             background: #94ACC4;
                             box-shadow: inset 0px 2px 3px 0px #647F98;
                             .van-slider__bar{
+                                max-width: 100%;
                                 background: linear-gradient( 270deg, #7ADEFF 0%, #29A9FF 100%);
                                 box-shadow: inset 1px 0px 5px 0px rgba(150,254,255,0.79);
                                 border: 1px solid #4A91D4;

+ 6 - 2
src/page-instrument/header-top/speed/index.tsx

@@ -12,11 +12,15 @@ export default defineComponent({
 		const speed = ref(state.speed);
 
 		const minusSpeed = () => {
-			speed.value = Math.max(speed.value - 1, 45);
+			let canSpeed = Math.max(speed.value - 1, 45);
+			canSpeed = Math.min(canSpeed, 270);
+			speed.value = canSpeed;
 		};
 
 		const plusSpeed = () => {
-			speed.value = Math.min(speed.value + 1, 270);
+			let canSpeed = Math.min(speed.value + 1, 270);
+			canSpeed = Math.max(canSpeed, 45);
+			speed.value = canSpeed;
 		};
 		watch(
 			() => speed.value,

+ 5 - 1
src/state.ts

@@ -509,6 +509,8 @@ const state = reactive({
   originAudioPlayRate: 1,  
   /** 开始播放时,记录的mp3播放倍率,用户当前设置的速度/当前小节的速度 */
   basePlayRate: 1,
+  /** 引导页显示状态 */
+  hasDriverPop: false,
 });
 const browserInfo = browser();
 let offset_duration = 0;
@@ -952,7 +954,7 @@ export const gotoNext = (note: any, skipNote?: boolean) => {
   let prev = state.activeNoteIndex;
   state.activeNoteIndex = num;
   state.activeMeasureIndex = note.MeasureNumberXML;
-
+  dynamicShowPlaySpeed(state.activeNoteIndex);
   if (prev && num - prev === 1) {
     // console.log('跳转音符',11111,osmd.cursor)
     // if (!note.id && note.multipleRestMeasures === 0) {
@@ -1222,6 +1224,7 @@ export const handleRessetState = () => {
   // 切换模式,清除选段
   clearSelection();
   skipNotePlay(0, true);
+  resetBaseRate();
   // midi 重置播放进度
   if (state.isAppPlay) {
     audioData.progress = 0;
@@ -1758,6 +1761,7 @@ watch(
 
 /** 刷新谱面 */
 export const refreshMusicSvg = () => {
+  resetBaseRate();
   state.loadingText = '正在加载中,请稍等…'
   // 销毁旋律线
   destroySmoothAnimation()

+ 2 - 2
vite.config.ts

@@ -76,8 +76,8 @@ export default defineConfig({
         // target: "https://kt.colexiu.com",
         // target: "https://test.lexiaoya.cn",
         // target: "https://kt.colexiu.com",
-        target: "https://dev.resource.colexiu.com", // 内容平台开发环境,内容平台开发,需在url链接上加上isCbs=true
-        // target: "https://test.kt.colexiu.com",
+        // target: "https://dev.resource.colexiu.com", // 内容平台开发环境,内容平台开发,需在url链接上加上isCbs=true
+        target: "https://dev.kt.colexiu.com",
         //target: "https://mec.colexiu.com",
         changeOrigin: true,
         rewrite: (path) => path.replace(/^\/instrument/, ""),