Преглед на файлове

update gmfis get by credit day and loayout update

master
Alex Cheung преди 1 година
родител
ревизия
d8e062c84a
променени са 6 файла, в които са добавени 236 реда и са изтрити 211 реда
  1. +9
    -9
      src/pages/GFMIS/SearchForm.js
  2. +5
    -4
      src/pages/GFMIS/index.js
  3. +10
    -2
      src/pages/Payment/MultiPaymentWindow.js
  4. +154
    -151
      src/pages/Payment/index.js
  5. +1
    -1
      src/pages/authentication/ForgotUsername/ForgotUsernameApplyForm.js
  6. +57
    -44
      src/pages/authentication/auth-forms/AuthLoginCustom.js

+ 9
- 9
src/pages/GFMIS/SearchForm.js Целия файл

@@ -8,7 +8,7 @@ import {
import MainCard from "components/MainCard";
import { useForm } from "react-hook-form";
import * as React from "react";
import * as DateUtils from "utils/DateUtils";
// import * as DateUtils from "utils/DateUtils";
import {PNSPS_BUTTON_THEME} from "../../themes/buttonConst";
import {ThemeProvider} from "@emotion/react";
// import * as ComboData from "utils/ComboData";
@@ -17,8 +17,8 @@ import {ThemeProvider} from "@emotion/react";

const SearchPublicNoticeForm = ({ applySearch, generateXML, searchCriteria }) => {

const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom);
const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo);
// const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom);
const [maxDate] = React.useState(searchCriteria.dateFrom);
// const [status, setStatus] = React.useState(ComboData.paymentStatus[0]);

const { register, handleSubmit, getValues } = useForm()
@@ -71,12 +71,12 @@ const SearchPublicNoticeForm = ({ applySearch, generateXML, searchCriteria }) =>
{...register("dateFrom")}
id="dateFrom"
type="date"
label="From"
label="Credit Date"
defaultValue={searchCriteria.dateFrom}
InputProps={{ inputProps: { max: maxDate } }}
onChange={(newValue) => {
setMinDate(DateUtils.dateStr(newValue));
}}
// onChange={(newValue) => {
// setMinDate(DateUtils.dateStr(newValue));
// }}
InputLabelProps={{
shrink: true
}}
@@ -84,7 +84,7 @@ const SearchPublicNoticeForm = ({ applySearch, generateXML, searchCriteria }) =>
</Grid>

<Grid item xs={9} s={6} md={4} lg={4} sx={{ ml: 3, mr: 3, mb: 3 }}>
<TextField
{/* <TextField
fullWidth
InputLabelProps={{
shrink: true
@@ -98,7 +98,7 @@ const SearchPublicNoticeForm = ({ applySearch, generateXML, searchCriteria }) =>
type="date"
label="To"
defaultValue={searchCriteria.dateTo}
/>
/> */}
</Grid>

