|
@@ -1391,23 +1391,37 @@ function initMusicSource(data: any, tracks: string[], partIndex: number) {
|
|
|
let musicObj, accompanyObj, fanSongObj, banSongObj
|
|
|
/* 独奏 */
|
|
|
if (musicSheetType === "SINGLE") {
|
|
|
+ accompanyObj = musicSheetAccompanimentList.find((item: any) => {
|
|
|
+ return item.audioPlayType === "PLAY"
|
|
|
+ })
|
|
|
// 适用声部(isAllSubject)为true 时候没有乐器只有一个原音;当前用户有乐器就匹配 不然取第一个原音
|
|
|
musicObj = musicSheetSoundList.find((item: any) => {
|
|
|
return (isAllSubject || !instrumentId) ? item.audioPlayType === "PLAY" : (item.audioPlayType === "PLAY" && item.musicalInstrumentId == instrumentId)
|
|
|
})
|
|
|
// 因为可能根据学生的乐器id也找不到曲目所以尝试取第一个
|
|
|
- musicObj || (musicObj = musicSheetSoundList.find((item: any) => {
|
|
|
- return item.audioPlayType === "PLAY"
|
|
|
- }))
|
|
|
+ if(!musicObj){
|
|
|
+ musicObj = musicSheetSoundList.find((item: any) => {
|
|
|
+ return item.audioPlayType === "PLAY"
|
|
|
+ })
|
|
|
+ // 取第一个时候,不播放演奏文件切换为演唱模式 总控平台排除这个逻辑
|
|
|
+ if(!query.isCbs){
|
|
|
+ state.playType = "sing"
|
|
|
+ if(musicObj) {
|
|
|
+ musicObj.audioFileUrl = null
|
|
|
+ musicObj.audioBeatMixUrl = null
|
|
|
+ }
|
|
|
+ if(accompanyObj) {
|
|
|
+ accompanyObj.audioFileUrl = null
|
|
|
+ accompanyObj.audioBeatMixUrl = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
fanSongObj = musicSheetSoundList.find((item: any) => {
|
|
|
return item.audioPlayType === "SING"
|
|
|
})
|
|
|
banSongObj = musicSheetAccompanimentList.find((item: any) => {
|
|
|
return item.audioPlayType === "SING"
|
|
|
})
|
|
|
- accompanyObj = musicSheetAccompanimentList.find((item: any) => {
|
|
|
- return item.audioPlayType === "PLAY"
|
|
|
- })
|
|
|
track = musicObj?.track //没有原音的时候track为空 不显示指法
|
|
|
index = tracks.findIndex(item => {
|
|
|
return item === track
|