您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

180 行
7.9 KiB

  1. // material-ui
  2. import {
  3. Grid,
  4. Typography,
  5. Stack,
  6. Button,
  7. Dialog, DialogTitle, DialogContent, DialogActions
  8. } from '@mui/material';
  9. import * as UrlUtils from "utils/ApiPathConst";
  10. import * as React from "react";
  11. import * as HttpUtils from "utils/HttpUtils";
  12. import { useParams } from "react-router-dom";
  13. import { useNavigate } from "react-router-dom";
  14. import * as DateUtils from "utils/DateUtils"
  15. import * as FormatUtils from "utils/FormatUtils";
  16. import Loadable from 'components/Loadable';
  17. const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent')));
  18. import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
  19. const BackgroundHead = {
  20. backgroundImage: `url(${titleBackgroundImg})`,
  21. width: '100%',
  22. height: '100%',
  23. backgroundSize: 'contain',
  24. backgroundRepeat: 'no-repeat',
  25. backgroundColor: '#0C489E',
  26. backgroundPosition: 'right'
  27. }
  28. import {
  29. // useEffect,
  30. useState
  31. } from "react";
  32. import {PNSPS_BUTTON_THEME, PNSPS_LONG_BUTTON_THEME} from "../../../themes/buttonConst";
  33. import {ThemeProvider} from "@emotion/react";
  34. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  35. const Index = () => {
  36. const params = useParams();
  37. const navigate = useNavigate()
  38. const [fee, setFee] = useState(0);
  39. const [record, setRecord] = React.useState();
  40. const [onReady, setOnReady] = React.useState(false);
  41. const [isPopUp, setIsPopUp] = useState(false);
  42. React.useEffect(() => {
  43. loadForm();
  44. }, []);
  45. React.useEffect(() => {
  46. setOnReady(true);
  47. }, [record]);
  48. const loadForm = () => {
  49. if (params.id > 0) {
  50. HttpUtils.get({
  51. url: UrlUtils.GET_PROOF_PAY + "/" + params.id,
  52. onSuccess: (responseData) => {
  53. if (!responseData.data?.id) {
  54. navigate("/proof/search");
  55. }
  56. setRecord(responseData.data);
  57. setFee(responseData.data.fee);
  58. }
  59. });
  60. }
  61. }
  62. function doPayment() {
  63. setIsPopUp(false);
  64. navigate('/paymentPage', { state: { amount: fee, appIdList: [record?.appId] } });
  65. }
  66. return (
  67. !onReady ?
  68. <LoadingComponent />
  69. :
  70. (
  71. <Grid container sx={{ minHeight: '110vh', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" >
  72. <Grid item xs={12} width="100%">
  73. <div style={BackgroundHead} width="100%">
  74. <Stack direction="row" height='70px'>
  75. <Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}>校對記錄</Typography>
  76. </Stack>
  77. </div>
  78. </Grid>
  79. {/*row 1*/}
  80. <Grid item xs={12} md={12} >
  81. <Grid container justifyContent="flex-start" alignItems="center" >
  82. <center>
  83. <Grid item xs={12} md={8} >
  84. <Typography variant="h3" sx={{ textAlign: "left", ml: 4, mr: 4, mt: 4, borderBottom: "1px solid black" }}>
  85. 公共啟事:校對完成及付款
  86. </Typography>
  87. <Typography variant="h4" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "left" }}>
  88. 我們已收到申請編號: {record?.appNo} 的稿件校對確定及可付印的指示。
  89. <br /><br />
  90. 請於 <span style={{ color: "red" }}>{DateUtils.dateStr_Cht(record?.returnBeforeDate)} 下午 2:00 前</span> 完成繳費,我們將於收到繳費確認後處理刊出事宜。
  91. <br /><br />
  92. 如你在憲報期數 {record?.issueYear} 年 {record?.issueVolume} 卷, 第 {record?.issueNo} 期內有多於一個公共啟事的申請,你可選擇完成所有此期所有稿件校對確定後,於繳費期限前在「我的公共啟事」內合併付款。
  93. </Typography>
  94. <Typography variant="h4" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "left" }}>
  95. 請按以下完成繳費:
  96. </Typography>
  97. <Typography variant="h4" sx={{ml:8, textAlign: "left" }}>
  98. <ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}>
  99. <Button
  100. component="span"
  101. variant="contained"
  102. sx={{ ml: {md:4,lg:4}, mr:4}}
  103. onClick={() => { setIsPopUp(true) }}
  104. >
  105. 即時網上繳費
  106. </Button>
  107. </ThemeProvider>
  108. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  109. <Button
  110. component="span"
  111. variant="contained"
  112. sx={{ ml: {sm:4, md:4, lg:4}, mr: 4, mt:{xs:2,sm:2}, mb:{xs:2, sm:2}}}
  113. onClick={()=>{
  114. navigate("/publicNotice");
  115. }}
  116. >
  117. 稍後繳費
  118. </Button>
  119. (返回「我的公共啟事」)
  120. </ThemeProvider>
  121. </Typography>
  122. </Grid>
  123. </center>
  124. </Grid>
  125. </Grid>
  126. <div>
  127. <Dialog
  128. open={isPopUp}
  129. onClose={() => setIsPopUp(false)}
  130. PaperProps={{
  131. sx: {
  132. minWidth: '40vw',
  133. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '30vw' },
  134. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '50vh' }
  135. }
  136. }}
  137. >
  138. <DialogTitle>
  139. <Typography variant="h3" >確認付款</Typography>
  140. </DialogTitle>
  141. <DialogContent style={{ display: 'flex', }}>
  142. <Stack direction="column" justifyContent="space-between">
  143. <Typography variant="h4">總額(HK$): {FormatUtils.currencyFormat(fee)}</Typography>
  144. </Stack>
  145. </DialogContent>
  146. <DialogActions>
  147. <Button onClick={() => setIsPopUp(false)}><Typography variant="h5">關閉</Typography></Button>
  148. <Button onClick={() => doPayment()}><Typography variant="h5">確認</Typography></Button>
  149. </DialogActions>
  150. </Dialog>
  151. </div>
  152. {/*row 2*/}
  153. </Grid >
  154. )
  155. );
  156. };
  157. export default Index;