TIANYONG vor 4 Monaten
Ursprung
Commit
08b038787b

+ 1 - 1
src/page-instrument/custom-plugins/guide-driver/index.less

@@ -150,7 +150,7 @@
 
 .popoverClass5-1 {
   width: 257px;
-  height: 165px;
+  height: 145px;
   background: url("./images/practise/d5-1.png") no-repeat center;
   background-size: contain;
 

+ 19 - 16
src/page-instrument/custom-plugins/guide-driver/index.tsx

@@ -21,7 +21,7 @@ type ButtonStatus = {
   playBtnStatus?: Boolean;
   /** 声部状态 */
   subjectStatus?: Boolean;
-  /** 练习模式 */
+  /** 是否显示模式切换 */
   modelTypeStatus?: Boolean;
   /** 播放模式 演唱 演奏 */
   playType?: Boolean;
@@ -58,7 +58,7 @@ export const PractiseDriver = defineComponent({
     };
 
     const driverOptions = (): Config => {
-      let length = 10;
+      let length = 11;
 
       if (!props.statusAll.playBtnStatus) {
         length -= 1;
@@ -131,21 +131,24 @@ export const PractiseDriver = defineComponent({
           },
         });
       }
-      options.steps?.push({
-        element: ".driver-9",
-        popover: {
-          title: "",
-          description: "",
-          popoverClass: "popoverClass popoverClass9",
-          align: "end",
-          side: "bottom",
-          nextBtnText: `下一步 (2/${length})`,
-          showButtons: ["next"],
-          onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
-            driverInitialPosition(popover, options);
+
+      if (props.statusAll.modeType) {
+        options.steps?.push({
+          element: ".driver-9",
+          popover: {
+            title: "",
+            description: "",
+            popoverClass: "popoverClass popoverClass9",
+            align: "end",
+            side: "bottom",
+            nextBtnText: `下一步 (2/${length})`,
+            showButtons: ["next"],
+            onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
+              driverInitialPosition(popover, options);
+            },
           },
-        },
-      });
+        });
+      }
 
       if (props.statusAll.playType) {
         options.steps?.push({

+ 2 - 2
src/page-instrument/custom-plugins/recording-time/index.tsx

@@ -9,8 +9,8 @@ const recordData = reactive({
 	starTime: 0,
 });
 const handleRecord = () => {
-	// 不是练习模式不记录
-	if (state.modeType !== "practise") return;
+	// 不是练习模式不记录,web后台不记录
+	if (state.modeType !== "practise" || state.systemType === 'web') return;
 	let total = Date.now() - recordData.starTime;
 	recordData.starTime = Date.now();
 	if (total < 0) total = 0;

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

@@ -86,8 +86,8 @@ export default defineComponent({
       let tipContent = '';
       const rate = state.basePlayRate * state.originAudioPlayRate; // 播放倍率
       console.log('123456',state.systemType)
-      if (query.workRecord || state.section.length === 2 || state.isAppPlay || rate != 1 || !state.accompany || state.systemType === 'teacher' || state.systemType === 'web') {
-        tipContent = (state.systemType === 'teacher' || state.systemType === 'web') ? '暂不支持保存作品噢~' : query.workRecord ? '评测作业暂不支持保存作品噢~' : (!state.accompany || state.isAppPlay) ? '该曲目暂不支持保存作品噢~' : state.section.length === 2 ? '选段后暂不支持保存作品噢~' : rate != 1 ? '调速后暂不支持保存作品噢~' : '';
+      if (query.workRecord || state.section.length === 2 || state.isAppPlay || rate != 1 || !state.accompany || state.systemType === 'web') {
+        tipContent = (state.systemType === 'web') ? '暂不支持保存作品噢~' : query.workRecord ? '评测作业暂不支持保存作品噢~' : (!state.accompany || state.isAppPlay) ? '该曲目暂不支持保存作品噢~' : state.section.length === 2 ? '选段后暂不支持保存作品噢~' : rate != 1 ? '调速后暂不支持保存作品噢~' : '';
       }
       return tipContent
     })

+ 1 - 1
src/view/follow-practice/index.tsx

@@ -28,7 +28,7 @@ export const followData = reactive({
 
 // 记录跟练时长
 const handleRecord = (total: number) => {
-	if (query.isCbs) return
+	if (query.isCbs || state.systemType === 'web') return
 	if (total < 0) total = 0;
 	const totalTime = total / 1000;
 

+ 10 - 5
src/view/selection/index.tsx

@@ -12,6 +12,7 @@ import IntonationDown from "./imgs/pitchLow.png"
 import IntonationUp from "./imgs/pitchHigh.png"
 import MultipleRestMeasures from "./multipleRestMeasures"
 import { browser } from "../../utils";
+import { transform } from "lodash";
 
 export default defineComponent({
 	name: "selection",
@@ -51,18 +52,18 @@ export default defineComponent({
 					staveBox: null as any,
 				};
 				if (!notesList.includes(item.noteId)) {
-					let staveBbox: any = {};
+					let staveBbox: any = {}, customBgBox: any = {};
 					if (item.stave?.attrs?.id) {
 						const staveEle = document.querySelector(`#${item.stave.attrs.id}`);
 						staveBbox = staveEle?.parentElement?.parentElement?.getBoundingClientRect?.() || {
 							x: 0,
 							width: 0,
 						};
+						customBgBox = staveEle?.querySelector('.vf-custom-bg')?.getBoundingClientRect() || { y: 0, height: 0 }
 						// console.log("🚀 ~ staveBbox:", staveBbox.height)
 					}
 					if (item.svgElement) {
 						const noteEle = document.querySelector(`#vf-${item.svgElement?.attrs?.id}`);
-		
 						if (noteEle) {
 							const noteBbox = noteEle.getBoundingClientRect?.() || { x: 0, width: 0 };
 							if (state.musicRenderType !== EnumMusicRenderType.staff) {
@@ -88,14 +89,16 @@ export default defineComponent({
 								}
 								
 							} else {
+								const needTransY = -(staveBbox.height - customBgBox.height) / 2 + "px";
 								noteItem.bbox = {
 									left: noteBbox.x - parentLeft - noteBbox.width / 4 + "px",
-									top: staveBbox.y - parentTop + "px",
+									top: customBgBox.y ? customBgBox.y - parentTop + "px" : staveBbox.y - parentTop + "px",
 									width: noteBbox.width * 1.5 + "px",
 									height: staveBbox.height + "px",
 									x: item.bbox?.x,
 									y: item.bbox?.y,
-									originWidth: item.bbox?.width
+									originWidth: item.bbox?.width,
+									transform: `translateY(${needTransY})`
 								};
 							}
 							
@@ -219,8 +222,10 @@ export default defineComponent({
 						const currItem = selectData.staves.find(stave => {
 							return stave.MeasureNumberXML === item.MeasureNumberXML	
 						})
+						// 获取stave里面vf-custom-bg的位置坐标,才是准确的坐标
+						const currBgX = document.getElementById(currItem.stave.attrs.id)?.querySelector('.vf-custom-bg')?.getBoundingClientRect()?.x || 0;
 						return currItem && {
-							left: currItem.staveBox.left,
+							left: currBgX ? currBgX + 'px' : currItem.staveBox.left,
 							top: currItem.staveBox.top,
 							height: selectData.measureHeight + 'px'  // 小节的高度
 						}