From 6fdfa3dda40a6f4e1166d4603105fdb9e42095bc Mon Sep 17 00:00:00 2001 From: mtvpls Date: Tue, 9 Dec 2025 15:33:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=8D=8A=E6=98=9F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/play/page.tsx | 59 +++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/src/app/play/page.tsx b/src/app/play/page.tsx index 9e11094..f3816e5 100644 --- a/src/app/play/page.tsx +++ b/src/app/play/page.tsx @@ -3887,20 +3887,53 @@ function PlayPageClient() { {/* 星级显示 */}
{[1, 2, 3, 4, 5].map((star) => { - const filled = star <= Math.round(doubanRating.value / 2); + const starValue = doubanRating.value / 2; // 转换为5星制 + const isFullStar = star <= Math.floor(starValue); + const isHalfStar = !isFullStar && star <= Math.ceil(starValue) && starValue % 1 >= 0.25; + return ( - - - +
+ {isFullStar ? ( + // 全星 + + + + ) : isHalfStar ? ( + // 半星 + <> + {/* 空星背景 */} + + + + {/* 半星遮罩 */} + + + + + ) : ( + // 空星 + + + + )} +
); })}