Browse Source

feat: 葫芦丝指法区分云教练页面和听音练习页面

TIANYONG 8 months ago
parent
commit
76303a967c

+ 2 - 2
src/view/fingering/fingering-config.ts

@@ -525,7 +525,7 @@ export const subjectFingering = (subjectId: number | string): IFingering => {
   }
 };
 
-export const getFingeringConfig = async (type: IVocals | undefined): Promise<ITypeFingering> => {
+export const getFingeringConfig = async (type: IVocals | undefined, source?: string): Promise<ITypeFingering> => {
   switch (type) {
     case "flute":
       const flute = await import(`./fingering-img/flute/index.json`);
@@ -614,7 +614,7 @@ export const getFingeringConfig = async (type: IVocals | undefined): Promise<ITy
         width: "180px",
       };
     case "hulusi-flute":
-      const hulusi = await import(`./fingering-img/hulusi-flute/index.json`);
+      const hulusi = source === 'musicDetail' ? await import(`./fingering-img/hulusi-flute0/index.json`) : await import(`./fingering-img/hulusi-flute/index.json`);
       return {
         json: hulusi.default,
         relationship: relationships.hulusi,

File diff suppressed because it is too large
+ 0 - 0
src/view/fingering/fingering-img/hulusi-flute/index.json


File diff suppressed because it is too large
+ 9 - 0
src/view/fingering/fingering-img/hulusi-flute0/index.json


+ 3 - 1
src/view/fingering/index.tsx

@@ -13,7 +13,9 @@ export default defineComponent({
       delay: 0,
     });
     const getFingeringData = async () => {
-      fingerData.subject = await getFingeringConfig(state.fingeringInfo.name);
+      // 葫芦丝的指法,云教练页面和听音练习页面,展示的不一样,需要区分
+      const source = state.fingeringInfo.name === 'hulusi-flute' ? 'musicDetail' : '';
+      fingerData.subject = await getFingeringConfig(state.fingeringInfo.name, source);
       console.log("🚀 ~ fingerData.subject:", fingerData.subject);
     };
     onBeforeMount(() => {

Some files were not shown because too many files changed in this diff