Quellcode durchsuchen

Merge branch 'feature-tianyong' into gym-dev

TIANYONG vor 6 Monaten
Ursprung
Commit
d4b0d82852

+ 1 - 1
osmd-extended

@@ -1 +1 @@
-Subproject commit 3689e3c4aac7182ec7cc8ed24b0953dd37c41227
+Subproject commit e77aa077f43f575035a4b3821baab0d1e91534c6

+ 2 - 1
src/helpers/formateMusic.ts

@@ -862,6 +862,7 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 	let repeatIdx = 0; // 循环的次数
 	// 当多选声部的时候 ,取选择的第一个声部
 	const firstTrackName = state.combinePartIndexs.length>1 ? state.partListNames[state.combinePartIndexs[0]] : state.canSelectTracks[0] || "";
+	const currentTrackIndex = state.isCombineRender && state.combinePartIndexs.length > 1 ? state.combinePartIndexs[0] : 0;
 	while (!iterator.EndReached) {
 		// console.log({ ...iterator });
 		/** 多声轨合并显示,当前音符的时值取所有声轨中的最小值 */
@@ -1041,7 +1042,7 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 				note.sourceMeasure.verticalMeasureList = note.sourceMeasure?.verticalMeasureList.filter((item: any) => state.canSelectTracks.includes(item?.parentStaff?.parentInstrument.Name))
 			}
 
