浏览代码

Merge branch 'feature-tianyong-newVersion' into ktyq-test-new

TIANYONG 1 年之前
父节点
当前提交
4c371d5a8f
共有 33 个文件被更改,包括 152 次插入21 次删除
  1. 1 1
      src/helpers/formateMusic.ts
  2. 二进制
      src/page-instrument/component/the-music-list/imgs/empty.png
  3. 11 5
      src/page-instrument/component/the-music-list/index.module.less
  4. 6 1
      src/page-instrument/component/the-music-list/list.tsx
  5. 3 0
      src/page-instrument/custom-plugins/work-ealuating/index.tsx
  6. 2 1
      src/page-instrument/custom-plugins/work-home/index.tsx
  7. 14 1
      src/page-instrument/custom-plugins/work-index/index.tsx
  8. 二进制
      src/page-instrument/evaluat-model/countdown/imgs/step1.png
  9. 二进制
      src/page-instrument/evaluat-model/countdown/imgs/step2.png
  10. 二进制
      src/page-instrument/evaluat-model/countdown/imgs/step3.png
  11. 1 0
      src/page-instrument/evaluat-model/evaluat-result/index.tsx
  12. 4 1
      src/page-instrument/evaluat-model/index.tsx
  13. 二进制
      src/page-instrument/header-top/image/background1Act.png
  14. 二进制
      src/page-instrument/header-top/image/backgroundAct.png
  15. 0 0
      src/page-instrument/header-top/image/glMode.json
  16. 二进制
      src/page-instrument/header-top/image/icon_menuAct.png
  17. 二进制
      src/page-instrument/header-top/image/icon_pause.png
  18. 0 0
      src/page-instrument/header-top/image/lxMode.json
  19. 二进制
      src/page-instrument/header-top/image/mingsongAct.png
  20. 二进制
      src/page-instrument/header-top/image/music1Act.png
  21. 二进制
      src/page-instrument/header-top/image/musicAct.png
  22. 0 0
      src/page-instrument/header-top/image/pcMode.json
  23. 二进制
      src/page-instrument/header-top/image/performAct.png
  24. 二进制
      src/page-instrument/header-top/image/shengguiAct.png
  25. 二进制
      src/page-instrument/header-top/image/singAct.png
  26. 二进制
      src/page-instrument/header-top/image/tickoffAct.png
  27. 二进制
      src/page-instrument/header-top/image/tickonAct.png
  28. 89 2
      src/page-instrument/header-top/index.module.less
  29. 6 6
      src/page-instrument/header-top/index.tsx
  30. 4 2
      src/page-instrument/view-detail/index.tsx
  31. 7 1
      src/state.ts
  32. 3 0
      src/view/audio-list/index.tsx
  33. 1 0
      src/view/evaluating/index.tsx

+ 1 - 1
src/helpers/formateMusic.ts

@@ -1163,7 +1163,7 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 				if (["2670"].includes(state.cbsExamSongId)) {
 					// fixtime -= _firstMeasureRealValue * formatBeatUnit(beatUnit) * (60 / beatSpeed);
 				} else {
-					if (difftime > 0) {
+					if (difftime > 0 && !state.isEvxml) {
 						fixtime += difftime;
 						state.fixtime = fixtime;
 					}

二进制
src/page-instrument/component/the-music-list/imgs/empty.png


+ 11 - 5
src/page-instrument/component/the-music-list/index.module.less

@@ -216,11 +216,17 @@
         }
     }
 }
-.noData {
+.empty{
+    margin-top: 10px;
     display: flex;
-    justify-content: center;
+    flex-direction: column;
     align-items: center;
-    height: 100%;
-    font-size: 14px;
-    color: #999999;
+    >img{
+        width: 182px;
+    }
+    >span{
+        font-size: 14px;
+        color: rgba(0,0,0,0.46);
+        margin-top: 10px;
+    }
 }

+ 6 - 1
src/page-instrument/component/the-music-list/list.tsx

@@ -7,6 +7,7 @@ import { postMessage } from "/src/utils/native-message";
 import qs from "query-string";
 import searImg from "./imgs/searImg.png"
 import huoimg from "./imgs/huo.png"
+import emptyImg from "./imgs/empty.png"
 
 export default defineComponent({
   name: "TheMusicList-list",
@@ -122,7 +123,11 @@ export default defineComponent({
               </div>
             );
           })}
-          {!data.loading && data.list.length === 0 && <div class={styles.noData}>暂无数据</div>}
+          {!data.loading && data.list.length === 0 
+            &&  <div class={styles.empty}>
+                  <img src={emptyImg}/>
+                  <span>暂无内容</span>
+                </div>}
         </List>
       </div>
     );

