Browse Source

Merge branch 'hqyDevNewVersion' of http://git.dayaedu.com/liushengqiang/music-score into feature-tianyong-newVersion

TIANYONG 9 months ago
parent
commit
274a9af76c

+ 2 - 2
src/page-instrument/view-detail/smoothAnimation/index.ts

@@ -77,7 +77,7 @@ export function initSmoothAnimation() {
    smoothAnimationState.aveSpeed = (canvasDomPath / (state.times[state.times.length - 1].time - state.times[0].time) / 1000) * 16.67
    // 当前屏幕的宽度
    calcClientWidth()
-   document.addEventListener("resize", calcClientWidth)
+   window.addEventListener("resize", calcClientWidth)
    // 初始化 只有练习模式 才显示
    state.modeType === "practise" && (smoothAnimationState.isShow.value = true)
    console.log(smoothAnimationState, "一行谱小鸟数据")
@@ -88,7 +88,7 @@ export function initSmoothAnimation() {
  */
 export function destroySmoothAnimation() {
    smoothAnimationState.isShow.value = false
-   document.removeEventListener("resize", calcClientWidth)
+   window.removeEventListener("resize", calcClientWidth)
    smoothAnimationState.smoothAnimationBoxDom?.remove()
    Object.assign(smoothAnimationState, {
       canvasDom: null,

+ 5 - 1
src/view/evaluating/index.tsx

@@ -128,7 +128,11 @@ const sendOffsetTime = async (offsetTime: number) => {
 export const handleStartEvaluat = async () => {
   if (state.modeType === "evaluating") {
     handleCancelEvaluat();
+    // 放下面会在异步之后执行 旋律线可能在会隐藏不了
+    state.modeType = "practise";
   } else {
+    // 放下面会在异步之后执行 旋律线可能在会隐藏不了
+    state.modeType = "evaluating";
     if (state.platform !== "PC") {
       // 评测前先检查APP端的websocket状态
       const res = await api_checkSocketStatus();
@@ -142,7 +146,7 @@ export const handleStartEvaluat = async () => {
       handleStopPlay();
     }
   }
-  state.modeType = state.modeType === "evaluating" ? "practise" : "evaluating";
+  //state.modeType = state.modeType === "evaluating" ? "practise" : "evaluating";
   if (state.modeType !== "evaluating") {
     // 切换到练习模式,卸载评测模块
     evaluatingData.rendered = false;