From 6b173191ee37177864cd0bd0730e5665c58860b2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 13:31:58 +0000 Subject: [PATCH 1/2] Initial plan From a6dfbc4c6ef43a0ca4140104a1fe398c01bc9f30 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 13:40:11 +0000 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=92=92=E8=8A=B1?= =?UTF-8?q?=E7=89=B9=E6=95=88=E5=9C=A8=E6=AF=8F=E4=B8=AA=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E5=8F=8D=E8=BD=AC=E6=97=B6=E9=87=8D=E5=A4=8D=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=8D=A1=E9=A1=BF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将.prize样式类的添加从逐个卡片的循环中移至所有卡片动画完成后的onComplete回调中统一添加, 避免每个卡片反转都独立触发一次CSS过渡特效造成多次样式重算和重绘。 Co-authored-by: huangyiyang89 <12613485+huangyiyang89@users.noreply.github.com> --- product/src/lottery/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/product/src/lottery/index.js b/product/src/lottery/index.js index 05432bfa..f5eaed59 100644 --- a/product/src/lottery/index.js +++ b/product/src/lottery/index.js @@ -541,7 +541,6 @@ function selectCard(duration = 600) { .easing(TWEEN.Easing.Exponential.InOut) .start(); - object.element.classList.add("prize"); tag++; }); @@ -550,7 +549,10 @@ function selectCard(duration = 600) { .onUpdate(render) .start() .onComplete(() => { - // 动画结束后可以操作 + // 动画结束后统一添加特效,避免每个卡片反转都触发一次导致卡顿 + selectedCardIndex.forEach((cardIndex) => { + threeDCards[cardIndex].element.classList.add("prize"); + }); setLotteryStatus(); }); }