From 85fe52e58ee2a4626ed473fdcbca74cd0fc98cb4 Mon Sep 17 00:00:00 2001 From: anna Date: Tue, 31 Oct 2023 16:55:35 +0800 Subject: [PATCH] fix bug --- src/pages/Payment/index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/pages/Payment/index.js b/src/pages/Payment/index.js index a0ad2d5..0eec1f3 100644 --- a/src/pages/Payment/index.js +++ b/src/pages/Payment/index.js @@ -50,12 +50,9 @@ const Index = () => { useEffect(() => { if(id<0)return; - if(location.state.amount > 0 ){ - setTotalAmount(location.state.amount) - }else{ - //fake - setTotalAmount(2000) - } + let amount = location.state?.amount??2000; + + setTotalAmount(amount) getAvailablePayment() getTransactionId() }, []);