|
@@ -1387,6 +1387,23 @@ function initMusicSource(data: any, track?: string) {
|
|
|
return musicObj
|
|
|
}
|
|
|
const setState = (data: any, index: number) => {
|
|
|
+ // 根据当前文件有没有 设置当前的播放模式
|
|
|
+ if(!state.music){
|
|
|
+ if(state.accompany){
|
|
|
+ state.playSource = "background"
|
|
|
+ }else{
|
|
|
+ if(state.fanSong){
|
|
|
+ state.playType = "sing"
|
|
|
+ state.playSource = "music"
|
|
|
+ }else if(state.banSong){
|
|
|
+ state.playType = "sing"
|
|
|
+ state.playSource = "background"
|
|
|
+ }else if(state.mingSong){
|
|
|
+ state.playType = "sing"
|
|
|
+ state.playSource = "mingSong"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
state.appName = "COLEXIU";
|
|
|
state.detailId = data.bizId;
|
|
|
state.xmlUrl = data.xmlFileUrl;
|
|
@@ -1401,7 +1418,7 @@ const setState = (data: any, index: number) => {
|
|
|
/**
|
|
|
* 单曲,指法根据用户当前的乐器来显示,如果没有则取musicSheetSoundList第一个track
|
|
|
*/
|
|
|
- let musicalCode = !storeData.user?.instrumentId ? data.musicSheetSoundList?.[0]?.track || '' : data.musicSheetSoundList?.find((item: any) => item?.musicalInstrumentId == storeData.user?.instrumentId)?.track || '';
|
|
|
+ let musicalCode = !storeData.user?.instrumentId ? data.musicSheetSoundList.find((item:any)=>{ return item.audioPlayType === "PLAY" })?.track || '' : data.musicSheetSoundList?.find((item: any) => item?.musicalInstrumentId == storeData.user?.instrumentId && item.audioPlayType === "PLAY")?.track || '';
|
|
|
const pitchSubject = musicalInstrumentCodeInfo.find((n) => n.code.toLocaleLowerCase() === subjectCode.toLocaleLowerCase())
|
|
|
const pitchMusical = musicalInstrumentCodeInfo.find((n) => n.code.toLocaleLowerCase() === musicalCode.toLocaleLowerCase())
|
|
|
state.subjectCodeId = pitchSubject ? pitchSubject.id : 0
|
|
@@ -1852,11 +1869,14 @@ export const refreshMusicSvg = () => {
|
|
|
watch(
|
|
|
() => state.setting.displayFingering,
|
|
|
() => {
|
|
|
- nextTick(() => {
|
|
|
- if (smoothAnimationState.osdmScrollDom) {
|
|
|
- smoothAnimationState.osdmScrollDomWith = smoothAnimationState.osdmScrollDom.offsetWidth | 0
|
|
|
- }
|
|
|
- })
|
|
|
+ // 有字符 并且是竖向指法 并且是一行谱
|
|
|
+ if(state.fingeringInfo?.name && state.fingeringInfo.direction === "vertical" && state.isSingleLine){
|
|
|
+ nextTick(() => {
|
|
|
+ if (smoothAnimationState.osdmScrollDom) {
|
|
|
+ smoothAnimationState.osdmScrollDomWith = smoothAnimationState.osdmScrollDom.offsetWidth | 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
// 如果有指法,并且是竖向指法时,切换指法时,谱面宽度变化,需要重新渲染谱面
|
|
|
if (state.fingeringInfo?.name && state.fingeringInfo.direction === "vertical" && !state.isSingleLine) {
|
|
|
headTopData.settingMode = false;
|