From 6996a4c58a9dd20433fe28ba262382110f9db654 Mon Sep 17 00:00:00 2001 From: anna Date: Tue, 31 Oct 2023 16:49:47 +0800 Subject: [PATCH] fix bug --- src/pages/Payment/Card/index.js | 10 ++-------- src/pages/Payment/PaymentSuccess.js | 7 ++----- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/pages/Payment/Card/index.js b/src/pages/Payment/Card/index.js index afe5cff..3a5ca9a 100644 --- a/src/pages/Payment/Card/index.js +++ b/src/pages/Payment/Card/index.js @@ -40,7 +40,6 @@ const Index = () => { const [paymentData, setPaymentData] = React.useState({}); const [onReady, setOnReady] = React.useState(false); - const [redirecturl, setRedirectUrl] = React.useState(""); // const [paymentstatuscode, setPaymentstatuscode] = React.useState(""); // const [fpsqrcodeurl, setFpsqrcodeurl] = React.useState(""); // const pasgPath = 'https://fps.payapps.hkicl.com.hk'; //PRD @@ -59,15 +58,11 @@ const Index = () => { React.useEffect(() => { if (Object.keys(paymentData).length > 0){ + setOnReady(true); loadForm(); } }, [paymentData]); - React.useEffect(() => { - setOnReady(true); - }, [redirecturl]); - - const loadForm = () => { const timeoutdatetime = "2023-10-26T09:04:30Z[UTC]" const convertedDateString = timeoutdatetime.replace("[UTC]", ""); @@ -104,8 +99,7 @@ const Index = () => { "redirecturl": "" } */ - setRedirectUrl(responseData.redirecturl); - window.open(redirecturl); + window.open(responseData.redirecturl); } }); } diff --git a/src/pages/Payment/PaymentSuccess.js b/src/pages/Payment/PaymentSuccess.js index f7ad932..e7c3282 100644 --- a/src/pages/Payment/PaymentSuccess.js +++ b/src/pages/Payment/PaymentSuccess.js @@ -65,7 +65,7 @@ const Index = () => {
- 公共啟事: 付款 + 公共啟事:完成付款
@@ -73,10 +73,7 @@ const Index = () => {
- - - 公共啟事:完成付款 - + 付款成功