浏览代码

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

TIANYONG 9 月之前
父节点
当前提交
6a2c4f59a8

+ 0 - 2
src/page-instrument/component/authorName/index.module.less

@@ -1,7 +1,5 @@
 .authorName{
 .authorName{
     height: 1.8rem;
     height: 1.8rem;
-    position: relative;
-    top: 36px;
 }
 }
 .title{
 .title{
     width: 280px;
     width: 280px;

+ 3 - 0
src/page-instrument/custom-plugins/helper-model/recommendation/index.module.less

@@ -177,6 +177,9 @@
                             font-size: 14px;
                             font-size: 14px;
                             color: #AAAAAA;
                             color: #AAAAAA;
                         }
                         }
+                        &::-webkit-scrollbar {
+                            display: none;
+                        }
                     }
                     }
                 }
                 }
             }
             }

+ 14 - 6
src/page-instrument/view-detail/index.module.less

@@ -60,16 +60,18 @@
 
 
     .container {
     .container {
         position: sticky;
         position: sticky;
-        top: 36px;
-        height: calc(100vh - 36px);
+        top: 0;
+        height: 100vh;
         border-radius: 10px;
         border-radius: 10px;
         transition: height .2s;
         transition: height .2s;
         transition: padding-bottom .2s;
         transition: padding-bottom .2s;
         overflow: hidden;
         overflow: hidden;
-    }
-    .multiContainer {
-        top: 0;
-        height: calc(100vh);
+        :global{
+            #musicAndSelection {
+                // 其他位置 这个高度留白是36,这里加了一点,让旋律线靠下一点
+                padding-top: 40px;
+            }
+        }
     }
     }
     .pcContainer {
     .pcContainer {
         // height: calc(100vh - var(--header-height) - var(--pc-header-height));
         // height: calc(100vh - var(--header-height) - var(--pc-header-height));
@@ -233,6 +235,12 @@
     align-items: center;
     align-items: center;
     z-index: 10000;
     z-index: 10000;
     background: rgba(0, 0, 0, .6);
     background: rgba(0, 0, 0, .6);
+    &.isPreView{
+        background:transparent;
+        .loadingTip{
+            color: #999;
+        }
+    }
     .lottie{
     .lottie{
         width: 120px;
         width: 120px;
     }
     }

+ 1 - 1
src/page-instrument/view-detail/index.tsx

@@ -499,7 +499,7 @@ export default defineComponent({
         <div
         <div
           id="scrollContainer"
           id="scrollContainer"
           style={{ ...fingerConfig.value.container }}
           style={{ ...fingerConfig.value.container }}
-          class={[styles.container, !state.setting.displayCursor && "hideCursor", browsInfo.xiaomi && styles.xiaomi, state.platform === IPlatform.PC && styles.pcContainer, (!state.isSingleLine || state.isCombineRender) && styles.multiContainer]}
+          class={[styles.container, !state.setting.displayCursor && "hideCursor", browsInfo.xiaomi && styles.xiaomi, state.platform === IPlatform.PC && styles.pcContainer]}
           onClick={(e: Event) => {
           onClick={(e: Event) => {
             e.stopPropagation();
             e.stopPropagation();
             // if (state.playState === "play" && state.platform != IPlatform.PC) {
             // if (state.playState === "play" && state.platform != IPlatform.PC) {

+ 1 - 1
src/page-instrument/view-detail/loading.tsx

@@ -18,7 +18,7 @@ export default defineComponent({
    setup(props) {
    setup(props) {
       return () =>
       return () =>
          (
          (
-            <div class={styles.loadingPop} style={{display:state.isLoading? "flex" : "none"}}>
+            <div class={[styles.loadingPop, state.isPreView && styles.isPreView]} style={{display:state.isLoading? "flex" : "none"}}>
                <img class={styles.lottie} src={animGif} />
                <img class={styles.lottie} src={animGif} />
                {/* <Vue3Lottie class={styles.lottie} animationData={animBg}></Vue3Lottie> */}
                {/* <Vue3Lottie class={styles.lottie} animationData={animBg}></Vue3Lottie> */}
                <div class={styles.loadingTip}>{props.tipText}</div>
                <div class={styles.loadingTip}>{props.tipText}</div>

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

@@ -187,7 +187,7 @@ export function moveSmoothAnimation(progress: number, activeIndex: number, isMov
  */
  */
 function move_osmd(nowPointsPos: pointsPosType[0]) {
 function move_osmd(nowPointsPos: pointsPosType[0]) {
    // 评测移动太快看不到前面小节的分数,评测改成0.5倍速移动谱面
    // 评测移动太快看不到前面小节的分数,评测改成0.5倍速移动谱面
-   const speed = (state.modeType === 'evaluating' ? smoothAnimationState.aveSpeed * 0.5 : smoothAnimationState.aveSpeed) * (state.speed / 60)
+   const speed = (state.modeType === "evaluating" ? smoothAnimationState.aveSpeed * 0.5 : smoothAnimationState.aveSpeed) * (state.speed / 60)
    // 视口宽度
    // 视口宽度
    const clientWidth = smoothAnimationState.osdmScrollDomWith
    const clientWidth = smoothAnimationState.osdmScrollDomWith
    const clientMidWidth = clientWidth / 2
    const clientMidWidth = clientWidth / 2
@@ -316,27 +316,20 @@ function createSmoothAnimation() {
  * 根据音符获取坐标
  * 根据音符获取坐标
  */
  */
 function getPointsPosByBatePos(): pointsPosType {
 function getPointsPosByBatePos(): pointsPosType {
-   let totalAvInde = 0
-   // 取平均值
-   const totalAv =
-      state.times.reduce((total, item) => {
-         if (item.frequency !== -1) {
-            // -1 为休止符
-            total += item.frequency
-            totalAvInde++
-         }
-         return total
-      }, 0) / totalAvInde
-   const pointsPos = state.times.reduce((posArr: any[], item) => {
+   // 得到音符频率数据
+   const frequencyData = state.times.map(item => {
+      return !item.frequency || item.frequency === -1 ? 0 : item.frequency
+   })
+   console.log(frequencyData,"没线性化之前的数据")
+   // 线性频率数据
+   const frequencyLineData = quantileScale(frequencyData, 4, 76)
+   const pointsPos = state.times.reduce((posArr: any[], item, index) => {
       // 当休止小节,可能当前音符在谱面上没有实际的音符(没有bbox),所以往后找谱面上有的音符
       // 当休止小节,可能当前音符在谱面上没有实际的音符(没有bbox),所以往后找谱面上有的音符
       if (item.bbox) {
       if (item.bbox) {
          posArr.push({
          posArr.push({
             MeasureNumberXML: item.MeasureNumberXML,
             MeasureNumberXML: item.MeasureNumberXML,
             x: item.bbox.x,
             x: item.bbox.x,
-            // 当为休止符的时候 取最下面的位置*0.9,确保能显示完整
-            y:
-               smoothAnimationState.canvasDomHeight / 2 -
-               ((((item.frequency === -1 ? 2 * totalAv * 0.1 : item.frequency) - totalAv) / totalAv) * smoothAnimationState.canvasDomHeight) / 2
+            y: 80 - frequencyLineData[index]
          })
          })
       }
       }
       return posArr
       return posArr
@@ -352,6 +345,16 @@ function getPointsPosByBatePos(): pointsPosType {
    return pointsPos
    return pointsPos
 }
 }
 
 
+// 数据平滑算法
+function quantileScale(data: number[], minRange = 0, maxRange = 80) {
+   const sortedData = [...data].sort((a, b) => a - b)
+   return data.map(value => {
+      const rank = sortedData.indexOf(value) / (sortedData.length - 1)
+      const scaledValue = rank * (maxRange - minRange) + minRange
+      return Math.max(minRange, Math.min(scaledValue, maxRange))
+   })
+}
+
 /**
 /**
  * 使用传入的曲线的顶点坐标创建平滑曲线的顶点。
  * 使用传入的曲线的顶点坐标创建平滑曲线的顶点。
  * @param  {Array}   points  曲线顶点坐标数组,
  * @param  {Array}   points  曲线顶点坐标数组,

+ 10 - 7
src/view/plugins/toggleMusicSheet/choosePartName/index.tsx

@@ -1,4 +1,4 @@
-import { PropType, computed, defineComponent, ref, toRefs, onMounted, watch } from 'vue'
+import { PropType, computed, defineComponent, ref, toRefs, onMounted, watch, nextTick } from 'vue'
 import { Picker, Button, Icon } from 'vant'
 import { Picker, Button, Icon } from 'vant'
 import styles from './index.module.less'
 import styles from './index.module.less'
 import state, { IPlatform } from "/src/state";
 import state, { IPlatform } from "/src/state";
@@ -76,12 +76,15 @@ export default defineComponent({
               }}
               }}
             />
             />
             <div class={styles.button} onClick={() => {
             <div class={styles.button} onClick={() => {
-                // console.log(1111,selectIndex.value)
-                if (partIndexChanged.value) {
-                  emit('close', selectIndex.value)
-                } else {
-                  emit('close', partIndex.value)
-                }
+                myPicker.value.confirm()
+                nextTick(()=>{
+                  // console.log(1111,selectIndex.value)
+                  if (partIndexChanged.value) {
+                    emit('close', selectIndex.value)
+                  } else {
+                    emit('close', partIndex.value)
+                  }
+                })
               }
               }
             }></div>
             }></div>
           </div>
           </div>