From 016c7a3ef83b5f30c7c6c13efd94f808e37c4b98 Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Wed, 13 Dec 2023 16:06:15 +0800 Subject: [PATCH] update warnng with careOf --- src/assets/style/styles.css | 2 +- .../ListPanel/PendingPaymentTab.js | 29 ++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/assets/style/styles.css b/src/assets/style/styles.css index a7e69c8..e5738cb 100644 --- a/src/assets/style/styles.css +++ b/src/assets/style/styles.css @@ -1,4 +1,4 @@ -@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+HK|Noto+Sans+SC&display=swap'); +@import url('https://fonts.googleapis.com/css?family=Noto+Sans+HK|Noto+Sans+SC&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC&display=swap'); html, diff --git a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js index eb25df6..29c2032 100644 --- a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js +++ b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js @@ -33,7 +33,7 @@ export default function SubmittedTab({ rows }) { React.useEffect(() => { // const careOfList = rows.map(obj => obj.careOf); - console.log(rows) + // console.log(rows) // console.log(careOfList) setRowList(rows) const formattedData = rows.filter(obj => obj.careOf !== null).map((obj, index) => ({ @@ -41,12 +41,12 @@ export default function SubmittedTab({ rows }) { id: obj.id, label: obj.careOf, })); - console.log(formattedData) + // console.log(formattedData) setCareOfList(formattedData) }, []); React.useEffect(() => { - console.log(getCareOfList) + // console.log(getCareOfList) setCareOfComboList(getCareOfList) }, [getCareOfList]); @@ -198,10 +198,24 @@ export default function SubmittedTab({ rows }) { navigate('/paymentPage', { state: { amount: totalAmount, appIdList: appIdList } }); }else{ setCheckCareOf(true); - console.log("The selected applications should be from the same Care of.") + // console.log("The selected applications should be from the same Care of.") } } + function afterWarningPayment() { + let totalAmount = 0; + let appIdList = []; + const datas = rows?.filter((row) => + selectedRowItems.includes(row.id) + ); + // console.log(datas) + for (var i = 0; i < datas?.length; i++) { + totalAmount += datas[i].fee; + appIdList.push(datas[i].id); + } + navigate('/paymentPage', { state: { amount: totalAmount, appIdList: appIdList } }); + } + return ( <>
@@ -264,16 +278,17 @@ export default function SubmittedTab({ rows }) {
setCheckCareOf(false)} > - {/* 確認付款 */} + Warning - The selected applications should be from the same Care of. + You have been selected different Care of applications. Are you want to pay? - + +