-			activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[0]] || [];
+			activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[currentTrackIndex]] || [];
 			// 某些情况下,合并显示的妙极客曲子,note.sourceMeasure?.verticalMeasureList可能为空数组
 			if (state.isCombineRender && state.isEvxml && note.sourceMeasure?.verticalMeasureList.length === 0) {
 				activeVerticalMeasureList = osmd.GraphicSheet.MeasureList.find((item: any) => item[0]?.MeasureNumber === note.sourceMeasure.MeasureNumberXML) || [];

+ 1 - 1
src/helpers/oss-file-upload.ts

@@ -14,7 +14,7 @@ export async function fileUpload(fileName:string,file:Blob) {
 
 const getUploadSign = async (fileName:string) => {
    const fileUrl = "yjl/" + fileName
-   return request.post("/open/getUploadSign", {
+   return request.post("/getUploadSign", {
       data: {
          postData: {
             key: fileUrl

+ 7 - 3
src/page-instrument/api.ts

@@ -70,7 +70,11 @@ export const api_musicPracticeRecordSave = (data: any) => {
 /** 添加作业记录(练习或评测) */
 export const api_lessonTrainingSubmitTraining = (data: any, type?: string) => {
   const url = type === 'homeWork' ? `/studentCourseHomework/addStudentHomeworkRecord` : `/lessonExamination/submit`;
-  return request.post("/studentCourseHomework/addStudentHomeworkRecord", { requestType: "json", data });
+  if (type === 'homeWork') {
+    return request.get(url + `?id=${data.id}`);
+  } else {
+    return request.post(url, { requestType: "json", data });
+  }
 };
 /** 获取作业详情 */
 export const api_lessonTrainingTrainingStudentDetail = (id: any, type: string) => {
@@ -87,7 +91,7 @@ export const api_musicPracticeRecordVideoUpload = (data: any) => {
 
 /** 提交意见反馈 */
 export const sysSuggestionAdd = (data: any) => {
-  return request.post("/sysSuggestion/save", { data, requestType: "json" });
+  return request.post("/suggestion/add", { data });
 };
 
 /** 获取评测报告 */
@@ -133,7 +137,7 @@ export const getSubjectList = (data: any) => {
  * 获取意见类型
  */
 export const getSuggestionList = (params: any) => {
-  return request.post("/sysSuggestionType/page", {
+  return request.post("/sysSuggestionType/queryAll", {
     data: params,
     requestType: "json",
   });

BIN
src/page-instrument/component/the-music-list/imgs/empty.png


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

@@ -177,6 +177,7 @@
             display: flex;
             align-items: center;
             margin-top: 8px;
+            height: 14px;
             .usedNum{
                 display: flex;
                 align-items: center;
@@ -198,7 +199,6 @@
                 }
             }
             .author {
-                margin-left: 6px;
                 font-weight: 400;
                 font-size: 13px;
                 color: rgba(0,0,0,0.5);
@@ -212,12 +212,14 @@
     }
 }
 .empty{
-    margin-top: 10px;
     display: flex;
     flex-direction: column;
     align-items: center;
+    justify-content: center;
+    height: 100%;
     >img{
-        width: 182px;
+        margin-top: -10px;
+        width: 198px;
     }
     >span{
         font-size: 14px;

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

@@ -24,6 +24,7 @@ export default defineComponent({
       name: "",
       page: 1,
       rows: 20,
+      musicalInstrumentId: state.instrumentId,
       musicSheetCategoriesId: state.bizMusicCategoryId,
       recentFlag: props.recentFlag ? true : null,
       excludeMusicId: props.recentFlag ? null : state.examSongId,
@@ -125,7 +126,7 @@ export default defineComponent({
                 <div class={styles.content}>
                   <p class={styles.name}>{item.musicSheetName}</p>
                   <div class={styles.detail}>
-                    {item.usedNum && <div class={styles.usedNum}><img src={huoimg}/><div>{formatNumber(item.usedNum)}</div></div>}
+                    {/* {item.usedNum && <div class={styles.usedNum}><img src={huoimg}/><div>{formatNumber(item.usedNum)}</div></div>} */}
                     {item.composer && <p class={styles.author}>{item.composer}</p>}
                   </div>
                 </div>

+ 6 - 6
src/page-instrument/custom-plugins/helper-model/recommendation/index.tsx

@@ -20,11 +20,11 @@ export default defineComponent({
 		// 获取建议类别
 		const getTypeList = async () => {
 			try {
-				const res = await getSuggestionList({ rows: 9999, page: 1, useClient: "SMART_PRACTICE" });
-				const data = res.data.rows || [];
+				const res = await getSuggestionList({ rows: 9999, page: 1 });
+				const data = res.data || [];
 				suggestionTypeList.value = data.map((item:any) => {
 					return {
-						text: item.name,
+						text: item.type,
 						value: item.id
 					}
 				})
@@ -50,10 +50,10 @@ export default defineComponent({
 				},[])
 				await sysSuggestionAdd({
 					content: recommenData.message,
-					type: "SMART_PRACTICE",
-					suggestionTypeId: recommenData.suggestId,
+					type: 'APP',
+					suggestionType: recommenData.suggestId,
 					mobileNo: storeData.user?.phone,
-					attachmentUrls: attachmentUrlsArr.join(",")
+					url: attachmentUrlsArr.join(",")
 				});
 				showToast({
 					message: "意见反馈已提交",

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

@@ -287,7 +287,7 @@
 
 .disabled {
     pointer-events: none;
-    opacity: .8;
+    opacity: .4;
 }
 
 .playBtn {

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

@@ -697,12 +697,12 @@ export default defineComponent({
           )}
 
           {/* 模式提醒 */}
-          {state.modeType === "practise" && (
+          {/* {state.modeType === "practise" && (
             <div class={[styles.modeWarn, "practiseModeWarn", state.platform === IPlatform.PC && state.musicScoreBtnDirection === "left" ? styles.modeWarnRight : ""]}>
               <img src={state.playType === "play" ? headImg("perform1.png") : headImg("sing1.png")} />
               <div>{state.playType === "play" ? "演奏场景" : "演唱场景"}</div>
             </div>
-          )}
+          )} */}
           {/* 功能按钮 */}
           <div
             class={[styles.headRight]}

BIN
src/page-instrument/view-detail/emptyMusic/imgs/empty.png


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

@@ -14,8 +14,8 @@
         flex-direction: column;
         align-items: center;
         .img{
-            width: 202px;
-            height: 179px;
+            width: 198px;
+            height: 124px;
         }
         .tit{
             margin-top: 6px;
@@ -29,10 +29,10 @@
             width: 100px;
             height: 36px;
             border-radius: 18px;
-            border: 1px solid #1CACF1;
+            border: 1px solid #2DC7AA;
             font-weight: 400;
             font-size: 16px;
-            color: #1CACF1;
+            color: #2DC7AA;
             line-height: 36px;
             text-align: center;
             cursor: pointer;

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

@@ -327,10 +327,13 @@
 }
 
 @keyframes rotate {
-    from {
+    0% {
         transform: rotate(0deg);
     }
-    to {
+    90% {
+        transform: rotate(360deg);
+    }
+    100% {
         transform: rotate(360deg);
     }
 }
@@ -366,7 +369,7 @@
         flex-wrap: wrap;
         align-content: space-between;
         margin-bottom: 24px;
-        animation: rotate 1.5s linear infinite;
+        animation: rotate 1.5s ease-in-out infinite;
         .loadingCssItem{
             width: 11px;
             height: 11px;

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

@@ -603,7 +603,7 @@ export default defineComponent({
         {state.musicRendered && !state.isPreView && (
           <>
             {/* 统计训练时长 */}
-            {storeData.isApp && <RecordingTime />}
+            <RecordingTime />
             {/* 今日练习统计 */}
             {state.systemType === "student" && <ExerciseStatistics />}
             {/* 作业 */}

+ 14 - 1
src/state.ts

@@ -1392,7 +1392,7 @@ const getMusicInfo = async (res: any) => {
   let partIndexs = query["part-index"] ? query["part-index"].split(",") : ["-1"] // -1为partIndex没有值的时候
   partIndexs = partIndexs.map((indexStr:string) => {
     return parseInt(indexStr)
-  })
+  }).sort();
   let partIndex = partIndexs[0]
   // 当partIndexs 大于1个的时候,代表用户自己选择了多个声部,用总谱渲染的逻辑
   if(partIndexs.length > 1){
@@ -1413,6 +1413,12 @@ const getMusicInfo = async (res: any) => {
   xmlString = xmlAddPartName(xmlString);
   downloadXmlStr.value = xmlString //给musice-score 赋值xmlString 以免加载2次
   const tracks = xmlToTracks(xmlString) //获取声轨列表
+  // 如果是多个分轨合并显示的,需要记录下所选分轨的第一个分轨的名字,渲染计算音符位置的时候需要根据第一个分轨找到对应音符的位置
+  if (state.combinePartIndexs.length) {
+    (window as any).DYFirstTrackName = tracks[state.combinePartIndexs[0]] || '';
+  } else {
+    (window as any).DYFirstTrackName = '';
+  }
   // 设置音源  track 为当前的声轨 index为当前的
   const { track, index, musicalInstrumentId } = state.isSimplePage ? { track:tracks[0], index:0, musicalInstrumentId: '' } : initMusicSource(res.data, tracks, partIndex, workRecordInstrumentId)
   // 这里返回的track可能和实际的对不上,所以重新筛选一下
@@ -1518,6 +1524,13 @@ function initMusicSource(data: any, tracks: string[], partIndex: number, workRec
     }
     state.partListNames = tracks
   }
+  /*  目前 管乐迷没有演唱模式 所以先排除掉演唱模式的数据 */
+  if(fanSongObj?.audioFileUrl || banSongObj?.audioFileUrl || fanSongObj?.solmizationFileUrl || fanSongObj?.femaleSolmizationFileUrl){
+    fanSongObj?.audioFileUrl && (fanSongObj.audioFileUrl = null)
+    banSongObj?.audioFileUrl && (banSongObj.audioFileUrl = null)
+    fanSongObj?.solmizationFileUrl && (fanSongObj.solmizationFileUrl = null)
+    fanSongObj?.femaleSolmizationFileUrl && (fanSongObj.femaleSolmizationFileUrl = null)
+  }
   // 当没有任何曲目的时候报错
   if (!musicObj?.audioFileUrl && !accompanyObj?.audioFileUrl && !fanSongObj?.audioFileUrl && !banSongObj?.audioFileUrl && !fanSongObj?.solmizationFileUrl && !fanSongObj?.femaleSolmizationFileUrl) {
     state.noMusicSource = true // 没有音源文件

+ 6 - 3
src/view/abnormal-pop/index.module.less

@@ -140,7 +140,7 @@
     flex-wrap: wrap;
     align-content: space-between;
     margin-bottom: 24px;
-    animation: rotate 1.5s linear infinite;
+    animation: rotate 1.5s ease-in-out infinite;
     .loadingCssItem{
         width: 11px;
         height: 11px;
@@ -154,10 +154,13 @@
 }
 
 @keyframes rotate {
-    from {
+    0% {
         transform: rotate(0deg);
     }
-    to {
+    90% {
+        transform: rotate(360deg);
+    }
+    100% {
         transform: rotate(360deg);
     }
 }