Browse Source

fix: bug修复

TIANYONG 4 months ago
parent
commit
e9bf2f447e

+ 1 - 1
src/page-instrument/custom-plugins/work-home/index.tsx

@@ -81,7 +81,7 @@ export default defineComponent({
 				if (state.playState === "play") {
 					training.starTime = Date.now();
 				} else {
-					addHomeworkRecored();
+					// addHomeworkRecored();
 				}
 			}
 		);

+ 3 - 3
src/page-instrument/evaluat-model/earphone/index.module.less

@@ -20,9 +20,9 @@
     .earphoneBtn {
         position: absolute;
         left: 50%;
-        bottom: 13px;
-        width: 133px;
-        height: 39px;
+        bottom: 25px;
+        width: 105px;
+        height: 30px;
         transform: translateX(-43%);
     }
 }

+ 14 - 3
src/page-instrument/header-top/index.tsx

@@ -495,7 +495,18 @@ export default defineComponent({
     const browInfo = browser();
     /** 返回 */
     const handleBack = () => {
-      HANDLE_WORK_ADD();
+      // 如果是乐教通,点击返回按钮,需要关闭当前窗口
+      if (query["isYjt"] == "1") {
+        window.parent.postMessage(
+          {
+            api: "api_YjtClose"
+          },
+          "*"
+        );
+        return
+      }
+      // 练习作业,完整练习才记录练习次数
+      // HANDLE_WORK_ADD();
       // 不在APP中,
       if (!storeData.isApp) {
         window.parent.postMessage(
@@ -657,7 +668,7 @@ export default defineComponent({
           }}
         >
           {/* 返回和标题 */}
-          {!(state.playState == "play" || followData.start || evaluatingData.startBegin) && (
+          {!(state.playState == "play" || followData.start || evaluatingData.startBegin) && !state.isWeb &&  (
             <div id="noticeBarRollDom" class={styles.headTopLeftBox}>
               {
                 !query.isMove && <img src={iconBack} class={["headTopBackBtn", styles.img, !headTopData.showBack && styles.hidenBack]} onClick={handleBack} />
@@ -680,7 +691,7 @@ export default defineComponent({
                   <NoticeBar text={state.examSongName} background="none" />
                 </div>
               ) : (
-                isMusicList.value && (
+                isMusicList.value && !state.isHomeWork && (
                   <img
                     src={listImg}
                     class={[styles.img, styles.listImg, "driver-8"]}

+ 10 - 2
src/page-instrument/header-top/settting/index.tsx

@@ -57,6 +57,12 @@ export default defineComponent({
             return list;
         });
 
+        const metronomeList = computed(() => {
+            const list =  state.modeType === 'follow' ? [{name:'音符',value:1},{name:'关闭',value:3}] : [{name:'音符',value:1},{name:'节拍',value:2},{name:'关闭',value:3}];
+            return list;
+        });
+       
+
 		return () => (
 			<div class={[styles.settting]}>
                 <div class={[styles.head, "top_draging"]}>
@@ -95,7 +101,7 @@ export default defineComponent({
                                 <div class={styles.tit}>指针模式</div>
                                 <div class={styles.radioBox}>
                                     {
-                                        [{name:'音符',value:1},{name:'节拍',value:2},{name:'关闭',value:3}].map(item=>{
+                                        metronomeList.value.map(item=>{
                                             return <div class={ metronomeData.cursorMode===item.value && styles.active } onClick={ ()=>{
                                                  // 切换光标模式
                                                 metronomeData.cursorMode = item.value
@@ -107,7 +113,9 @@ export default defineComponent({
                         <div class={styles.pointerCon}>
                             <div class={styles.pointerBox}>
                                 <div>音符:指针跟随音符播放</div>
-                                <div>节拍:指针跟随节拍播放</div>
+                                {
+                                    state.modeType !== 'follow' && <div>节拍:指针跟随节拍播放</div>
+                                }
                                 <div>关闭:不显示指针</div>
                             </div>
                         </div>

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

@@ -31,7 +31,7 @@
     overflow: hidden;
     --header-height: 60px;
     --pc-header-height: 72px;
-
+    background: #fff;
     // &.practise{
     //     background: url("./images/bg1.png") no-repeat;
     //     background-size: 100% 100%;
@@ -176,7 +176,7 @@
         }
 
         .headTopBackBtn {
-            display: none;
+            // display: none;
         }
 
         .pcTitle {

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

@@ -157,6 +157,7 @@ export default defineComponent({
       state.isHomeWork = query.workRecord || query.evaluatingRecord;
       // 如果是纯预览模式,0.65倍缩放谱面
       state.isPreView = query.isPreView;
+      state.isWeb = query.isWeb;
       if (state.isPreView) {
         state.zoom = query.zoom  || 0.65
       }

+ 7 - 0
src/state.ts

@@ -22,6 +22,7 @@ import { musicScoreRef, headerColumnHide } from "/src/page-instrument/view-detai
 import { headTopData } from "/src/page-instrument/header-top/index";
 import { api_lessonTrainingTrainingStudentDetail } from "/src/page-instrument/api"
 import { undoData, moveData } from "/src/view/plugins/move-music-score"
+import { HANDLE_WORK_ADD } from "/src/page-instrument/custom-plugins/work-index";
 
 const query: any = getQuery();
 
@@ -515,6 +516,8 @@ const state = reactive({
   isPreView: false,
   /** 是否为内容平台预览模式 */
   isCbsView: false,  
+  /** 是否是管乐迷后台预览模式 */
+  isWeb: false,
   /** 是否为评测报告模式 */
   isEvaluatReport: false,
   /** midi播放器是否初始化中 */
@@ -749,6 +752,10 @@ const handlePlaying = () => {
         }
         // #8698 bug修复
         if (state.modeType === "practise" && state.sectionStatus) {
+          // 练习作业,练习完一次需要增加练习次数
+          if (query.workRecord) {
+            HANDLE_WORK_ADD()
+          }
           onEnded();
           // state.activeNoteIndex = state.sectionFirst ? state.sectionFirst.i : state.section[0].i
           // dynamicShowPlaySpeed(state.activeNoteIndex)

+ 4 - 4
src/view/plugins/useDrag/dragbom.tsx

@@ -13,7 +13,7 @@ export default defineComponent({
 	},
   setup(props, { emit }) {
     const data = reactive({
-      guidePos: "bottom" as "bottom" | "left" | "right",
+      guidePos: "bottom" as "bottom" | "left" | "right" | "top",
     });
 
     const initGuidePos = () => {
@@ -25,8 +25,8 @@ export default defineComponent({
       const dragTop = dragBBox?.top || 0;
       const dragLeft = dragBBox?.left || 0;
       // 引导页出现在下边
-      if (pageHeight - dragTop > guideHeight) {
-        data.guidePos = "bottom"
+      if (pageHeight - dragTop < guideHeight + 20) {
+        data.guidePos = "top"
       } else {
         // 引导页出现在左边or右边
         data.guidePos = dragLeft > guideWidth ? "left" : "right"
@@ -48,7 +48,7 @@ export default defineComponent({
         </div>
         {
           props.showGuide && 
-          <div class={[styles.guide, data.guidePos === "left" && styles.guideLeft, data.guidePos === "right" && styles.guideRight, 'bom_guide']} onClick={() => emit("guideDone")}>
+          <div class={[styles.guide, data.guidePos === "top" && styles.guideTop, data.guidePos === "left" && styles.guideLeft, data.guidePos === "right" && styles.guideRight, 'bom_guide']} onClick={() => emit("guideDone")}>
             <div class={styles.guideBg}></div>
             <div class={styles.guideDone}></div>
           </div>          

+ 4 - 0
src/view/selection/index.tsx

@@ -375,6 +375,10 @@ export default defineComponent({
 								item && <div class={styles.selectBox} style={item}>
 									<div class={[styles.selectHandle,index>0&&styles.selectHandleRight,(state.playState==="play" || state.isHomeWork)&&styles.playIng]} onClick={()=>{
 										// 如果选择了2个 删除左边的时候
+										if (state.section.length===1&&index === 0) {
+											// #bug:11552
+											resetBaseRate(state.activeNoteIndex);
+										}
 										if(state.section.length===2&&index === 0){
 											state.section = []
 											// 重置速度和播放倍率