From 2b5f998ab384526738395c3cf02ccf88364e7e3d Mon Sep 17 00:00:00 2001 From: hzm <934585316@qq.com> Date: Mon, 9 Feb 2026 10:49:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=AF=B9=20funds=20?= =?UTF-8?q?=E7=9A=84=E5=90=8C=E6=AD=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/page.jsx | 138 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 82 insertions(+), 56 deletions(-) diff --git a/app/page.jsx b/app/page.jsx index daf173d..15173cb 100644 --- a/app/page.jsx +++ b/app/page.jsx @@ -281,7 +281,7 @@ function TradeModal({ type, fund, holding, onClose, onConfirm, pendingTrades = [ }); const [isAfter3pm, setIsAfter3pm] = useState(nowInTz().hour() >= 15); const [calcShare, setCalcShare] = useState(null); - + const currentPendingTrades = useMemo(() => { return pendingTrades.filter(t => t.fundCode === fund?.code); }, [pendingTrades, fund]); @@ -302,7 +302,7 @@ function TradeModal({ type, fund, holding, onClose, onConfirm, pendingTrades = [ setShowPendingList(false); } }, [showPendingList, currentPendingTrades]); - + const getEstimatePrice = () => fund?.estPricedCoverage > 0.05 ? fund?.estGsz : (typeof fund?.gsz === 'number' ? fund?.gsz : Number(fund?.dwjz)); const [price, setPrice] = useState(getEstimatePrice()); const [loadingPrice, setLoadingPrice] = useState(false); @@ -312,7 +312,7 @@ function TradeModal({ type, fund, holding, onClose, onConfirm, pendingTrades = [ if (date && fund?.code) { setLoadingPrice(true); setActualDate(null); - + let queryDate = date; if (isAfter3pm) { queryDate = toTz(date).add(1, 'day').format('YYYY-MM-DD'); @@ -347,7 +347,7 @@ function TradeModal({ type, fund, holding, onClose, onConfirm, pendingTrades = [ } else { sellFee = parseFloat(feeValue) || 0; } - + const estimatedReturn = sellAmount - sellFee; useEffect(() => { @@ -390,7 +390,7 @@ function TradeModal({ type, fund, holding, onClose, onConfirm, pendingTrades = [ const isValid = isBuy ? (!!amount && !!feeRate && !!date && calcShare !== null) : (!!share && !!date); - + const handleSetShareFraction = (fraction) => { if(availableShare > 0) { setShare((availableShare * fraction).toFixed(2)); @@ -429,12 +429,12 @@ function TradeModal({ type, fund, holding, onClose, onConfirm, pendingTrades = [ {!showPendingList && !showConfirm && currentPendingTrades.length > 0 && ( -