skyblued 2 vuotta sitten
vanhempi
commit
05067219db

+ 24 - 2
src/subpages/colexiu/fingering/format-id.ts

@@ -1,5 +1,6 @@
 export type ObjectType = { [key in string]: string | number }
 
+// 酷乐秀 指法映射
 export const formatdata: ObjectType = {
   Flute: 2,
   Clarinet: 4,
@@ -11,7 +12,6 @@ export const formatdata: ObjectType = {
   TenorSaxophone: 6,
   Saxophone: 6,
   UpBassHorn: 15,
-  // Piccolo: 6,
   Melodica: 137,
   HulusiFlute: 136,
   PanFlute: 135,
@@ -19,7 +19,29 @@ export const formatdata: ObjectType = {
   Recorder: 120,
   Ukulele: 130,
   Mouthorgan: 140,
-  Piano: 150
+  Piano: 150,
+}
+
+export const subjectTypes: ObjectType = {
+  '2': 'Flute',
+  '4': 'Clarinet',
+  '14': 'Trombone',
+  '17': 'Tuba',
+  '12': 'Trumpet',
+  '13': 'Horn',
+  '6': 'AltoSaxophone',
+  '15': 'UpBassHorn',
+  '137': 'Melodica',
+  '136': 'HulusiFlute',
+  '135': 'PanFlute',
+  '134': 'Ocarina',
+  '120': 'Recorder',
+  '130': 'Ukulele',
+  '140': 'Mouthorgan',
+  '150': 'Piano',
+}
+export const getSubjectIdCode = (subjectId: string) => {
+  return subjectTypes[subjectId] || ''
 }
 
 /**

+ 2 - 1
src/subpages/colexiu/uses/use-app.ts

@@ -11,7 +11,7 @@ import audiosInstance from '/src/helpers/multiple-audio'
 import { formatXML, onlyVisible, getCustomInfo } from '/src/pages/detail/helpers'
 import { MusicSheelDetail, ShaeetStatusType } from '../index.d'
 import { browser, getRequestHostname } from '/src/helpers/utils'
-import formatId from '../fingering/format-id'
+import formatId, { getSubjectIdCode } from '../fingering/format-id'
 import { evaluatStopPlay } from '../buttons/evaluating'
 
 const search = useOriginSearch()
@@ -145,6 +145,7 @@ export const useDetail = (id: number | string): [Ref<ShaeetStatusType>, Ref<Musi
       useMp3s(res.data)
       data.value = {
         ...res.data,
+        code: Array.isArray(res?.data?.background) && res.data.background.length ? getSubjectIdCode(res.data.background[0].musicSubject) : ''
       }
       if (data.value.notation == 0) {
         SettingState.sett.type = 'staff'