Browse Source

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

TIANYONG 8 months ago
parent
commit
bd6201c8c0

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

@@ -74,8 +74,8 @@ export const headTopData = reactive({
       if (!state.isSingleLine) {
         state.isSingleLine = true
         refreshMusicSvg()
-        smoothAnimationState.isShow.value = false; // 隐藏旋律线
       }
+      smoothAnimationState.isShow.value = false; // 隐藏旋律线
       state.playIngSpeed = state.originSpeed;
       handleStartEvaluat();
       // 开发模式,把此处打开

+ 5 - 10
src/page-instrument/view-detail/smoothAnimation/bird/index.tsx

@@ -10,16 +10,11 @@ export default defineComponent({
     name: "Bird",
     setup() {
         return () => <>
-                {
-                    state.playState === "paused" ?
-                        <Vue3Lottie key={1} class={styles.brid} animationData={stilln} autoPlay={true} loop={true}></Vue3Lottie>
-                        :
-                        <>
-                            <Vue3Lottie key={2} class={styles.brid} animationData={fly} autoPlay={true} loop={true}></Vue3Lottie>
-                            <Vue3Lottie key={2} class={styles.note} animationData={note} autoPlay={true} loop={true}></Vue3Lottie>
-                        </>
-                }
-            
+                <Vue3Lottie style={ { display : state.playState === "paused" ? "" : "none" } } key={1} class={styles.brid} animationData={stilln} autoPlay={true} loop={true}></Vue3Lottie>
+                <>
+                    <Vue3Lottie style={ { display : state.playState === "paused" ? "none" : "" } } key={2} class={styles.brid} animationData={fly} autoPlay={true} loop={true}></Vue3Lottie>
+                    <Vue3Lottie style={ { display : state.playState === "paused" ? "none" : "" } } key={2} class={styles.note} animationData={note} autoPlay={true} loop={true}></Vue3Lottie>
+                </>
         </>
     }
 })

+ 1 - 0
src/page-instrument/view-detail/smoothAnimation/index.less

@@ -5,6 +5,7 @@
         height: 2.4rem;
         &.smoothAnimationBoxHide{
             opacity: 0;
+            visibility: hidden;
         }
     }
     .smoothAnimationCon{

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

@@ -78,7 +78,8 @@ export function initSmoothAnimation() {
    // 当前屏幕的宽度
    calcClientWidth()
    document.addEventListener("resize", calcClientWidth)
-   smoothAnimationState.isShow.value = true
+   // 初始化 只有练习模式 才显示
+   state.modeType === "practise" && (smoothAnimationState.isShow.value = true)
    console.log(smoothAnimationState, "一行谱小鸟数据")
 }
 
@@ -285,7 +286,7 @@ function createSmoothAnimation() {
    }, 0)
    // box
    const smoothAnimationBoxDom = document.createElement("div")
-   smoothAnimationBoxDom.className = "smoothAnimationBox"
+   smoothAnimationBoxDom.className = "smoothAnimationBox smoothAnimationBoxHide"
    smoothAnimationState.smoothAnimationBoxDom = smoothAnimationBoxDom
    // con
    const smoothAnimationConDom = document.createElement("div")

+ 2 - 4
src/state.ts

@@ -1747,10 +1747,8 @@ watch(
 /** 刷新谱面 */
 export const refreshMusicSvg = () => {
   state.loadingText = '正在加载中,请稍等…'
-  if(state.isSingleLine){
-    // 销毁旋律线
-    destroySmoothAnimation()
-  }
+  // 销毁旋律线
+  destroySmoothAnimation()
   musicScoreRef.value?.refreshMusicScore()
 }