diff --git a/src/assets/style/styles.css b/src/assets/style/styles.css index 20a98d1..a7e69c8 100644 --- a/src/assets/style/styles.css +++ b/src/assets/style/styles.css @@ -29,4 +29,21 @@ input[type=number] { } */ /* main{ padding-top: 43px; -} */ \ No newline at end of file +} */ + +img +{ + -webkit-transition: all 0.2s +} +/*Filter styles*/ +.saturate {-webkit-filter: saturate(3);} +.grayscale {-webkit-filter: grayscale(100%) brightness(1.5);} +.contrast {-webkit-filter: contrast(10%);} +.brightness {-webkit-filter: brightness(1.2);} +.blur {-webkit-filter: blur(3px);} +.invert {-webkit-filter: invert(100%);} +.sepia {-webkit-filter: sepia(100%);} +.huerotate {-webkit-filter: hue-rotate(180deg);} +.rss.opacity {-webkit-filter: opacity(50%);} + +img:hover{-webkit-filter:none;} \ No newline at end of file diff --git a/src/pages/Payment/index.js b/src/pages/Payment/index.js index 73d2079..2e88455 100644 --- a/src/pages/Payment/index.js +++ b/src/pages/Payment/index.js @@ -69,13 +69,13 @@ const Index = () => { setTotalAmount(location.state?.amount ?? 2000) getAvailablePayment() getTransactionId() - + }, []); - useEffect(()=>{ - if(appIds!=[] && appIds.length>0) + useEffect(() => { + if (appIds != [] && appIds.length > 0) getAppList(); - },[appIds]); + }, [appIds]); // const handleClose = () => { // // handleReset() @@ -346,16 +346,16 @@ const Index = () => { } useEffect(() => { - if(availableMethods.length > 0 && Object.keys(transactionData).length > 0){ + if (availableMethods.length > 0 && Object.keys(transactionData).length > 0) { setOnReady(true) } - }, [transactionData,availableMethods]); + }, [transactionData, availableMethods]); const getAppList = () => { HttpUtils.post({ url: UrlUtils.PAYMENT_APP_LIST, - params:{ - appIds:appIds + params: { + appIds: appIds }, onSuccess: (responseData) => { setItemList(responseData) @@ -363,14 +363,18 @@ const Index = () => { }); } - const selectedPaymentMethodHandle = (method) => () =>{ + const selectedPaymentMethodHandle = (method) => () => { setSelectedPaymentMethod(method); }; - - const confirmPaymentHandle = () => () =>{ - setConfirmPayment(true); + + const confirmPaymentHandle = () => () => { + setConfirmPayment(true); }; + const getMethodImgClass = (method) => { + return selectedPaymentMethod == method || selectedPaymentMethod == "" ? "" : "grayscale"; + } + return ( @@ -381,9 +385,9 @@ const Index = () => { {/*row 1*/} - + - + { 交易參考號: {transactionData.transactionid} - + 支付金額: HK$ {FormatUtils.currencyFormat(totalAmount)} @@ -415,86 +419,87 @@ const Index = () => { - - - 付款金額: - - - - - {"HK$ "+FormatUtils.currencyFormat(totalAmount)} - - + + + 付款金額: + + + + + {"HK$ " + FormatUtils.currencyFormat(totalAmount)} + + - {availableMethods.length > 0? + + {availableMethods.length > 0 ? !onReady ? - : + : - - 請選擇付款方式: + + 請選擇付款方式: - {selectedPaymentMethod !=""? + {selectedPaymentMethod != "" ? - - 已選擇付款方式: + + 已選擇付款方式: - + {selectedPaymentMethod} - : null} + : null} - : - - + : + + 付款功能現在不可用。 - - + + } - + {/*