소스 검색

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

TIANYONG 9 달 전
부모
커밋
274a9af76c
2개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      src/page-instrument/view-detail/smoothAnimation/index.ts
  2. 5 1
      src/view/evaluating/index.tsx

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

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

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