From f445cdf54674f82dbbc93900af6a0f0d2ac39b2f Mon Sep 17 00:00:00 2001 From: mtvpls Date: Sat, 9 May 2026 10:33:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9F=B3=E4=B9=90=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=8A=A0=E8=BD=BD=E6=8C=87=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/music/page.tsx | 67 +++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 17 deletions(-) diff --git a/src/app/music/page.tsx b/src/app/music/page.tsx index 15cbb45..0bd1368 100644 --- a/src/app/music/page.tsx +++ b/src/app/music/page.tsx @@ -60,6 +60,38 @@ interface DbRecord { songmid?: string; } +function MusicLoadingIndicator({ + text, + size = 'md', + className = '', +}: { + text?: string; + size?: 'sm' | 'md'; + className?: string; +}) { + const iconSize = size === 'sm' ? 'w-4 h-4' : 'w-5 h-5'; + const textSize = size === 'sm' ? 'text-xs' : 'text-sm'; + + return ( +
+
+ {[0, 1, 2].map((index) => ( + + + + ))} +
+ {text ? {text} : null} +
+ ); +} + // 扩展 Window 接口以支持 Document PiP API declare global { interface Window { @@ -1499,6 +1531,19 @@ export default function MusicPage() { return (
<> + {resolvingCount > 0 && (
@@ -1620,7 +1665,7 @@ export default function MusicPage() {
{loading && ( -
加载中...
+ )} {/* Playlists View */} @@ -1688,13 +1733,7 @@ export default function MusicPage() { className="px-3 py-1.5 bg-green-600 hover:bg-green-700 disabled:bg-zinc-700 disabled:cursor-not-allowed rounded-lg transition-colors flex items-center gap-2 text-sm text-white shrink-0" > {loadingCurrentPlayAll ? ( - <> - - - - - 处理中... - + ) : ( <> @@ -1775,7 +1814,7 @@ export default function MusicPage() {

歌单列表

{loadingUserPlaylists ? ( -
加载中...
+ ) : userPlaylists.length === 0 ? (
还没有歌单 @@ -1845,13 +1884,7 @@ export default function MusicPage() { className="px-4 py-2 bg-green-600 hover:bg-green-700 disabled:bg-zinc-700 disabled:cursor-not-allowed rounded-lg transition-colors flex items-center gap-2" > {loadingPlayAll ? ( - <> - - - - - 加载中... - + ) : ( <> @@ -1882,7 +1915,7 @@ export default function MusicPage() {
{loadingUserPlaylistSongs ? ( -
加载中...
+ ) : userPlaylistSongs.length === 0 ? (
歌单为空
) : (