Skip to content

Commit

Permalink
fix: #131 修复多设备切换时播放模式显示错误问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxi committed Aug 1, 2024
1 parent a5f2fc1 commit 489f3f1
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions xiaomusic/static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,17 @@ $(function(){
.prop('selected', value === did);
$("#did").append(option);

if (cur_device.play_type == PLAY_TYPE_ALL) {
$("#play_type_all").css('background-color', '#b1a8f3');
$("#play_type_all").text('✔️ 全部循环');
} else if (cur_device.play_type == PLAY_TYPE_ONE) {
$("#play_type_one").css('background-color', '#b1a8f3');
$("#play_type_one").text('✔️ 单曲循环');
} else if (cur_device.play_type == PLAY_TYPE_RND) {
$("#play_type_rnd").css('background-color', '#b1a8f3');
$("#play_type_rnd").text('✔️ 随机播放');
if (value === did) {
if (cur_device.play_type == PLAY_TYPE_ALL) {
$("#play_type_all").css('background-color', '#b1a8f3');
$("#play_type_all").text('✔️ 全部循环');
} else if (cur_device.play_type == PLAY_TYPE_ONE) {
$("#play_type_one").css('background-color', '#b1a8f3');
$("#play_type_one").text('✔️ 单曲循环');
} else if (cur_device.play_type == PLAY_TYPE_RND) {
$("#play_type_rnd").css('background-color', '#b1a8f3');
$("#play_type_rnd").text('✔️ 随机播放');
}
}
}
});
Expand All @@ -72,6 +74,7 @@ $(function(){
localStorage.setItem('cur_did', did);
window.did = did;
console.log('cur_did', did);
location.reload();
})
});

Expand Down

0 comments on commit 489f3f1

Please sign in to comment.