@@ -9,6 +9,7 @@ import { | |||
import * as React from "react"; | |||
import * as FormatUtils from "utils/FormatUtils"; | |||
import * as PaymentStatus from "utils/statusUtils/PaymentStatus"; | |||
import * as DateUtils from "utils/DateUtils"; | |||
import Loadable from 'components/Loadable'; | |||
const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); | |||
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | |||
@@ -89,7 +90,7 @@ const PaymentDetails = ({ formData,doPrint,onDownload }) => { | |||
</Grid> | |||
<Grid item xs={6} md={5} sx={{ml:5, textAlign: "left" }}> | |||
<FormLabel sx={{ color: "#000000" }}> | |||
{data.transDateStr + " (DD/MM/YYYY)"} | |||
{DateUtils.dateFormat(data.transDateStr, intl.formatMessage({id: "dateStrFormat"})) +" ("+intl.formatMessage({id: "dateStrFormat"})+")"} | |||
</FormLabel> | |||
</Grid> | |||
</Grid> | |||
@@ -77,7 +77,7 @@ const Index = () => { | |||
if (!responseData.data?.id) { | |||
navigate("/paymentPage/search"); | |||
} | |||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "DD/MM/YYYY"); | |||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||
responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | |||
setItemList(responseData.paymentItemList) | |||
setRecord(responseData.data); | |||
@@ -9,6 +9,7 @@ import { | |||
import * as React from "react"; | |||
import * as FormatUtils from "utils/FormatUtils"; | |||
import * as PaymentStatus from "utils/statusUtils/PaymentStatus"; | |||
import * as DateUtils from "utils/DateUtils"; | |||
import Loadable from 'components/Loadable'; | |||
const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); | |||
const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | |||
@@ -24,30 +25,56 @@ const PaymentDetails = ({ formData,doPrint,onDownload }) => { | |||
React.useEffect(() => { | |||
if (formData != null && formData != undefined && Object.keys(formData).length > 0) { | |||
console.log(formData) | |||
// console.log(formData) | |||
setData(formData); | |||
} | |||
}, [formData]); | |||
React.useEffect(() => { | |||
if (data != null && data != undefined && Object.keys(data).length > 0) { | |||
console.log(data) | |||
// console.log(data) | |||
setOnReady(data != {}); | |||
} | |||
}, [data]); | |||
const getPaymentMethod=()=>{ | |||
let paymentmethod = "" | |||
// console.log(locale) | |||
if (data?.payload!=null) { | |||
paymentmethod = data.payload?.paymentdetail.paymentmethod; | |||
if("01" == paymentmethod) return "PPS"; | |||
if("02" == paymentmethod || "03" == paymentmethod) return "Credit Card"; | |||
if("04" == paymentmethod) return "FPS"; | |||
if (locale == "zh-HK"){ | |||
if("01" == paymentmethod) return "PPS"; | |||
if("02" == paymentmethod || "03" == paymentmethod) return "信用卡"; | |||
if("04" == paymentmethod) return "FPS"; | |||
} | |||
else if (locale == "zh-CN"){ | |||
if("01" == paymentmethod) return "PPS"; | |||
if("02" == paymentmethod || "03" == paymentmethod) return "信用卡"; | |||
if("04" == paymentmethod) return "FPS"; | |||
} | |||
else { | |||
if("01" == paymentmethod) return "PPS"; | |||
if("02" == paymentmethod || "03" == paymentmethod) return "Credit Card"; | |||
if("04" == paymentmethod) return "FPS"; | |||
} | |||
} else { | |||
paymentmethod = data.payMethod; | |||
if("01,PPSB,PPS" == paymentmethod) return "PPS"; | |||
if("02,BCMP,CreditCard" == paymentmethod || "03,BCMP,CreditCard" == paymentmethod) return "Credit Card"; | |||
if("04,BCFP,FPS" == paymentmethod) return "FPS"; | |||
if (locale == "zh-HK"){ | |||
if("01,PPSB,PPS" == paymentmethod) return "PPS"; | |||
if("02,BCMP,CreditCard" == paymentmethod || "03,BCMP,CreditCard" == paymentmethod) return "信用卡"; | |||
if("04,BCFP,FPS" == paymentmethod) return "FPS"; | |||
} | |||
else if (locale == "zh-CN"){ | |||
if("01,PPSB,PPS" == paymentmethod) return "PPS"; | |||
if("02,BCMP,CreditCard" == paymentmethod || "03,BCMP,CreditCard" == paymentmethod) return "信用卡"; | |||
if("04,BCFP,FPS" == paymentmethod) return "FPS"; | |||
} | |||
else { | |||
if("01,PPSB,PPS" == paymentmethod) return "PPS"; | |||
if("02,BCMP,CreditCard" == paymentmethod || "03,BCMP,CreditCard" == paymentmethod) return "Credit Card"; | |||
if("04,BCFP,FPS" == paymentmethod) return "FPS"; | |||
} | |||
} | |||
return paymentmethod; | |||
} | |||
@@ -109,7 +136,7 @@ const PaymentDetails = ({ formData,doPrint,onDownload }) => { | |||
</Grid> | |||
<Grid item xs={6} md={6} sx={{textAlign: "left" }}> | |||
<FormLabel sx={{ fontSize: "16px", color: "#000000" }}> | |||
{data.transDateStr + " (DD/MM/YYYY)"} | |||
{DateUtils.dateFormat(data.transDateStr, intl.formatMessage({id: "dateStrFormat"})) +" ("+intl.formatMessage({id: "dateStrFormat"})+")"} | |||
</FormLabel> | |||
</Grid> | |||
</Grid> | |||
@@ -59,9 +59,9 @@ const Index = () => { | |||
React.useEffect(() => { | |||
if (Object.keys(transactionData).length > 0) { | |||
console.log(transactionData) | |||
console.log(itemList) | |||
console.log(record) | |||
// console.log(transactionData) | |||
// console.log(itemList) | |||
// console.log(record) | |||
setOnReady(true); | |||
} | |||
}, [transactionData]); | |||
@@ -102,21 +102,21 @@ const Index = () => { | |||
"paymentId": params.id | |||
}, | |||
onSuccess: function(responseData2){ | |||
responseData2.data["transDateStr"] = DateUtils.dateFormat(responseData2.data.transDateTime, "DD/MM/YYYY"); | |||
responseData2.data["transDateStr"] = DateUtils.dateFormat(responseData2.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||
responseData2.data["transTimeStr"] = DateUtils.dateFormat(responseData2.data.transDateTime, "HH:mm:ss"); | |||
setResponeData(responseData2.transactionData) | |||
setItemList(responseData2.paymentItemList) | |||
setRecord(responseData2.data); | |||
}, | |||
onError: function(){ | |||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "DD/MM/YYYY"); | |||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||
responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | |||
setResponeData(responseData) | |||
} | |||
}); | |||
}else{ | |||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "DD/MM/YYYY"); | |||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||
responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | |||
setResponeData(responseData) | |||
setItemList(responseData.paymentItemList) | |||
@@ -104,7 +104,7 @@ const AckPage = () => { | |||
onSuccess: function(responseData){ | |||
localStorage.removeItem("webtoken"); | |||
localStorage.removeItem("transactionid"); | |||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "DD/MM/YYYY"); | |||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||
responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | |||
setResponeDataData(responseData.transactionData) | |||
setItemList(responseData.paymentItemList) | |||
@@ -99,7 +99,7 @@ const Fpscallback = () => { | |||
localStorage.removeItem("webtoken"); | |||
localStorage.removeItem("transactionid"); | |||
} | |||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "DD/MM/YYYY"); | |||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||
responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | |||
setResponeDataData(responseData.transactionData) | |||
setItemList(responseData.paymentItemList) | |||
@@ -123,7 +123,7 @@ const Index = () => { | |||
localStorage.removeItem("webtoken"); | |||
localStorage.removeItem("transactionid"); | |||
} | |||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "DD/MM/YYYY"); | |||
responseData.data["transDateStr"] = DateUtils.dateFormat(responseData.data.transDateTime, intl.formatMessage({id: "dateStrFormat"})); | |||
responseData.data["transTimeStr"] = DateUtils.dateFormat(responseData.data.transDateTime, "HH:mm:ss"); | |||
setResponeDataData(responseData.transactionData) | |||
setItemList(responseData.paymentItemList) | |||
@@ -696,10 +696,10 @@ const FormPanel = ({ formData }) => { | |||
</DialogContent> | |||
<DialogActions> | |||
<Button | |||
aria-label={intl.formatMessage({ id: 'ok' })} | |||
aria-label={intl.formatMessage({ id: 'close' })} | |||
onClick={() => setIsWarningPopUp(false)} | |||
> | |||
<FormattedMessage id="ok" /> | |||
<FormattedMessage id="close" /> | |||
</Button> | |||
</DialogActions> | |||
</Dialog> | |||
@@ -623,7 +623,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||
</DialogContent> | |||
<DialogActions> | |||
<Button | |||
aria-label={intl.formatMessage({ id: 'ok' })} | |||
aria-label={intl.formatMessage({ id: 'close' })} | |||
onClick={() => { | |||
if (val.contactPerson) { | |||
apply(val); | |||
@@ -636,7 +636,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections, gazetteIssueList }) => | |||
} | |||
}} | |||
> | |||
<FormattedMessage id="ok" /> | |||
<FormattedMessage id="close" /> | |||
</Button> | |||
</DialogActions> | |||
</Dialog> | |||