瀏覽代碼

careOf and fps update

master
Alex Cheung 1 年之前
父節點
當前提交
0ad4492726
共有 2 個檔案被更改,包括 48 行新增35 行删除
  1. +37
    -33
      src/pages/Payment/FPS/FPS.js
  2. +11
    -2
      src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js

+ 37
- 33
src/pages/Payment/FPS/FPS.js 查看文件

@@ -43,16 +43,18 @@ const Index = () => {
const [timeDownCount, setTimeDownCount] = React.useState(0); const [timeDownCount, setTimeDownCount] = React.useState(0);
const [paymentId, setPaymentId] = React.useState(""); const [paymentId, setPaymentId] = React.useState("");
const [fpsqrcodeurl, setFpsqrcodeurl] = React.useState(""); const [fpsqrcodeurl, setFpsqrcodeurl] = React.useState("");
const [browserType, setBrowserType] = React.useState("");
const mobileBrowser = "Mobile";
const desktopBrowser = "Desktop";
// const pasgPath = 'https://fps.payapps.hkicl.com.hk'; //PRD // const pasgPath = 'https://fps.payapps.hkicl.com.hk'; //PRD
// const pasgPath = 'https://sim.fps.payapps.hkicl.com.hk'; //Testing
const pasgPath = 'https://sim.fps.payapps.hkicl.com.hk'; //Testing
const loadPaymentUrl = "/api/payment/wallet/fps"; const loadPaymentUrl = "/api/payment/wallet/fps";
const cancelPaymentUrl = "/api/payment/cancelpayment"; const cancelPaymentUrl = "/api/payment/cancelpayment";
const paymentStatusApi = "/api/payment/status/"; const paymentStatusApi = "/api/payment/status/";
// const payloadUrl = "/api/payment/wallet/fps/enquiryfpspayload/"; // const payloadUrl = "/api/payment/wallet/fps/enquiryfpspayload/";
// const receiverUrl = "/noti-api/payment/payment-notification"; // const receiverUrl = "/noti-api/payment/payment-notification";
const pasgPath = 'https://sim.fps.payapps.hkicl.com.hk'; //Testing
// const pasgPath = 'https://fps.payapps.hkicl.com.hk'; //PRD

//timer //timer
const currentTimer = React.useRef(); const currentTimer = React.useRef();
const [time, setTime] = React.useState(0); const [time, setTime] = React.useState(0);
@@ -64,10 +66,10 @@ const Index = () => {
setLocationData(location.state) setLocationData(location.state)
if (/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)) { if (/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)) {
console.log('Mobile web browser'); console.log('Mobile web browser');
console.log(openPASGUrl)
// renderOpenFPSPaymentAppTemplate(openPASGUrl, $('#openFPSPaymentAppTemplate').html());
setBrowserType(mobileBrowser)
} else { } else {
console.log('Desktop web browser'); console.log('Desktop web browser');
setBrowserType(desktopBrowser)
} }
} }
}, []); }, []);
@@ -97,11 +99,11 @@ const Index = () => {
React.useEffect(() => { React.useEffect(() => {
// console.log(fpsTransctionData) // console.log(fpsTransctionData)
if(Object.keys(fpsTransctionData).length > 0 ){ if(Object.keys(fpsTransctionData).length > 0 ){
setOnReady(true);
setPaymentId(fpsTransctionData.paymentid) setPaymentId(fpsTransctionData.paymentid)
currentTimer.current = setInterval(() => { currentTimer.current = setInterval(() => {
setTime((prevTime) => prevTime + 1); setTime((prevTime) => prevTime + 1);
}, 1000); }, 1000);
setOnReady(true);
return () => clearInterval(currentTimer.current); return () => clearInterval(currentTimer.current);
} }
}, [fpsTransctionData]); }, [fpsTransctionData]);
@@ -258,32 +260,34 @@ const Index = () => {
<br /> <br />
{"$HK " + paymentData.amount} {"$HK " + paymentData.amount}
</Typography> </Typography>

<Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>
請掃描以下二維碼
<br />
<img src={fpsTransctionData.fpsqrcodeimgbase64} alt="QR Code"/>
<br />
{paymentId}
<br/>
二維碼有效期限3分鐘
<br />
請在規定時間內完成付款流程
<br />
{"剩餘時間:"+timeDownCount}
</Typography>
<Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>
<Button
component="span"
variant="contained"
size="large"
color="primary"
onClick={()=>{
mobliePayment();
}}
sx={{ m: 4 }}
>請選擇支付程式付款</Button>
</Typography>
{browserType==mobileBrowser?
<Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>
<Button
component="span"
variant="contained"
size="large"
color="primary"
onClick={()=>{
mobliePayment();
}}
sx={{ m: 4 }}
>請選擇支付程式付款</Button>
</Typography>
:
<Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>
請掃描以下二維碼
<br />
<img src={fpsTransctionData.fpsqrcodeimgbase64} alt="QR Code"/>
<br />
{paymentId}
<br/>
二維碼有效期限3分鐘
<br />
請在規定時間內完成付款流程
<br />
{"剩餘時間:"+timeDownCount}
</Typography>
}
<Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}> <Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}>
<Button <Button
component="span" component="span"


+ 11
- 2
src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js 查看文件

@@ -38,8 +38,9 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => {
backgroundColor: '#0C489E', backgroundColor: '#0C489E',
backgroundPosition: 'right' backgroundPosition: 'right'
} }
// React.useEffect(()=>{ // React.useEffect(()=>{
// setFormData(loadedData);
// loadedData.careOf = loadedData.contactPerson
// },[]); // },[]);


const formik = useFormik({ const formik = useFormik({
@@ -86,6 +87,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => {
faxNumber: values.faxNumber faxNumber: values.faxNumber
}, },
issueId: issueId, issueId: issueId,
careOf: values.careOf ? values.careOf: "",
remarks: values.remarks ? values.remarks : "", remarks: values.remarks ? values.remarks : "",
}, },
files: [attachment], files: [attachment],
@@ -223,7 +225,14 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => {
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>

<Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}>
{FieldUtils.getTextField({
label: "代理人:",
valueName: "careOf",
form: formik,
// disabled: true
})}
</Grid>
<Grid item xs={12} md={12} lg={12}> <Grid item xs={12} md={12} lg={12}>
{FieldUtils.getTextArea({ {FieldUtils.getTextArea({
label: "備註:", label: "備註:",


Loading…
取消
儲存