+ 3 - 0
src/page-instrument/custom-plugins/work-ealuating/index.tsx

@@ -80,6 +80,9 @@ export default defineComponent({
 			getWorkData();
 			// verifyMembershipServices();
 		});
+		expose({
+			getWorkData
+		})		
 		return () => <div></div>;
 	},
 });

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

@@ -102,7 +102,8 @@ export default defineComponent({
 			// verifyMembershipServices();
 		});
 		expose({
-			handleAdd
+			handleAdd,
+			getWorkData
 		})
 		return () => (
 			<div class={styles.homework}>

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

@@ -5,8 +5,10 @@ import { getQuery } from "/src/utils/queryString";
 import { api_lessonTrainingTrainingStudentDetail } from "../../api";
 import { headTopData } from "../../header-top";
 import { evaluatingData } from "/src/view/evaluating";
+import state from "/src/state";
 
 const workHomeRef = ref();
+const workEvaluatRef = ref();
 
 export const data = reactive({
 	/** 作业类型:练习PRACTICE, 评测EVALUATION */
@@ -20,6 +22,17 @@ export const HANDLE_WORK_ADD = () => {
 	}
 };
 
+// 刷新谱面后,设置作业选段
+export const resetSection = () => {
+	if (data.trainingType === "PRACTICE"){
+		workHomeRef.value?.getWorkData();
+	}
+	if (data.trainingType === "EVALUATION") {
+		workHomeRef.value?.getWorkData();
+	}
+	state.workSectionNeedReset = false;
+};
+
 export default defineComponent({
 	name: "workIndex",
 	setup(props) {
@@ -56,7 +69,7 @@ export default defineComponent({
 				{data.trainingType === "PRACTICE" && <WorkHome ref={workHomeRef} workeData={data.worke} />}
 				{/* 评测作业 */}
 				{data.trainingType === "EVALUATION" && (
-					<WorkEaluating workeData={data.worke} />
+					<WorkEaluating ref={workEvaluatRef} workeData={data.worke} />
 				)}
 			</>
 		);

二进制
src/page-instrument/evaluat-model/countdown/imgs/step1.png


二进制
src/page-instrument/evaluat-model/countdown/imgs/step2.png


二进制
src/page-instrument/evaluat-model/countdown/imgs/step3.png


+ 1 - 0
src/page-instrument/evaluat-model/evaluat-result/index.tsx

@@ -75,6 +75,7 @@ export default defineComponent({
       if (res?.code === 200) {
         evaluatingData.resultData.recordId = res.data;
       }
+      evaluatingData.needReplayEvaluat = evaluatingData.oneselfCancleEvaluating ? true : false;
       data.saveLoading = false;
     };
 

+ 4 - 1
src/page-instrument/evaluat-model/index.tsx

@@ -332,6 +332,8 @@ export default defineComponent({
         evaluatingData.oneselfCancleEvaluating = true;
         // handleCancelEvaluat();
         handleEndEvaluat(true, 'selfCancel');
+        evaluatingData.isBeginMask = true;
+        state.playState = "paused";
       }
       resetPlaybackToStart();
       evaluatingData.resulstMode = false;
@@ -370,6 +372,7 @@ export default defineComponent({
     };
 
     const startBtnHandle = async () => {
+      evaluatingData.needReplayEvaluat = false;
       // 选段未完成时,清除选段状态
       if (state.sectionStatus && state.section.length < 2) {
         clearSelection();
@@ -448,7 +451,7 @@ export default defineComponent({
 
     // 手动取消评测,需要自动再次评测
     watch(
-      () => evaluatingData.hideResultModal,
+      () => evaluatingData.needReplayEvaluat,
       (val) => {
         if (val && evaluatingData.oneselfCancleEvaluating) {
           setTimeout(() => {

二进制
src/page-instrument/header-top/image/background1Act.png


二进制
src/page-instrument/header-top/image/backgroundAct.png


文件差异内容过多而无法显示
+ 0 - 0
src/page-instrument/header-top/image/glMode.json


二进制
src/page-instrument/header-top/image/icon_menuAct.png


二进制
src/page-instrument/header-top/image/icon_pause.png


文件差异内容过多而无法显示
+ 0 - 0
src/page-instrument/header-top/image/lxMode.json


二进制
src/page-instrument/header-top/image/mingsongAct.png


二进制
src/page-instrument/header-top/image/music1Act.png


二进制
src/page-instrument/header-top/image/musicAct.png


文件差异内容过多而无法显示
+ 0 - 0
src/page-instrument/header-top/image/pcMode.json


二进制
src/page-instrument/header-top/image/performAct.png


二进制
src/page-instrument/header-top/image/shengguiAct.png


二进制
src/page-instrument/header-top/image/singAct.png


二进制
src/page-instrument/header-top/image/tickoffAct.png


二进制
src/page-instrument/header-top/image/tickonAct.png


+ 89 - 2
src/page-instrument/header-top/index.module.less

@@ -135,6 +135,93 @@
             color: #FFFFFF;
             line-height: 17px;
         }
+        &:active{
+            >span{
+                color: #34D6FF
+            };
+        }
+        &.playType:active{
+            >img:nth-child(1){
+                content: url("./image/performAct.png");
+            }            
+            >img:nth-child(2){
+                content: url("./image/singAct.png");
+            }
+        }
+        &.playSource:active{
+            >img:nth-child(1){
+                content: url("./image/musicAct.png");
+            }            
+            >img:nth-child(2){
+                content: url("./image/backgroundAct.png");
+            }            
+        }      
+        &.songSource:active{
+            >img:nth-child(1){
+                content: url("./image/music1Act.png");
+            }            
+            >img:nth-child(2){
+                content: url("./image/background1Act.png");
+            }            
+            >img:nth-child(3){
+                content: url("./image/mingsongAct.png");
+            }
+        }
+        &.section:active{
+            >img{
+                content: url("./image/section2.png");
+            }
+        }
+        &.isSection{
+            >span{
+                color: #34D6FF
+            };
+        }
+        &.speed:active{
+            >img:nth-child(1){
+                content: url("./image/tickonAct.png");
+            }            
+            >img:nth-child(2){
+                content: url("./image/tickoffAct.png");
+            } 
+        }
+        &.isSpeed{
+            >img:nth-child(1){
+                content: url("./image/tickonAct.png");
+            }            
+            >img:nth-child(2){
+                content: url("./image/tickoffAct.png");
+            } 
+            >span{
+                color: #34D6FF
+            }; 
+        }      
+        &.settingMode:active{
+            >img{
+                content: url("./image/icon_menuAct.png");
+            }            
+        }  
+        &.isSettingMode{
+            >img{
+                content: url("./image/icon_menuAct.png");
+            }            
+            >span{
+                color: #34D6FF
+            }; 
+        }  
+        &.musicSheet:active{
+            >img{
+                content: url("./image/shengguiAct.png");
+            }            
+        }       
+        &.isMusicSheet{
+            >img{
+                content: url("./image/shengguiAct.png");
+            }            
+            >span{
+                color: #34D6FF
+            }; 
+        }
     }
     .metronomeBtn{
         position: relative;
@@ -202,8 +289,8 @@
         left: 50%;
         top: 50%;
         transform: translate(-50%, -50%);
-        width: 85%;
-        height: 85%;
+        width: 43px;
+        height: 43px;
     }
 }
 

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

@@ -686,7 +686,7 @@ export default defineComponent({
             ) : null} */}
             <div
               style={{ display: playTypeBtn.value.display ? "" : "none" }}
-              class={["driver-2", styles.btn, playTypeBtn.value.disabled && styles.disabled]}
+              class={["driver-2", styles.btn, playTypeBtn.value.disabled && styles.disabled,styles.playType]}
               onClick={() => {
                 const oldPlayType = state.playType;
                 const oldPlaySource = state.playSource;
@@ -732,7 +732,7 @@ export default defineComponent({
             <div
               id={state.platform === IPlatform.PC ? "teacherTop-1" : "studnetT-1"}
               style={{ display: originBtn.value.display ? "" : "none" }}
-              class={["driver-3", styles.btn, originBtn.value.disabled && styles.disabled]}
+              class={["driver-3", styles.btn, originBtn.value.disabled && styles.disabled,state.playType === "play"?styles.playSource:styles.songSource]}
               onClick={() => {
                 const oldPlayType = state.playType;
                 const oldPlaySource = state.playSource;
@@ -760,7 +760,7 @@ export default defineComponent({
               <img style={{ display: state.playSource === "mingSong" ? "" : "none" }} class={styles.iconBtn} src={headImg(`mingsong.png`)} />
               <span>{state.playSource === "music" ? (state.playType === "play" ? "原声" : "范唱") : state.playSource === "background" ? (state.playType === "play" ? "伴奏" : "伴唱") : "唱名"}</span>
             </div>
-            <div id={state.platform === IPlatform.PC ? "teacherTop-2" : "studnetT-2"} style={{ display: selectBtn.value.display ? "" : "none" }} class={["driver-4", styles.btn, selectBtn.value.disabled && styles.disabled]} onClick={() => handleChangeSection()}>
+            <div id={state.platform === IPlatform.PC ? "teacherTop-2" : "studnetT-2"} style={{ display: selectBtn.value.display ? "" : "none" }} class={["driver-4", styles.btn, selectBtn.value.disabled && styles.disabled, styles.section, state.sectionStatus && styles.isSection]} onClick={() => handleChangeSection()}>
               <img style={{ display: state.section.length === 0 ? "" : "none" }} class={styles.iconBtn} src={headImg(`section0.png`)} />
               <img style={{ display: state.section.length === 1 ? "" : "none" }} class={styles.iconBtn} src={headImg(`section1.png`)} />
               <img style={{ display: state.section.length === 2 ? "" : "none" }} class={styles.iconBtn} src={headImg(`section2.png`)} />
@@ -770,7 +770,7 @@ export default defineComponent({
               <>
                 <div
                   style={{ display: metronomeBtn.value.display ? "" : "none" }}
-                  class={["driver-5", styles.btn, styles.metronomeBtn, metronomeBtn.value.disabled && styles.disabled]}
+                  class={["driver-5", styles.btn, styles.metronomeBtn, metronomeBtn.value.disabled && styles.disabled,headData.speedShow && styles.isSpeed,styles.speed]}
                   onClick={async () => {
                     headData.speedShow = !headData.speedShow;
                   }}
@@ -814,7 +814,7 @@ export default defineComponent({
             ) : null} */}
             {state.musicRendered && !query.lessonTrainingId && !query.questionId && state.isConcert && (
               <div
-                class={[styles.btn, state.playState === "play" && fingeringBtn.value.disabled && styles.disabled]}
+                class={[styles.btn, state.playState === "play" && fingeringBtn.value.disabled && styles.disabled,toggleMusicSheet.show&&styles.isMusicSheet,styles.musicSheet]}
                 onClick={() => {
                   toggleMusicSheet.toggle(true);
                 }}
@@ -823,7 +823,7 @@ export default defineComponent({
                 <span>声部</span>
               </div>
             )}
-            <div id={state.platform === IPlatform.PC ? "teacherTop-6" : "studnetT-6"} style={{ display: settingBtn.value.display ? "" : "none" }} class={["driver-6", styles.btn, settingBtn.value.disabled && styles.disabled]} onClick={() => (headTopData.settingMode = true)}>
+            <div id={state.platform === IPlatform.PC ? "teacherTop-6" : "studnetT-6"} style={{ display: settingBtn.value.display ? "" : "none" }} class={["driver-6", styles.btn, settingBtn.value.disabled && styles.disabled,headTopData.settingMode&&styles.isSettingMode,styles.settingMode]} onClick={() => (headTopData.settingMode = true)}>
               <img class={styles.iconBtn} src={headImg("icon_menu.png")} />
               <span>设置</span>
             </div>

+ 4 - 2
src/page-instrument/view-detail/index.tsx

@@ -22,7 +22,7 @@ import Tick, { handleInitTick } from "/src/view/tick";
 import FollowPractice, { followData } from "/src/view/follow-practice";
 import FollowModel from "../follow-model";
 import RecordingTime from "../custom-plugins/recording-time";
-import WorkIndex from "../custom-plugins/work-index";
+import WorkIndex, { resetSection } from "../custom-plugins/work-index";
 import TheMusicList, { isMusicList } from "../component/the-music-list";
 import { storeData } from "/src/store";
 import ViewFigner from "../view-figner";
@@ -277,7 +277,9 @@ export default defineComponent({
 
       evaluatCreateMusicPlayer();
       resetPlaybackToStart();
-
+      if (state.workSectionNeedReset) {
+        resetSection();
+      }
       // pushAppMusic();
       // console.timeEnd("渲染加载耗时");
     };

+ 7 - 1
src/state.ts

@@ -547,6 +547,8 @@ const state = reactive({
   xmlHasLyric: false,
   /** 生成图片的模式 */
   isCreateImg: false,
+  /** 切换谱面后,作业选段是否需要刷新 */
+  workSectionNeedReset: false,
 });
 const browserInfo = browser();
 let offset_duration = 0;
@@ -1418,7 +1420,8 @@ const setState = (data: any, index: number) => {
   /**
    * 单曲,指法根据用户当前的乐器来显示,如果没有则取musicSheetSoundList第一个track
    */
-  let musicalCode = !storeData.user?.instrumentId ? data.musicSheetSoundList?.find((item:any)=>{ return item.audioPlayType === "PLAY" })?.track || '' : data.musicSheetSoundList?.find((item: any) => item?.musicalInstrumentId == storeData.user?.instrumentId && item.audioPlayType === "PLAY")?.track || '';
+  const currentInstrumentId = query.instrumentId || storeData.user?.instrumentId;
+  let musicalCode = !currentInstrumentId ? data.musicSheetSoundList?.find((item:any)=>{ return item.audioPlayType === "PLAY" })?.track || '' : data.musicSheetSoundList?.find((item: any) => item?.musicalInstrumentId == currentInstrumentId && item.audioPlayType === "PLAY")?.track || '';
   const pitchSubject = musicalInstrumentCodeInfo.find((n) => n.code.toLocaleLowerCase() === subjectCode.toLocaleLowerCase())
   const pitchMusical = musicalInstrumentCodeInfo.find((n) => n.code.toLocaleLowerCase() === musicalCode.toLocaleLowerCase())
   state.subjectCodeId = pitchSubject ? pitchSubject.id : 0
@@ -1864,6 +1867,9 @@ export const refreshMusicSvg = () => {
   clearSelection();
   resetBaseRate();
   state.activeMeasureIndex = -1;
+  if (query.workRecord) {
+    state.workSectionNeedReset = true;
+  }
   // 销毁旋律线
   destroySmoothAnimation()
   musicScoreRef.value?.refreshMusicScore()

+ 3 - 0
src/view/audio-list/index.tsx

@@ -94,6 +94,8 @@ export const getAudioDuration = () => {
 		const songEndTime = state.times[state.times.length - 1 || 0]?.endtime || 0
 		return audioData.duration || songEndTime;
 	}
+	// 唱名文件时长比较短,和普通文件不一样 所以这里单独处理
+	if(state.playSource === "mingSong") return audioData.mingSongEle?.duration || audioData.duration;
 	return audioData.songEle?.duration || audioData.backgroundEle?.duration || audioData.mingSongEle?.duration || audioData.duration;
 };
 
@@ -224,6 +226,7 @@ export default defineComponent({
 		// 监听评测曲谱音频播放进度,返回
 		const progress = (res: any) => {
 			const currentTime = res?.currentTime || res?.content?.currentTime;
+			console.log('app进度时间',currentTime)
 			const total = res?.totalDuration || res?.content?.totalDuration;
 			const time = currentTime / 1000;
 			audioData.progress = time;

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

@@ -111,6 +111,7 @@ export const evaluatingData = reactive({
   recordingTime: 0, // 调用startRecording的时间 
   endEvaluatingTime: 0, // 调用endEvaluating的时间 
   evaluatSpeed: 0, // 评测记录的速度
+  needReplayEvaluat: false, // 手动取消评测,需要自动开始评测
 });
 
 const sendOffsetTime = async (offsetTime: number) => {

部分文件因为文件数量过多而无法显示