<>
{resolvingCount > 0 && (
)}
{/* Header */}
音乐
{musicSources.map((source) => (
))}
{(currentView === 'songs' || currentView === 'myPlaylists') && (
)}
{/* Main Content */}
{loading && (
)}
{/* Playlists View */}
{currentView === 'playlists' && !loading && (
排行榜
{getSourceLabel()}
{playlists.length > 0 ? (
{playlists.map((playlist, index) => (
))}
) : (
当前音源暂无排行榜
你可以切换其它音源,或使用上方搜索继续找歌。
)}
)}
{/* Songs View */}
{currentView === 'songs' && !loading && (
{currentPlaylistTitle}
{songs.length} 首歌曲
{songs.map((song, index) => (
playSong(song, index)}
>
{index + 1}
playSong(song, index)}
>
{song.name}
{song.artist}
playSong(song, index)}
>
{song.artist}
playSong(song, index)}
>
{getSourceLabel()}
))}
)}
{/* My Playlists View */}
{currentView === 'myPlaylists' && (
{/* Playlists List */}
歌单列表
{loadingUserPlaylists ? (
) : userPlaylists.length === 0 ? (
还没有歌单
) : (
{userPlaylists.map((playlist) => (
handleSelectUserPlaylist(playlist)}
>
{playlist.cover ? (

) : (
)}
{playlist.name}
{playlist.description && (
{playlist.description}
)}
))}
)}
{/* Playlist Songs */}
{selectedUserPlaylist ? (
{selectedUserPlaylist.name}
{selectedUserPlaylist.description && (
{selectedUserPlaylist.description}
)}
{loadingUserPlaylistSongs ? (
) : userPlaylistSongs.length === 0 ? (
歌单为空
) : (
{userPlaylistSongs.map((song, index) => (
{index + 1}
{song.pic && (

)}
{song.name}
{song.artist}
))}
)}
) : (
)}
)}
{/* Player */}
{showPlayer && currentSong && (
{/* Progress Bar */}
{/* Song Info */}
setShowLyrics(true)}
>
{currentSong.pic ? (

{
// 图片加载失败时显示默认图标
e.currentTarget.style.display = 'none';
}}
/>
) : (
)}
{currentSong.name}
{currentSong.artist}
{/* Controls */}
{/* Right Controls */}
)}
{/* Audio Element */}
{/* Lyrics Modal */}
{showLyrics && currentSong && (
{
// 点击背景关闭音量条
if (e.target === e.currentTarget) {
setShowVolumeSlider(false);
}
}}
>
setShowVolumeSlider(false)}
>
{/* Cover / Meta */}
{currentSong.pic && (
)}
{currentSong.pic ? (

) : (
)}
{currentSong.name}
{currentSong.artist}
{/* Lyrics Content */}
{lyrics.length > 0 ? (
{lyrics.map((line, index) => (
{line.text}
{line.translation && (
{line.translation}
)}
))}
) : (
)}
{/* Mini Player Controls */}
{/* 上排:播放控制按钮 */}
{/* 下排:其他按钮(小一号) */}
{/* 音量控制 */}
setShowVolumeSlider(true)}
onMouseLeave={() => setShowVolumeSlider(false)}
>
{/* 垂直音量条 - 桌面悬浮/移动端点击 */}
{/* PiP 歌词按钮 */}
{/* 添加到歌单按钮 */}
{/* 进度条 */}
{showSpectrum && (
)}
{formatTime(currentTime)}
{formatTime(duration)}
)}
{/* Playlist Modal */}
{showPlaylist && (
{/* Header */}
播放列表
({playlist.length})
{playlist.length > 0 && (
)}
{/* Playlist */}
{playlist.length > 0 ? (
{playlist.map((song, index) => (
{
setPlaylistIndex(index);
playSong(song, -1);
setShowPlaylist(false);
}}
className="flex items-center gap-3 flex-1 min-w-0 cursor-pointer"
>
{song.pic ? (

) : (
)}
{song.name}
{song.artist}
{index === playlistIndex ? (
) : (
)}
))}
) : (
)}
)}
{/* Quality Selection Menu */}
{showQualityMenu && (
setShowQualityMenu(false)}
>
e.stopPropagation()}
>
{/* Header */}
选择音质
{/* Quality Options */}
{/* Cancel Button */}
)}
{showSourceMenu && (
)}
{/* Add to Playlist Modal */}
{
setShowAddToPlaylistModal(false);
setSongToAddToPlaylist(null);
}}
onSuccess={() => {
setToast({
message: '已添加到歌单',
type: 'success',
onClose: () => setToast(null),
});
}}
onError={(message) => {
setToast({
message,
type: 'error',
onClose: () => setToast(null),
});
}}
/>
{/* Toast */}
{toast && }
{/* Confirm Modal */}
{confirmModal.isOpen &&
createPortal(
e.stopPropagation()}
>
取消
{deletingPlaylistId !== null ? (
<>
删除中...
>
) : (
'确定'
)}
,
document.body
)}
{/* PiP Lyrics Window */}
{showPiPLyrics && (
{
setPipOpacity(opacity);
localStorage.setItem('lyricsPiPOpacity', opacity.toString());
}}
onMinimizedChange={(minimized) => {
setPipMinimized(minimized);
localStorage.setItem('lyricsPiPMinimized', minimized.toString());
}}
onClose={() => setShowPiPLyrics(false)}
/>
)}
>
);
}