From 6fad4ee4875f7672779b0cb664fcae0a1cff272b Mon Sep 17 00:00:00 2001 From: hzm <934585316@qq.com> Date: Thu, 19 Mar 2026 19:47:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E5=8E=BB=E6=8E=89=E5=8A=A0?= =?UTF-8?q?=E4=BB=93=E5=BC=B9=E6=A1=86=E6=9C=80=E5=B0=8F=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/TradeModal.jsx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/app/components/TradeModal.jsx b/app/components/TradeModal.jsx index 024d26b..da3105e 100644 --- a/app/components/TradeModal.jsx +++ b/app/components/TradeModal.jsx @@ -202,7 +202,7 @@ export default function TradeModal({ type, fund, holding, onClose, onConfirm, pe }; const isValid = isBuy - ? (!!amount && !!feeRate && !!date && calcShare !== null && !loadingBuyMeta && (parseFloat(amount) || 0) >= (Number(minBuyAmount) || 0)) + ? (!!amount && !!feeRate && !!date && calcShare !== null && !loadingBuyMeta) : (!!share && !!date); const handleSetShareFraction = (fraction) => { @@ -434,9 +434,7 @@ export default function TradeModal({ type, fund, holding, onClose, onConfirm, pe
0 && (parseFloat(amount) || 0) < Number(minBuyAmount))) - ? '1px solid var(--danger)' - : '1px solid var(--border)', + border: !amount ? '1px solid var(--danger)' : '1px solid var(--border)', borderRadius: 12 }} > @@ -444,15 +442,10 @@ export default function TradeModal({ type, fund, holding, onClose, onConfirm, pe value={amount} onChange={setAmount} step={100} - min={Number(minBuyAmount) || 0} - placeholder={(Number(minBuyAmount) || 0) > 0 ? `最少 ¥${Number(minBuyAmount)},请输入加仓金额` : '请输入加仓金额'} + min={0} + placeholder="请输入加仓金额" />
- {(Number(minBuyAmount) || 0) > 0 && ( -
- 最小加仓金额:¥{Number(minBuyAmount)} -
- )}
From e5b00515d3c4520c78309d83492bc5b98c90f386 Mon Sep 17 00:00:00 2001 From: hzm <934585316@qq.com> Date: Thu, 19 Mar 2026 20:04:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E5=8A=A8=E7=94=BB=E5=BC=95=E8=B5=B7=E7=9A=84=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/GroupSummary.jsx | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/components/GroupSummary.jsx b/app/components/GroupSummary.jsx index f7c9232..6b9848d 100644 --- a/app/components/GroupSummary.jsx +++ b/app/components/GroupSummary.jsx @@ -8,6 +8,8 @@ function CountUp({ value, prefix = '', suffix = '', decimals = 2, className = '' const [displayValue, setDisplayValue] = useState(value); const previousValue = useRef(value); const isFirstChange = useRef(true); + const rafIdRef = useRef(null); + const displayValueRef = useRef(value); useEffect(() => { if (previousValue.current === value) return; @@ -15,13 +17,14 @@ function CountUp({ value, prefix = '', suffix = '', decimals = 2, className = '' if (isFirstChange.current) { isFirstChange.current = false; previousValue.current = value; + displayValueRef.current = value; setDisplayValue(value); return; } - const start = previousValue.current; + const start = displayValueRef.current; const end = value; - const duration = 400; + const duration = 300; const startTime = performance.now(); const animate = (currentTime) => { @@ -29,16 +32,25 @@ function CountUp({ value, prefix = '', suffix = '', decimals = 2, className = '' const progress = Math.min(elapsed / duration, 1); const ease = 1 - Math.pow(1 - progress, 4); const current = start + (end - start) * ease; + displayValueRef.current = current; setDisplayValue(current); if (progress < 1) { - requestAnimationFrame(animate); + rafIdRef.current = requestAnimationFrame(animate); } else { previousValue.current = value; + rafIdRef.current = null; } }; - requestAnimationFrame(animate); + rafIdRef.current = requestAnimationFrame(animate); + + return () => { + if (rafIdRef.current != null) { + cancelAnimationFrame(rafIdRef.current); + rafIdRef.current = null; + } + }; }, [value]); return (