From 6b4555346d0769ea70cec77eb4a40148101e68b9 Mon Sep 17 00:00:00 2001 From: mtvpls Date: Thu, 9 Apr 2026 21:44:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dplay=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=85=A7=E7=89=87=E5=A2=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DetailPanel.tsx | 176 ++++++++++++++++++--------------- 1 file changed, 95 insertions(+), 81 deletions(-) diff --git a/src/components/DetailPanel.tsx b/src/components/DetailPanel.tsx index 545dcc4..97335c1 100644 --- a/src/components/DetailPanel.tsx +++ b/src/components/DetailPanel.tsx @@ -1045,95 +1045,109 @@ const DetailPanel: React.FC = ({ return { visibleItems, totalHeight, usedWidth }; }, [galleryImages, galleryScrollTop, galleryViewportHeight, galleryViewportWidth]); - const galleryModal = showGallery ? ( + const galleryBody = ( +
+ {galleryLoading && ( +
+
+
+ )} + + {!galleryLoading && galleryError && ( +
{galleryError}
+ )} + + {!galleryLoading && !galleryError && galleryImages.length === 0 && ( +
暂无图片
+ )} + + {!galleryLoading && !galleryError && galleryImages.length > 0 && ( +
+ {virtualGalleryLayout.visibleItems.map((image) => { + const imageUrl = getTMDBImageUrl( + image.file_path, + image.imageType === 'poster' ? 'w500' : 'original' + ); + const thumbUrl = getTMDBImageUrl( + image.file_path, + image.imageType === 'poster' ? 'w342' : 'w780' + ); + + return ( +
+
handleImageClick(imageUrl)} + > + +
+ {image.imageType === 'poster' ? '海报' : '剧照'} +
+
+
+ ); + })} +
+ )} +
+ ); + + const galleryHeader = ( +
+
+

照片墙

+ {!galleryLoading && ( +

+ 共 {galleryTotal} 张 +

+ )} +
+ +
+ ); + + const galleryModal = showGallery ? (useDrawer ? ( +
+
+ {galleryHeader} + {galleryBody} +
+
+ ) : (
setShowGallery(false)} />
-
-
-

照片墙

- {!galleryLoading && ( -

- 共 {galleryTotal} 张 -

- )} -
- -
- -
- {galleryLoading && ( -
-
-
- )} - - {!galleryLoading && galleryError && ( -
{galleryError}
- )} - - {!galleryLoading && !galleryError && galleryImages.length === 0 && ( -
暂无图片
- )} - - {!galleryLoading && !galleryError && galleryImages.length > 0 && ( -
- {virtualGalleryLayout.visibleItems.map((image) => { - const imageUrl = getTMDBImageUrl( - image.file_path, - image.imageType === 'poster' ? 'w500' : 'original' - ); - const thumbUrl = getTMDBImageUrl( - image.file_path, - image.imageType === 'poster' ? 'w342' : 'w780' - ); - - return ( -
-
handleImageClick(imageUrl)} - > - -
- {image.imageType === 'poster' ? '海报' : '剧照'} -
-
-
- ); - })} -
- )} -
+ {galleryHeader} + {galleryBody}
- ) : null; + )) : null; if (!isVisible || !mounted) return null;