{/* <Grid item xs={9} s={6} md={4} lg={3}>


+ 5
- 4
src/pages/GFMIS/index.js Целия файл

@@ -32,8 +32,8 @@ const Index = () => {

const [record,setRecord] = React.useState([]);
const [searchCriteria, setSearchCriteria] = React.useState({
dateTo: DateUtils.dateStr(new Date()),
dateFrom: DateUtils.dateStr(new Date().setDate(new Date().getDate()-14)),
dateFrom: DateUtils.dateStr(new Date()),
// dateFrom: DateUtils.dateStr(new Date().setDate(new Date().getDate()-14)),
});
const [onReady, setOnReady] = React.useState(false);

@@ -60,7 +60,8 @@ const Index = () => {
// console.log(input)
HttpUtils.get({
url: UrlUtils.GEN_GFMIS_XML + "/today",
params:{dateTo: input.dateTo,
params:{
// dateTo: input.dateTo,
dateFrom: input.dateFrom,
},
onSuccess: (responseData) => {
@@ -122,7 +123,7 @@ const Index = () => {
!onReady ?
<LoadingComponent/>
:
<Grid container sx={{ backgroundColor: 'backgroundColor.default'}} direction="column">
<Grid container sx={{minHeight: '95vh', backgroundColor: 'backgroundColor.default'}} direction="column">
<Grid item xs={12}>
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">


+ 10
- 2
src/pages/Payment/MultiPaymentWindow.js Целия файл

@@ -3,6 +3,7 @@ import {
useState
} from "react";
import * as React from "react";
import {getBowserType} from "auth/utils";

// material-ui
import {
@@ -111,8 +112,15 @@ const MultiPaymentWindow = (props) => {
}, [paymentMethod]);

const selectedPaymentMethodHandle = (method) => () =>{
setPaymentMethod(method)
props.setSelectedPaymentMethod(method);
console.log(getBowserType())
if (getBowserType() === "PC_Browser"){
setPaymentMethod(method)
props.setSelectedPaymentMethod(method);
}
if (getBowserType() !== "PC_Browser" && method !== "PPS"){
setPaymentMethod(method)
props.setSelectedPaymentMethod(method);
}
};

const confirmPaymentHandle = () => () =>{


+ 154
- 151
src/pages/Payment/index.js Целия файл

@@ -23,7 +23,10 @@ import {
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
import {ThemeProvider} from "@emotion/react";
import {PNSPS_BUTTON_THEME} from "../../themes/buttonConst";
import {FormattedMessage,useIntl} from "react-intl";
import {
FormattedMessage,
// useIntl
} from "react-intl";
const BackgroundHead = {
backgroundImage: `url(${titleBackgroundImg})`,
width: '100%',
@@ -35,15 +38,15 @@ const BackgroundHead = {
}

const Index = () => {
const getAvailablePaymentUrl = "/api/payment/availability";
// const getAvailablePaymentUrl = "/api/payment/availability";
const getTransactionIdUrl = "/api/payment/transaction";
const navigate = useNavigate()
const location = useLocation();
const intl = useIntl();
const { locale } = intl;
// const intl = useIntl();
// const { locale } = intl;

const local = {en:"en-us", zh:"zh-hk", cn:"zh-cn"};
const preferpaymentmethods = ['visa', 'mastercard', 'pps', 'creditcard', 'fps'];
// const local = {en:"en-us", zh:"zh-hk", cn:"zh-cn"};
// const preferpaymentmethods = ['visa', 'mastercard', 'pps', 'creditcard', 'fps'];
const [totalAmount, setTotalAmount] = useState(0);
const [appIds, setAppIds] = useState([]);

@@ -151,153 +154,153 @@ const Index = () => {
}, [afterConfirmPayment]);

const getAvailablePayment = () =>{
HttpUtils.post({
url: paymentPath + getAvailablePaymentUrl,
params: {
"locale": locale === 'en' ?local.en:locale === 'zh-HK' ?local.zh:local.cn,
"amount": totalAmount,
// "eserviceids": [
// "<eserviceid>", "<eserviceid>"
// ],
"preferpaymentmethods": preferpaymentmethods
},
onSuccess: (responseData) => {
let availableMethods = responseData.availablepaymentmethods;
setAvailableMethods(availableMethods);
// HttpUtils.post({
// url: paymentPath + getAvailablePaymentUrl,
// params: {
// "locale": locale === 'en' ?local.en:locale === 'zh-HK' ?local.zh:local.cn,
// "amount": totalAmount,
// // "eserviceids": [
// // "<eserviceid>", "<eserviceid>"
// // ],
// "preferpaymentmethods": preferpaymentmethods
// },
// onSuccess: (responseData) => {
// let availableMethods = responseData.availablepaymentmethods;
// setAvailableMethods(availableMethods);

},
onError: () =>{
setOnReady(true)
}
});
// },
// onError: () =>{
// setOnReady(true)
// }
// });
// const responseData = {
// "availablepaymentmethods": [
// {
// "active": "Y",
// "code": "04,BCFP,FPS",
// "pointstonote": [
// {
// "content": "Please take note of the transaction reference number or PRINT this page for making enquiry on the payment status when necessary.",
// "order": 10,
// "type": "INFO"
// },
// {
// "content": "After pressing the 'Pay' button, please DO NOT leave this e-service until you receive the acknowledgement page, otherwise your transaction may not be successful.",
// "order": 11,
// "type": "INFO"
// }
// ],
// "subtype": "FPS"
// },
// {
// "active": "Y",
// "code": "02,BCMP,CreditCard",
// "pointstonote": [
// {
// "content": "Please take note of the transaction reference number or PRINT this page for making enquiry on the payment status when necessary.",
// "order": 10,
// "type": "INFO"
// },
// {
// "content": "After pressing the 'Pay' button, please DO NOT leave this e-service until you receive the acknowledgement page, otherwise your transaction may not be successful.",
// "order": 11,
// "type": "INFO"
// },
// {
// "content": "Merchant Name is applicable to credit card payment method only.",
// "order": 40,
// "type": "INFO"
// },
// {
// "content": "Under exceptional conditions, a refund may need to be arranged. If the payment is made by Credit Card, the refund can normally be made to the Credit Card account that is used for the payment.",
// "order": 41,
// "type": "INFO"
// },
// {
// "content": "Some users may receive an error page or have to wait for several minutes before they get a response from the credit card payment gateway. If you experience such a problem, please wait a moment and retry, or change to use other available payment methods. We apologise for any inconvenience caused.",
// "order": 42,
// "type": "INFO"
// },
// {
// "content": "Different credit card issuers may have implemented different mechanisms to authenticate the cardholder's identity during online payment. Please contact your card issuer if you want to learn more about the J/Secure, MasterCard SecureCode and Verified by Visa service. ",
// "order": 43,
// "type": "INFO"
// }
// ],
// "subtype": "CreditCard",
// "supportedcard": [
// "JCB",
// "MasterCard",
// "Visa"
// ]
// },
// {
// "active": "Y",
// "code": "03,BCMP,CreditCard",
// "pointstonote": [
// {
// "content": "Please take note of the transaction reference number or PRINT this page for making enquiry on the payment status when necessary.",
// "order": 10,
// "type": "INFO"
// },
// {
// "content": "After pressing the 'Pay' button, please DO NOT leave this e-service until you receive the acknowledgement page, otherwise your transaction may not be successful.",
// "order": 11,
// "type": "INFO"
// },
// {
// "content": "Merchant Name is applicable to credit card payment method only.",
// "order": 40,
// "type": "INFO"
// },
// {
// "content": "Under exceptional conditions, a refund may need to be arranged. If the payment is made by Credit Card, the refund can normally be made to the Credit Card account that is used for the payment.",
// "order": 41,
// "type": "INFO"
// },
// {
// "content": "Some users may receive an error page or have to wait for several minutes before they get a response from the credit card payment gateway. If you experience such a problem, please wait a moment and retry, or change to use other available payment methods. We apologise for any inconvenience caused.",
// "order": 42,
// "type": "INFO"
// },
// {
// "content": "Different credit card issuers may have implemented different mechanisms to authenticate the cardholder's identity during online payment. Please contact your card issuer if you want to learn more about the J/Secure, MasterCard SecureCode and Verified by Visa service. ",
// "order": 43,
// "type": "INFO"
// }
// ],
// "subtype": "CreditCard",
// "supportedcard": [
// "UnionPay"
// ]
// },
// {
// "active": "Y",
// "code": "01,PPSB,PPS",
// "pointstonote": [
// {
// "content": "Please take note of the transaction reference number or PRINT this page for making enquiry on the payment status when necessary.",
// "order": 10,
// "type": "INFO"
// },
// {
// "content": "After pressing the 'Pay' button, please DO NOT leave this e-service until you receive the acknowledgement page, otherwise your transaction may not be successful.",
// "order": 11,
// "type": "INFO"
// },
// {
// "content": "PPS Shop&Buy (PPS) does not support payment via browsers of mobile devices (including mobile phones and tablets) at the moment. If you wish to pay by PPS, please change to use desktop computer. ",
// "order": 21,
// "type": "INFO"
// }
// ],
// "subtype": "PPS"
// }
// ]
// };
// let availableMethods = responseData.availablepaymentmethods;
// setAvailableMethods(availableMethods);
const responseData = {
"availablepaymentmethods": [
{
"active": "Y",
"code": "04,BCFP,FPS",
"pointstonote": [
{
"content": "Please take note of the transaction reference number or PRINT this page for making enquiry on the payment status when necessary.",
"order": 10,
"type": "INFO"
},
{
"content": "After pressing the 'Pay' button, please DO NOT leave this e-service until you receive the acknowledgement page, otherwise your transaction may not be successful.",
"order": 11,
"type": "INFO"
}
],
"subtype": "FPS"
},
{
"active": "Y",
"code": "02,BCMP,CreditCard",
"pointstonote": [
{
"content": "Please take note of the transaction reference number or PRINT this page for making enquiry on the payment status when necessary.",
"order": 10,
"type": "INFO"
},
{
"content": "After pressing the 'Pay' button, please DO NOT leave this e-service until you receive the acknowledgement page, otherwise your transaction may not be successful.",
"order": 11,
"type": "INFO"
},
{
"content": "Merchant Name is applicable to credit card payment method only.",
"order": 40,
"type": "INFO"
},
{
"content": "Under exceptional conditions, a refund may need to be arranged. If the payment is made by Credit Card, the refund can normally be made to the Credit Card account that is used for the payment.",
"order": 41,
"type": "INFO"
},
{
"content": "Some users may receive an error page or have to wait for several minutes before they get a response from the credit card payment gateway. If you experience such a problem, please wait a moment and retry, or change to use other available payment methods. We apologise for any inconvenience caused.",
"order": 42,
"type": "INFO"
},
{
"content": "Different credit card issuers may have implemented different mechanisms to authenticate the cardholder's identity during online payment. Please contact your card issuer if you want to learn more about the J/Secure, MasterCard SecureCode and Verified by Visa service. ",
"order": 43,
"type": "INFO"
}
],
"subtype": "CreditCard",
"supportedcard": [
"JCB",
"MasterCard",
"Visa"
]
},
{
"active": "Y",
"code": "03,BCMP,CreditCard",
"pointstonote": [
{
"content": "Please take note of the transaction reference number or PRINT this page for making enquiry on the payment status when necessary.",
"order": 10,
"type": "INFO"
},
{
"content": "After pressing the 'Pay' button, please DO NOT leave this e-service until you receive the acknowledgement page, otherwise your transaction may not be successful.",
"order": 11,
"type": "INFO"
},
{
"content": "Merchant Name is applicable to credit card payment method only.",
"order": 40,
"type": "INFO"
},
{
"content": "Under exceptional conditions, a refund may need to be arranged. If the payment is made by Credit Card, the refund can normally be made to the Credit Card account that is used for the payment.",
"order": 41,
"type": "INFO"
},
{
"content": "Some users may receive an error page or have to wait for several minutes before they get a response from the credit card payment gateway. If you experience such a problem, please wait a moment and retry, or change to use other available payment methods. We apologise for any inconvenience caused.",
"order": 42,
"type": "INFO"
},
{
"content": "Different credit card issuers may have implemented different mechanisms to authenticate the cardholder's identity during online payment. Please contact your card issuer if you want to learn more about the J/Secure, MasterCard SecureCode and Verified by Visa service. ",
"order": 43,
"type": "INFO"
}
],
"subtype": "CreditCard",
"supportedcard": [
"UnionPay"
]
},
{
"active": "Y",
"code": "01,PPSB,PPS",
"pointstonote": [
{
"content": "Please take note of the transaction reference number or PRINT this page for making enquiry on the payment status when necessary.",
"order": 10,
"type": "INFO"
},
{
"content": "After pressing the 'Pay' button, please DO NOT leave this e-service until you receive the acknowledgement page, otherwise your transaction may not be successful.",
"order": 11,
"type": "INFO"
},
{
"content": "PPS Shop&Buy (PPS) does not support payment via browsers of mobile devices (including mobile phones and tablets) at the moment. If you wish to pay by PPS, please change to use desktop computer. ",
"order": 21,
"type": "INFO"
}
],
"subtype": "PPS"
}
]
};
let availableMethods = responseData.availablepaymentmethods;
setAvailableMethods(availableMethods);
}

useEffect(() => {


+ 1
- 1
src/pages/authentication/ForgotUsername/ForgotUsernameApplyForm.js Целия файл

@@ -86,7 +86,7 @@ const ForgotUsernameApplyForm = () => {
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}>
<FormattedMessage id="forgotUserPassword"/>
<FormattedMessage id="forgotUsername"/>
</Typography>
</Stack>
</div>


+ 57
- 44
src/pages/authentication/auth-forms/AuthLoginCustom.js Целия файл

@@ -319,52 +319,65 @@ const AuthLoginCustom = () => {
</Grid>

<Grid item xs={12}>
<AnimateButton>
<Button disableElevation disabled={isButtonDisabled}
fullWidth size="large" type="submit" variant="contained" color="primary"
sx={{
"&.Mui-disabled": {
background: "#bbdefb",
color: "#fff",
border: "2px solid",
borderColor: "#e7e7e7"
}
}}>
<Typography variant="h5">
<FormattedMessage id="login"/>
</Typography>
</Button>
</AnimateButton>
</Grid>
<Grid item xs={12}>
<Stack direction="column" justifyContent="flex-start" alignItems="flex-start" spacing={2}>
<Link component={RouterLink} to="/forgot/password" color="primary">
<Typography align="center" variant="h6">
<FormattedMessage id="forgotUserPassword"/>?
</Typography>
</Link>
<Link component={RouterLink} to="/forgot/username" color="primary">
<Typography align="center" variant="h6">
<FormattedMessage id="forgotUsername"/>?
</Typography>
</Link>
</Stack>
<Grid container>
<Grid item xs={12}>
<AnimateButton>
<Button disableElevation disabled={isButtonDisabled}
fullWidth size="large" type="submit" variant="contained" color="primary"
sx={{
"&.Mui-disabled": {
background: "#bbdefb",
color: "#fff",
border: "2px solid",
borderColor: "#e7e7e7"
}
}}>
<Typography variant="h5">
<FormattedMessage id="login"/>
</Typography>
</Button>
</AnimateButton>
</Grid>
<Grid item xs={12}>
<Stack direction="row" justifyContent="flex-start" alignItems="center" spacing={2}>
<Link component={RouterLink} to="/forgot/password" color="primary" sx={{textDecoration:"none"}}>
<Typography align="center" variant="h7">
<FormattedMessage id="forgotUserPassword"/>?
</Typography>
</Link>
<Typography align="center" variant="h7">
|
</Typography>
<Link component={RouterLink} to="/forgot/username" color="primary" sx={{textDecoration:"none"}}>
<Typography align="center" variant="h7">
<FormattedMessage id="forgotUsername"/>?
</Typography>
</Link>
</Stack>
</Grid>
</Grid>
</Grid>
<Grid item xs={12}>
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}>
<Button onClick={() => getQRWithIAmSmart()} color="iAmSmart" fullWidth size="large" variant="outlined" startIcon={<img src={iAmSmartICon} alt="iAM Smart" width="30" />}>
<Typography variant="h5">
<FormattedMessage id="iAmSmartLogin"/>
</Typography>
</Button>
</Stack>
</Grid>
<Grid item xs={12}>
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}>
<Link href="https://www.iamsmart.gov.hk/tc/"><Typography align="center" variant="h6">
{ intl.formatMessage({id: 'learnMore'})+" >"}
</Typography></Link>
</Stack>
<Grid container>
<Grid item xs={12}>
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}>
<Button onClick={() => getQRWithIAmSmart()} color="iAmSmart" fullWidth size="large" variant="outlined" startIcon={<img src={iAmSmartICon} alt="iAM Smart" width="30" />}>
<Typography variant="h5">
<FormattedMessage id="iAmSmartLogin"/>
</Typography>
</Button>
</Stack>
</Grid>
<Grid item xs={12}>
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}>
<Link href="https://www.iamsmart.gov.hk/tc/" color="primary" sx={{textDecoration:"none"}}>
<Typography align="center" variant="h7">
{ intl.formatMessage({id: 'learnMore'})+" >"}
</Typography>
</Link>
</Stack>
</Grid>
</Grid>
</Grid>
<Grid item xs={12}>
<Stack direction="row" justifyContent="space-between" alignItems="center" spacing={2}>


Зареждане…
Отказ
Запис