|
@@ -1523,44 +1523,56 @@ const setState = (data: any, index: number) => {
|
|
const localStoragePlayType = localStorage.getItem("musicScorePlayType")
|
|
const localStoragePlayType = localStorage.getItem("musicScorePlayType")
|
|
if(localStoragePlayType) {
|
|
if(localStoragePlayType) {
|
|
localStorage.removeItem("musicScorePlayType")
|
|
localStorage.removeItem("musicScorePlayType")
|
|
- state.playType = localStoragePlayType as any
|
|
|
|
- }
|
|
|
|
- // 根据当前文件有没有 设置当前的播放模式
|
|
|
|
- if(state.playType === "play"){
|
|
|
|
- if(state.music){
|
|
|
|
- state.playSource = "music"
|
|
|
|
- }else if(state.accompany){
|
|
|
|
- state.playSource = "background"
|
|
|
|
|
|
+ const fields = localStoragePlayType.split(',')
|
|
|
|
+ state.playType = fields[0] as any
|
|
|
|
+ state.playSource = fields[1] as any
|
|
|
|
+ }
|
|
|
|
+ // 根据当前文件有没有 设置当前的播放模式
|
|
|
|
+ const playObj = {
|
|
|
|
+ "play_music":"music",
|
|
|
|
+ "play_background":"accompany",
|
|
|
|
+ "sing_music":"fanSong",
|
|
|
|
+ "sing_background":"banSong",
|
|
|
|
+ "sing_mingSong":"mingSong",
|
|
|
|
+ } as any
|
|
|
|
+ // 当前缓存 有值的时候 用这个,没有的时候 走筛选
|
|
|
|
+ // @ts-ignore
|
|
|
|
+ if(!state[playObj[`${state.playType}_${state.playSource}`]]){
|
|
|
|
+ if(state.playType === "play"){
|
|
|
|
+ if(state.music){
|
|
|
|
+ state.playSource = "music"
|
|
|
|
+ }else 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"
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}else{
|
|
}else{
|
|
if(state.fanSong){
|
|
if(state.fanSong){
|
|
- state.playType = "sing"
|
|
|
|
state.playSource = "music"
|
|
state.playSource = "music"
|
|
}else if(state.banSong){
|
|
}else if(state.banSong){
|
|
- state.playType = "sing"
|
|
|
|
state.playSource = "background"
|
|
state.playSource = "background"
|
|
}else if(state.mingSong){
|
|
}else if(state.mingSong){
|
|
- state.playType = "sing"
|
|
|
|
state.playSource = "mingSong"
|
|
state.playSource = "mingSong"
|
|
- }
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- if(state.fanSong){
|
|
|
|
- state.playSource = "music"
|
|
|
|
- }else if(state.banSong){
|
|
|
|
- state.playSource = "background"
|
|
|
|
- }else if(state.mingSong){
|
|
|
|
- state.playSource = "mingSong"
|
|
|
|
- }else{
|
|
|
|
- if(state.music){
|
|
|
|
- state.playType = "play"
|
|
|
|
- state.playSource = "music"
|
|
|
|
- }else if(state.accompany){
|
|
|
|
- state.playType = "play"
|
|
|
|
- state.playSource = "background"
|
|
|
|
|
|
+ }else{
|
|
|
|
+ if(state.music){
|
|
|
|
+ state.playType = "play"
|
|
|
|
+ state.playSource = "music"
|
|
|
|
+ }else if(state.accompany){
|
|
|
|
+ state.playType = "play"
|
|
|
|
+ state.playSource = "background"
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
state.appName = "COLEXIU";
|
|
state.appName = "COLEXIU";
|
|
state.detailId = data.bizId;
|
|
state.detailId = data.bizId;
|
|
state.xmlUrl = data.xmlFileUrl;
|
|
state.xmlUrl = data.xmlFileUrl;
|