You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

149 line
6.2 KiB

  1. // material-ui
  2. import {
  3. Dialog, DialogTitle, DialogContent,
  4. Link, Button, Card, Box, Grid
  5. } from '@mui/material';
  6. import Typography from '@mui/material/Typography';
  7. import iAmSmartICon from 'assets/images/icons/icon_iAmSmart.png';
  8. import banner from 'assets/images/bg_ml.jpg';
  9. import { Stack } from '../../../node_modules/@mui/material/index';
  10. import { iAmSmartPath, clientId, getBowserType , iAmSmartCallbackPath} from 'auth/utils'
  11. import * as React from 'react';
  12. // ================================|| LOGIN ||================================ //
  13. const RegisterCustom = () => {
  14. const [isPopUp, setIsPopUp] = React.useState(false);
  15. const registerWithIAmSmart = () => {
  16. setIsPopUp(true);
  17. }
  18. const getQRWithIAmSmart = () => {
  19. let callbackUrl = "https://"+iAmSmartCallbackPath()+"/iamsmart/registrycallback";
  20. let url = iAmSmartPath + "/api/v1/auth/getQR"
  21. + "?clientID=" + clientId
  22. + "&responseType=code"
  23. +"&source=" + getBowserType()
  24. +"&redirectURI="+encodeURIComponent(callbackUrl)
  25. +"&scope="+encodeURIComponent("eidapi_auth eidapi_profiles")
  26. +"&lang=zh-HK"//en-US, zh-HK, or zh-CN
  27. //+"&state="
  28. +"&brokerPage=false"
  29. window.location.assign(url);
  30. }
  31. return (
  32. <Stack justifyContent="center" sx={{ minHeight: '100vh', bgcolor: 'backgroundColor.default' }}>
  33. <img src={banner} alt="banner" width="100%" height="200px" />
  34. <center>
  35. <Card
  36. sx={{
  37. maxWidth: { xs: 1, lg: 1000 },
  38. margin: { xs: 2.5, md: 3 },
  39. '& > *': {
  40. flexGrow: 1,
  41. flexBasis: '50%'
  42. },
  43. backgroundColor: "secondary"
  44. }}
  45. >
  46. <Box alignItems="center">
  47. <Grid container>
  48. <Grid item xs={12} md={12}>
  49. <Typography mt={4} variant="h2">立即成為<strong style={{ color: '#FF5733' }}>憲報刊登公告</strong>用戶</Typography>
  50. <Typography variant="body1">只需4-5分鐘</Typography>
  51. </Grid>
  52. </Grid>
  53. <Box mt={3} mb={3}>
  54. <Grid container >
  55. <Grid item xs={12} md={6} sx={{ borderRight: 1, borderColor: 'grey.500' }}>
  56. <Typography mb={4} variant="h3">個人用戶</Typography>
  57. <Button variant="outlined" onClick={registerWithIAmSmart} startIcon={<img src={iAmSmartICon} alt="iAM Smart" width="30" />}><Typography variant="h5">以「智方便」繼續</Typography></Button>
  58. <Box mt={4} ml={2} mr={2} bgcolor="grey.100" p={1.5} >
  59. <Typography textAlign='justify' variant="body1" display="block" gutterBottom>
  60. 你可點擊「智方便」按鈕,系統會自動輸入個人資料,或自行輸入個人資料,以即時啟動憲報刊登公告帳戶。
  61. <br />如欲使用「智方便」提供個人資料,請先下載「智方便」流動應用程式並登記成為「智方便」用戶。
  62. </Typography>
  63. <Link href="https://www.iamsmart.gov.hk/tc/">了解更多</Link>
  64. </Box>
  65. <Typography m={5}>或</Typography>
  66. <Button href="/registerFrom" variant="contained"><Typography variant="h5">申請個人用戶</Typography></Button>
  67. <Typography ml={4} mr={4} mt={4} variant="body1" display="block" sx={{ fontWeight: 'bold' }} gutterBottom>
  68. 需上載身份證明文件數碼檔案以進行網上申請。
  69. <br />如:香港身份證; 護照; 中國內地身份證; 專業執業証書等
  70. </Typography>
  71. </Grid>
  72. <Grid item xs={12} md={6} sx={{ borderLeft: 1, borderColor: 'grey.500' }}>
  73. <Typography mb={4} variant="h3">機構/公司用戶</Typography>
  74. <Button href="/registerFromOrganization" variant="contained" sx={{ mt: 0.5 }}><Typography variant="h5">申請機構/公司用戶</Typography></Button>
  75. <Typography ml={4} mr={4} mt={4} variant="body1" display="block" sx={{ fontWeight: 'bold' }} gutterBottom>
  76. 需上載以下任何一份證明文件以進行網上申請。
  77. <br />如:商業登記證;專業執業證書
  78. </Typography>
  79. </Grid>
  80. </Grid>
  81. </Box>
  82. </Box>
  83. </Card >
  84. </center>
  85. <Dialog open={isPopUp} onClose={() => setIsPopUp(false)} >
  86. <DialogTitle></DialogTitle>
  87. <DialogContent>
  88. <Typography variant="h3" >
  89. 授權「智方便」提供個人資料
  90. </Typography>
  91. <Typography variant="h5" style={{ padding: '4px' }}>
  92. 為完成開戶並建立與「智方便」的連接,請授權「智方便」提供以下個人資料:
  93. </Typography>
  94. </DialogContent>
  95. <DialogContent >
  96. <Grid container style={{ paddingLeft: '16px' }}>
  97. <Grid item xs={6} >
  98. <Typography style={{ padding: '4px' }}>
  99. - 中文姓名
  100. </Typography>
  101. <Typography style={{ padding: '4px' }}>
  102. - 英文姓名
  103. </Typography>
  104. <Typography style={{ padding: '4px' }}>
  105. - 身份證號碼
  106. </Typography>
  107. </Grid>
  108. <Grid item xs={6} >
  109. <Typography style={{ padding: '4px' }}>
  110. - 電郵地址
  111. </Typography>
  112. <Typography style={{ padding: '4px' }}>
  113. - 手機號碼
  114. </Typography>
  115. <Typography style={{ padding: '4px' }}>
  116. - 住宅地址
  117. </Typography>
  118. </Grid>
  119. </Grid>
  120. </DialogContent>
  121. <DialogContent align="right">
  122. <Button variant="outlined" onClick={getQRWithIAmSmart} startIcon={<img src={iAmSmartICon} alt="iAM Smart" width="30" />}><Typography variant="h5">使用「智方便」自動填表</Typography></Button>
  123. <br />
  124. <Link href="https://www.iamsmart.gov.hk/tc/">了解更多</Link>
  125. </DialogContent>
  126. </Dialog>
  127. </Stack>
  128. );
  129. };
  130. export default RegisterCustom;