Browse Source

Merge branch 'feature-tianyong' into gym-test

TIANYONG 6 months ago
parent
commit
492de8c9bf

+ 8 - 3
src/helpers/formateMusic.ts

@@ -689,9 +689,14 @@ export const formatXML = (xml: string, xmlUrl?: string): string => {
 		state.originAudioPlayRate = speeds[0] / state.originSpeed
 	}
 	console.log('是否是变速的曲子:',hasVaryingSpeed,speeds)
-	const hasCommon = xmlParse.querySelectorAll('part-name')?.[0]?.textContent === 'common';
-	const currentTrackIndex = hasCommon ? state.partIndex + 1 : state.partIndex;
-	const repeats: any = Array.from(xmlParse.querySelectorAll('part')?.[currentTrackIndex]?.querySelectorAll('repeat')) || [];
+	let repeats: any = [];
+	if (state.partIndex === 999) {
+		repeats = Array.from(xmlParse.querySelectorAll('repeat')) || [];
+	} else {
+		const hasCommon = xmlParse.querySelectorAll('part-name')?.[0]?.textContent === 'common';
+		const currentTrackIndex = hasCommon ? state.partIndex + 1 : state.partIndex;
+		repeats = Array.from(xmlParse.querySelectorAll('part')?.[currentTrackIndex]?.querySelectorAll('repeat')) || [];
+	}
 	compatibleXmlPitchVoice(xmlParse);
 	// 获取作词、作曲家
 	getComposer(xmlParse);

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

@@ -266,8 +266,8 @@
 }
 
 .popoverClass6-end {
-  width: 270px;
-  height: 145px;
+  width: 257px;
+  height: 165px;
   background: url("./images/practise/d6.png") no-repeat center;
   background-size: contain;
   &.popoverClose {

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

@@ -33,6 +33,8 @@ type ButtonStatus = {
   originPlayType?: Boolean;
   /** 是否显示原音 */
   originBtnStatus?: Boolean;
+  /** 是否显示切换曲谱列表 */
+  showSwitchList?: Boolean;
 };
 
 /** 练习模式 */
@@ -250,7 +252,6 @@ export const PractiseDriver = defineComponent({
         },
       });
 
-      
       if (state.platform === IPlatform.PC) {
         options.steps?.push({
           element: ".driver-6",
@@ -358,6 +359,31 @@ export const PractiseDriver = defineComponent({
               },
             },
           });
+        } else if (!props.statusAll.showSwitchList) {
+          options.steps?.push({
+            element: ".driver-6",
+            popover: {
+              title: "",
+              description: "",
+              popoverClass: "popoverClass popoverClass6-end popoverClose",
+              align: "end",
+              side: "bottom",
+              prevBtnText: "再看一遍",
+              doneBtnText: "完成",
+              showButtons: ["next", "previous"],
+              onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
+                driverInitialPosition(popover, options);
+                // const rect = options.state.activeElement?.getBoundingClientRect();
+                // popover.wrapper.style.marginLeft = -(rect?.width || 0) / 2 + 4 + "px";
+              },
+              onPrevClick: () => {
+                driverObj.drive(0);
+              },
+              onNextClick: () => {
+                onDriverClose();
+              },
+            },
+          });
         } else {
           options.steps?.push({
             element: ".driver-6",

+ 1 - 0
src/page-instrument/header-top/index.tsx

@@ -997,6 +997,7 @@ export default defineComponent({
               originBtnStatus: originBtn.value.display,
               backTitle: !(state.playState == "play" || followData.start || evaluatingData.startBegin) && isMusicList.value,
               titleType: smoothAnimationState.isShow.value ? "TEXT" : isMusicList.value ? "IMG" : "NONE",
+              showSwitchList: isMusicList.value && !state.isHomeWork && !query.isHideMusicList,
             }}
           />
         )}