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

1335 行
81 KiB

  1. import { useEffect, useState, } from 'react';
  2. // material-ui
  3. import {
  4. Box,
  5. Button,
  6. FormControl,
  7. FormHelperText,
  8. Grid, IconButton,
  9. InputAdornment,
  10. InputLabel, OutlinedInput,
  11. Stack,
  12. Typography,
  13. FormGroup,
  14. TextField,
  15. Checkbox
  16. // MenuItem
  17. } from '@mui/material';
  18. import {useForm,} from 'react-hook-form'
  19. import Autocomplete from "@mui/material/Autocomplete";
  20. // third party
  21. import { useFormik,FormikProvider } from 'formik';
  22. import * as yup from 'yup';
  23. // import axios from "axios";
  24. // project import
  25. // import AnimateButton from 'components/@extended/AnimateButton';
  26. import { strengthColorChi, strengthIndicator } from 'utils/password-strength';
  27. import {apiPath} from "auth/utils";
  28. import axios from "axios";
  29. import {POST_PUBLIC_USER_REGISTER} from "utils/ApiPathConst";
  30. import * as HttpUtils from 'utils/HttpUtils';
  31. import * as ComboData from "../../../utils/ComboData";
  32. import Loadable from 'components/Loadable';
  33. import { lazy } from 'react';
  34. const UploadFileTable = Loadable(lazy(() => import('./UploadFileTable')));
  35. const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent')));
  36. // import UploadFileTable from './UploadFileTable';
  37. // import LoadingComponent from "../../extra-pages/LoadingComponent";
  38. // assets
  39. import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons';
  40. // import { Paper } from '../../../../node_modules/@mui/material/index';
  41. import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
  42. import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined';
  43. import { Link } from 'react-router-dom';
  44. // ============================|| FIREBASE - REGISTER ||============================ //
  45. const CustomFormWizard = (props) => {
  46. const [level, setLevel] = useState();
  47. const [showPassword, setShowPassword] = useState(false);
  48. const [showConfirmPassword, setshowConfirmPassword] = useState(false);
  49. const [fileList, setFileList] = useState([]);
  50. const [fileListData, setFileListData] = useState([]);
  51. const [checkUpload, setCheckUpload] = useState(false);
  52. const [updateRows, setUpdateRows] = useState([]);
  53. const handleClickShowPassword = () => {
  54. setShowPassword(!showPassword);
  55. };
  56. const handleClickShowConfirmPassword = () => {
  57. setshowConfirmPassword(!showConfirmPassword);
  58. };
  59. const handleMouseDownPassword = (event) => {
  60. event.preventDefault();
  61. };
  62. const changePassword = (value) => {
  63. const temp = strengthIndicator(value);
  64. setLevel(strengthColorChi(temp));
  65. };
  66. const [selectedIdDocType, setSelectedIdDocType] = useState({});
  67. // const [selectedIdDocLabel, setSelectedIdDocLabel] = useState(null);
  68. const [selectedAddress4, setSelectedAddress4] = useState(null);
  69. const [selectedAddress5, setSelectedAddress5] = useState(ComboData.country[0]);
  70. const [termsAndConAccept, setTermsAndConAccept] = useState(false);
  71. const [termsAndConNotAccept, setTermsAndConNotAccept] = useState(false);
  72. const [isValid, setisValid] = useState(false);
  73. const [isLoading, setLoding] = useState(true);
  74. const idDocTypeComboList = ComboData.idDocType;
  75. const address4ComboList = ComboData.district;
  76. const address5ComboList = ComboData.country;
  77. const termsAndCon = "此網址由香港特別行政區政府物流服務署製作及管理。本署會盡力確保網址上的資料無誤,\n"
  78. + "但有絕對酌情權隨時刪除、暫停登載或編輯各項資料而無須給予任何理由。\n由於任何與網址"
  79. + "內資料有關的理由或原因,而導致出現申索、損失或損害,本署概不負責。\n使用者須自行評"
  80. + "估本網址所載或與本網址有關連的各項資料,並應在根據該等資料行事前,參照印行的香港"
  81. + "特別行政區憲報以核實該等資料,以及徵詢獨立意見。\n版權公告本網頁的內容,包括但不限"
  82. + "於所有文本、平面圖像、圖畫、圖片、照片以及數據或其他資料的匯編,均受版權保障。\n香"
  83. + "港特別行政區政府是本網頁內所有版權作品的擁有人,除非預先得到政府物流服務署的書面"
  84. + "授權,否則嚴禁複製、改編、分發、發布或向公眾提供該等版權作品。"
  85. useEffect(() => {
  86. changePassword('');
  87. }, []);
  88. const checkDataField = (data)=> {
  89. if (data.username !==""&&
  90. data.password !==""&&
  91. data.confirmPassword !==""&&
  92. data.password == data.confirmPassword&&
  93. selectedIdDocType.type !==""&&
  94. data.idNo !==""&&
  95. data.enName !==""&&
  96. data.address1 !==""&&
  97. data.email !==""&&
  98. data.emailConfirm !==""&&
  99. data.phone !==""&&
  100. data.phoneCountryCode !==""&&
  101. termsAndConAccept == true&&
  102. fileList.length!==0&&
  103. handlePassword(data.password)&&
  104. handleEmail(data.email)&&
  105. handleIdNo(data.idNo,selectedIdDocType.type)&&
  106. handle8Digi(data.phone)&&
  107. handle8Digi(data.username)
  108. )
  109. {
  110. setisValid(true)
  111. return isValid
  112. }else{
  113. setisValid(false)
  114. return isValid
  115. }
  116. };
  117. const handleCheckBoxChange = (event) => {
  118. if(event.target.name == 'termsAndConAccept'){
  119. setTermsAndConAccept(event.target.checked)
  120. setTermsAndConNotAccept(!event.target.checked)
  121. }
  122. if(event.target.name == 'termsAndConNotAccept'){
  123. setTermsAndConNotAccept(event.target.checked)
  124. setTermsAndConAccept(!event.target.checked)
  125. }
  126. };
  127. useEffect(() => {
  128. console.log(updateRows);
  129. let updateRowList = new DataTransfer();
  130. var updateRowsIndex = updateRows.length;
  131. if (updateRowsIndex!=null){
  132. for (let i = 0; i < updateRowsIndex; i++){
  133. const file = updateRows[i]
  134. updateRowList.items.add(file);
  135. }
  136. let updatedFileList = updateRowList.files;
  137. setFileList(updatedFileList);
  138. }
  139. }, [updateRows]);
  140. const handleFileUpload = (event)=>{
  141. let updateList = new DataTransfer();
  142. let currentFileList = fileListData;
  143. const uploadFileList = event.target.files;
  144. const saveFileList = [];
  145. var currentIndex = 0;
  146. // console.log("uploadFileList")
  147. // console.log(uploadFileList)
  148. if (currentFileList.length!=null){
  149. currentIndex = currentFileList.length;
  150. for (let i = 0; i < currentIndex; i++){
  151. const file = currentFileList[i]
  152. updateList.items.add(file);
  153. saveFileList.push(file);
  154. }
  155. }
  156. // console.log("saveFileList")
  157. // console.log(saveFileList)
  158. for (let i = 0; i < uploadFileList.length && currentIndex<5; i++){
  159. const file = event.target.files[i]
  160. let isDuplicate = false;
  161. // console.log("file 1")
  162. // console.log(file)
  163. // Check if the file name already exists in saveFileList
  164. for (let j = 0; j < saveFileList.length; j++) {
  165. if (saveFileList[j].name === file.name) {
  166. isDuplicate = true;
  167. break;
  168. }
  169. }
  170. if (!isDuplicate) {
  171. // console.log("file2")
  172. // console.log(file)
  173. file.id = currentIndex+i
  174. saveFileList.push(file)
  175. updateList.items.add(file);
  176. }
  177. }
  178. let updatedFileList = updateList.files;
  179. setFileListData(saveFileList)
  180. setFileList(updatedFileList);
  181. // console.log("saveFileList2")
  182. // console.log(saveFileList)
  183. };
  184. useEffect(() => {
  185. props.setUpdateValid(isValid)
  186. }, [isValid])
  187. useEffect(() => {
  188. checkDataField(values)
  189. }, [
  190. selectedIdDocType,
  191. selectedAddress4,selectedAddress5,
  192. termsAndConAccept,termsAndConNotAccept,fileList])
  193. useEffect(() => {
  194. props.step ==2?_onSubmit():null;
  195. }, [props.step])
  196. const {handleSubmit} = useForm({})
  197. const _onSubmit = () => {
  198. setLoding(true);
  199. values.idDocType = selectedIdDocType.type
  200. values.address4 = selectedAddress4
  201. values.address5 = selectedAddress5
  202. const userAddress = {
  203. "addressLine1":"",
  204. "addressLine2":"",
  205. "addressLine3":"",
  206. "district":"",
  207. "country":""
  208. };
  209. userAddress.addressLine1 = values.address1
  210. userAddress.addressLine2 = values.address2
  211. userAddress.addressLine3 = values.address3
  212. userAddress.district = values.address4
  213. userAddress.country = values.address5
  214. const userFaxNo = {
  215. "countryCode":values.faxCountryCode,
  216. "faxNumber":values.fax,
  217. };
  218. const userMobileNumber = {
  219. "countryCode":values.phoneCountryCode,
  220. "phoneNumber":values.phone,
  221. };
  222. let tncFlag = false;
  223. if (termsAndConAccept){
  224. tncFlag = true
  225. }
  226. if (termsAndConNotAccept){
  227. tncFlag = false
  228. }
  229. if (isValid){
  230. axios.post(`${apiPath}${POST_PUBLIC_USER_REGISTER}`, {
  231. username: values.username,
  232. password: values.password,
  233. name: values.username,
  234. enName: values.enName,
  235. chName: values.chName,
  236. emailAddress: values.email,
  237. idDocType:values.idDocType,
  238. identification:values.idNo,
  239. checkDigit:values.checkDigit,
  240. userFaxNo:userFaxNo,
  241. userMobileNumber:userMobileNumber,
  242. userAddress:userAddress,
  243. tncFlag:tncFlag,
  244. type:"IND"
  245. })
  246. .then((response) => {
  247. setCheckUpload(true)
  248. HttpUtils.fileUpload(
  249. {
  250. refType:"identification",
  251. refId: response.data.id,
  252. file: fileList,
  253. onSuccess: (response)=>{
  254. console.log(response);
  255. // setOpen(true);
  256. setLoding(false);
  257. }
  258. }
  259. );
  260. })
  261. .catch(error => {
  262. console.error(error);
  263. setLoding(false);
  264. });
  265. }else{
  266. setLoding(false);
  267. }
  268. }
  269. function handle8Digi(value) {
  270. if (value.length < 8) {
  271. return false;
  272. } else {
  273. return true;
  274. }
  275. }
  276. function handleIdNo(idNo,selectedIdDocType) {
  277. var upperCase = /[A-Z]/g;
  278. if (!idNo.match(upperCase)&&selectedIdDocType=="HKID") {
  279. return false;
  280. }
  281. else if (idNo.length < 7) {
  282. return false;
  283. } else {
  284. return true;
  285. }
  286. }
  287. function handlePassword(password) {
  288. let new_pass = password;
  289. // regular expressions to validate password
  290. var lowerCase = /[a-z]/g;
  291. var upperCase = /[A-Z]/g;
  292. var numbers = /[0-9]/g;
  293. if (!new_pass.match(lowerCase)) {
  294. return false;
  295. } else if (!new_pass.match(upperCase)) {
  296. return false;
  297. } else if (!new_pass.match(numbers)) {
  298. return false;
  299. } else if (new_pass.length < 8) {
  300. return false;
  301. } else {
  302. return true;
  303. }
  304. }
  305. function handleEmail(email) {
  306. var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
  307. // var result = reg.test(email);
  308. var result = email.match(validRegex);
  309. console.log("test1: "+result)
  310. if (result == false) {
  311. return false;
  312. }
  313. return true;
  314. }
  315. const formik = useFormik({
  316. initialValues:({
  317. username:'',
  318. enName: '',
  319. chName: '',
  320. email: '',
  321. emailConfirm: '',
  322. address1: '',
  323. address2: '',
  324. address3: '',
  325. password: '',
  326. confirmPassword: '',
  327. phone:'',
  328. phoneCountryCode:'852',
  329. idNo:'',
  330. checkDigit:'',
  331. submit: null,
  332. fax:'',
  333. faxCountryCode:'852',
  334. idDocType:''
  335. }),
  336. validationSchema:yup.object().shape({
  337. username: yup.string().min(6,'用戶名稱最少6位').required('請輸入用戶名稱'),
  338. password: yup.string().min(8,'請輸入最少8位密碼').required('請輸入密碼')
  339. .matches(/^(?=.*[a-z])/, '請包括最少1個小寫字母')
  340. .matches(/^(?=.*[A-Z])/, '請包括最少1個大寫字母')
  341. .matches(/^(?=.*[0-9])/, '請包括最少1個數字')
  342. .matches(/^(?=.*[!@#%&])/, '請包括最少1個特殊字符'),
  343. confirmPassword: yup.string().min(8,'請最少輸入8位密碼').required('請確認密碼').oneOf([yup.ref('password'), null], '請輸入相同密碼'),
  344. enName: yup.string().max(255).required('請輸入英文姓名'),
  345. chName: yup.string().max(255).required('請輸入中文姓名'),
  346. address1: yup.string().max(255).required('請輸入第一行地址'),
  347. address2: yup.string().max(255).required('請輸入第二行地址'),
  348. address3: yup.string().max(255).required('請輸入第三行地址'),
  349. email: yup.string().email('請輸入電郵格式').max(255).required('請輸入電郵'),
  350. emailConfirm: yup.string().email('請輸入電郵格式').max(255).required('請輸入電郵').oneOf([yup.ref('email'), null], '請輸入相同電郵'),
  351. idNo: yup.string().min(7,"請輸入證件號碼").required('請輸入證件號碼'),
  352. checkDigit:yup.string().max(1).required('請輸入括號內的數字或字母'),
  353. idDocType: yup.string().max(255).required('請輸入證件類別'),
  354. phoneCountryCode: yup.string().min(3,'請輸入3位數字').required('請輸入國際區號'),
  355. faxCountryCode: yup.string().min(3,'請輸入3位數字'),
  356. phone: yup.string().min(8,'請輸入8位數字').required('請輸入聯絡電話'),
  357. fax: yup.string().min(8,'請輸入8位數字'),
  358. }),
  359. });
  360. const handleReset = (resetForm) => {
  361. resetForm();
  362. setSelectedAddress4("")
  363. setSelectedIdDocType({})
  364. // setSelectedIdDocLabel("")
  365. };
  366. const { values } = formik
  367. useEffect(() => {
  368. checkDataField(values)
  369. }, [values])
  370. return (
  371. <FormikProvider value={formik}>
  372. <form onSubmit={handleSubmit(_onSubmit)}>
  373. {/* Input Form */}
  374. <FormGroup id={"inputForm"} sx={{ display: props.step === 0 ? "" : "none" }}>
  375. <Grid container spacing={3}>
  376. <Grid item xs={12} md={12}>
  377. <Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
  378. <Button variant="outlined" type="reset" onClick={handleReset.bind(null, formik.resetForm)} sx={{ fontSize: 16,height:'30px'}}>重置</Button>
  379. <div style={{borderBottom: "3px solid #1A4399", width:"100%", margin_right: "15px"}}>
  380. <Typography display="inline" variant="h3" sx={{ color: '#1A4399'}}>成為新的個人用戶</Typography>
  381. </div>
  382. <Typography mt={0.25} variant="h6" sx={{ fontSize: 12,color: '#f10000'}}>註有*的項目必須輸入資料</Typography>
  383. <Typography mt={0.25} variant="h4" sx={{ color: 'primary.primary'}}>你的登入資料</Typography>
  384. </Stack>
  385. </Grid>
  386. <Grid item xs={12} md={12}>
  387. <Grid container spacing={1}>
  388. <Grid item xs={12} md={12} >
  389. <Stack spacing={1}>
  390. <InputLabel htmlFor="username-signup">用戶登入名稱
  391. <span style={{color: '#f10000'}}>*</span>
  392. </InputLabel>
  393. <OutlinedInput
  394. id="username-login"
  395. type="text"
  396. value={formik.values.username}
  397. name="username"
  398. onChange={formik.handleChange}
  399. placeholder="用戶登入名稱"
  400. fullWidth
  401. error={Boolean(formik.touched.username && formik.errors.username)}
  402. onBlur={formik.handleBlur}
  403. inputProps={{
  404. onKeyDown: (e) => {
  405. if (e.key === 'Enter') {
  406. e.preventDefault();
  407. }
  408. },
  409. }}
  410. />
  411. {formik.touched.username && formik.errors.username && (
  412. <FormHelperText error id="helper-text-username-signup">
  413. {formik.errors.username}
  414. </FormHelperText>
  415. )}
  416. </Stack>
  417. </Grid>
  418. <Grid item xs={12} md={12}>
  419. <Grid container>
  420. <Grid item xs={12} md={6} >
  421. <Stack spacing={1} sx={{mr:{md:1},mb:1}}>
  422. <Stack direction="row" justifyContent="space-between">
  423. <InputLabel htmlFor="password-signup">密碼
  424. <span style={{color: '#f10000'}}>*</span>
  425. </InputLabel>
  426. <InputLabel htmlFor="password-rule">密碼規則</InputLabel>
  427. </Stack>
  428. <OutlinedInput
  429. fullWidth
  430. error={Boolean(formik.touched.password && formik.errors.password)}
  431. id="password-signup"
  432. type={showPassword ? 'text' : 'password'}
  433. value={formik.values.password}
  434. name="password"
  435. onChange={(e) => {
  436. formik.handleChange(e);
  437. changePassword(e.target.value);
  438. }}
  439. endAdornment={
  440. <InputAdornment position="end">
  441. <IconButton
  442. aria-label="toggle password visibility"
  443. onClick={handleClickShowPassword}
  444. onMouseDown={handleMouseDownPassword}
  445. edge="end"
  446. size="large"
  447. >
  448. {showPassword ? <EyeOutlined /> : <EyeInvisibleOutlined />}
  449. </IconButton>
  450. </InputAdornment>
  451. }
  452. placeholder="密碼"
  453. onBlur={formik.handleBlur}
  454. inputProps={{
  455. onKeyDown: (e) => {
  456. if (e.key === 'Enter') {
  457. e.preventDefault();
  458. }
  459. },
  460. }}
  461. />
  462. {formik.touched.password && formik.errors.password && (
  463. <FormHelperText error id="helper-text-password-signup">
  464. {formik.errors.password}
  465. </FormHelperText>
  466. )}
  467. </Stack>
  468. <FormControl fullWidth sx={{ mt: 2 }}>
  469. <Grid container spacing={2} alignItems="center">
  470. <Grid item>
  471. <Box sx={{ bgcolor: level?.color, width: 85, height: 8, borderRadius: '7px' }} />
  472. </Grid>
  473. <Grid item>
  474. <Typography variant="subtitle1" fontSize="0.75rem">
  475. {level?.label}
  476. </Typography>
  477. </Grid>
  478. </Grid>
  479. </FormControl>
  480. </Grid>
  481. <Grid item xs={12} md={6} >
  482. <Stack spacing={1}>
  483. <InputLabel htmlFor="confirmPassword-signup">確認密碼
  484. <span style={{color: '#f10000'}}>*</span>
  485. </InputLabel>
  486. <OutlinedInput
  487. id="confirmPassword-login"
  488. type={showConfirmPassword ? 'text' : 'password'}
  489. value={formik.values.confirmPassword}
  490. name="confirmPassword"
  491. onBlur={formik.handleBlur}
  492. onChange={(e) => {
  493. formik.handleChange(e);
  494. // changePassword(e.target.value);
  495. }}
  496. inputProps={{
  497. onKeyDown: (e) => {
  498. if (e.key === 'Enter') {
  499. e.preventDefault();
  500. }
  501. },
  502. }}
  503. endAdornment={
  504. <InputAdornment position="end">
  505. <IconButton
  506. aria-label="toggle password visibility"
  507. onClick={handleClickShowConfirmPassword}
  508. onMouseDown={handleMouseDownPassword}
  509. edge="end"
  510. size="large"
  511. >
  512. {showConfirmPassword ? <EyeOutlined /> : <EyeInvisibleOutlined />}
  513. </IconButton>
  514. </InputAdornment>
  515. }
  516. placeholder="確認密碼"
  517. fullWidth
  518. error={Boolean(formik.touched.confirmPassword && formik.errors.confirmPassword)}
  519. />
  520. {formik.touched.confirmPassword && formik.errors.confirmPassword && (
  521. <FormHelperText error id="helper-text-confirmPassword-signup">
  522. {formik.errors.confirmPassword}
  523. </FormHelperText>
  524. )}
  525. </Stack>
  526. </Grid>
  527. </Grid>
  528. </Grid>
  529. <Grid item xs={12} mt={1} mb={1}>
  530. <Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
  531. <Typography display="inline" variant="h4" sx={{ color: 'primary.primary'}}>你的個人資料</Typography>
  532. {/* <Typography component={Link} to="/login" variant="body1" sx={{ textDecoration: 'none' }} color="primary">
  533. Already have an account?
  534. </Typography> */}
  535. </Stack>
  536. </Grid>
  537. <Grid item xs={12} md={12} >
  538. <Grid container sx={{mb:1}}>
  539. <Stack spacing={1}>
  540. <InputLabel htmlFor="idDocType-signup">身份證明文件
  541. <span style={{color: '#f10000'}}>*</span>
  542. </InputLabel>
  543. {/* {formik.touched.enName && formik.errors.enName && (
  544. <FormHelperText error id="helper-text-enName-signup">
  545. {formik.errors.enName}
  546. </FormHelperText>
  547. )} */}
  548. </Stack>
  549. </Grid>
  550. <Grid container>
  551. <Grid item xs={12} md={6} >
  552. <Stack spacing={1} sx={{mr:{md:1},mb:{xs:0.5}}}>
  553. <Autocomplete
  554. disablePortal
  555. id="idDocType"
  556. // value={selectedIdDocType}
  557. options={idDocTypeComboList}
  558. // getOptionLabel={(idDocTypeComboList) => idDocTypeComboList.label}
  559. onBlur={formik.handleBlur}
  560. onChange={(event, newValue) => {
  561. // console.log(newValue)
  562. if (newValue!=null){
  563. console.log(newValue)
  564. setSelectedIdDocType(newValue);
  565. // setSelectedIdDocLabel(newValue.label);
  566. if (newValue.type!="HKID"){
  567. formik.setFieldValue("checkDigit","")
  568. }
  569. }
  570. }}
  571. sx={{"& .MuiInputBase-root": { height: "41px" },"#idDocType":{padding: "0px 0px 0px 0px"}, "& .MuiAutocomplete-endAdornment": { top: "auto" },}}
  572. renderInput={(params) => <TextField {...params} placeholder="證件類別"/>}
  573. />
  574. {formik.touched.idDocType && (
  575. selectedIdDocType===null?
  576. <FormHelperText error id="helper-text-idDocType-signup">
  577. 請輸入證件類別
  578. </FormHelperText>:''
  579. )}
  580. </Stack>
  581. </Grid>
  582. {selectedIdDocType.type=="HKID"?
  583. <>
  584. <Grid item xs={10} md={5}>
  585. <Stack spacing={1}>
  586. <OutlinedInput
  587. id="idNo-login"
  588. type="text"
  589. value={formik.values.idNo}
  590. name="idNo"
  591. onChange={formik.handleChange}
  592. placeholder="證件號碼"
  593. fullWidth
  594. sx={{mr:1}}
  595. error={Boolean(formik.touched.idNo && formik.errors.idNo)}
  596. onBlur={formik.handleBlur}
  597. inputProps={{
  598. maxLength: selectedIdDocType.type =='HKID'?7:18,
  599. onKeyDown: (e) => {
  600. if (e.key === 'Enter') {
  601. e.preventDefault();
  602. }
  603. },
  604. }}
  605. />
  606. {formik.touched.idNo && formik.errors.idNo && (
  607. <FormHelperText error id="helper-text-idNo-signup">
  608. {formik.errors.idNo}
  609. </FormHelperText>
  610. )}
  611. {formik.touched.checkDigit && formik.errors.checkDigit && (
  612. <FormHelperText error id="helper-text-checkDigit-signup">
  613. {formik.errors.checkDigit}
  614. </FormHelperText>
  615. )}
  616. </Stack>
  617. </Grid>
  618. <Grid item xs={2} md={1}>
  619. <Stack spacing={1}>
  620. <OutlinedInput
  621. id="checkDigit-login"
  622. type="text"
  623. value={formik.values.checkDigit}
  624. name="checkDigit"
  625. onChange={formik.handleChange}
  626. placeholder="( )"
  627. // sx={{height:"53px"}}
  628. inputProps={{
  629. maxLength: 1,
  630. onKeyDown: (e) => {
  631. if (e.key === 'Enter') {
  632. e.preventDefault();
  633. }
  634. },
  635. }}
  636. fullWidth
  637. error={Boolean(formik.touched.checkDigit && formik.errors.checkDigit)}
  638. onBlur={formik.handleBlur}
  639. />
  640. </Stack>
  641. </Grid>
  642. </>:
  643. <Grid item xs={12} md={6}>
  644. <Stack spacing={1}>
  645. <OutlinedInput
  646. id="idNo-login"
  647. type="text"
  648. value={formik.values.idNo}
  649. name="idNo"
  650. onChange={formik.handleChange}
  651. placeholder="證件號碼"
  652. fullWidth
  653. sx={{mr:1}}
  654. error={Boolean(formik.touched.idNo && formik.errors.idNo)}
  655. onBlur={formik.handleBlur}
  656. inputProps={{
  657. onKeyDown: (e) => {
  658. if (e.key === 'Enter') {
  659. e.preventDefault();
  660. }
  661. },
  662. }}
  663. />
  664. {formik.touched.idNo && formik.errors.idNo && (
  665. <FormHelperText error id="helper-text-idNo-signup">
  666. {formik.errors.idNo}
  667. </FormHelperText>
  668. )}
  669. </Stack>
  670. </Grid>
  671. }
  672. </Grid>
  673. </Grid>
  674. <Grid item xs={12} md={6}>
  675. <Stack spacing={1}>
  676. <InputLabel htmlFor="enName-signup">英文姓名
  677. <span style={{color: '#f10000'}}>*</span>
  678. </InputLabel>
  679. <OutlinedInput
  680. id="enName-login"
  681. type="enName"
  682. value={formik.values.enName}
  683. name="enName"
  684. onChange={formik.handleChange}
  685. placeholder="與你的身份證明文件相同"
  686. fullWidth
  687. error={Boolean(formik.touched.enName && formik.errors.enName)}
  688. onBlur={formik.handleBlur}
  689. inputProps={{
  690. onKeyDown: (e) => {
  691. if (e.key === 'Enter') {
  692. e.preventDefault();
  693. }
  694. },
  695. }}
  696. />
  697. {formik.touched.enName && formik.errors.enName && (
  698. <FormHelperText error id="helper-text-enName-signup">
  699. {formik.errors.enName}
  700. </FormHelperText>
  701. )}
  702. </Stack>
  703. </Grid>
  704. <Grid item xs={12} md={6}>
  705. <Stack spacing={1}>
  706. <InputLabel htmlFor="chName-signup">中文姓名</InputLabel>
  707. <OutlinedInput
  708. fullWidth
  709. error={Boolean(formik.touched.chName && formik.errors.chName)}
  710. id="chName-signup"
  711. type="text"
  712. value={formik.values.chName}
  713. name="chName"
  714. onChange={formik.handleChange}
  715. placeholder="與你的身份證明文件相同"
  716. inputProps={{
  717. onKeyDown: (e) => {
  718. if (e.key === 'Enter') {
  719. e.preventDefault();
  720. }
  721. },
  722. }}
  723. />
  724. {formik.touched.chName && formik.errors.chName && (
  725. <FormHelperText error id="helper-text-chName-signup">
  726. {formik.errors.chName}
  727. </FormHelperText>
  728. )}
  729. </Stack>
  730. </Grid>
  731. <Grid item xs={12}>
  732. <Stack spacing={1}>
  733. <InputLabel htmlFor="address1-signup">地址
  734. <span style={{color: '#f10000'}}>*</span>
  735. </InputLabel>
  736. <OutlinedInput
  737. fullWidth
  738. error={Boolean(formik.touched.address1 && formik.errors.address1)}
  739. id="address1-signup"
  740. value={formik.values.address1}
  741. name="address1"
  742. onChange={formik.handleChange}
  743. placeholder="第一行"
  744. onBlur={formik.handleBlur}
  745. inputProps={{
  746. onKeyDown: (e) => {
  747. if (e.key === 'Enter') {
  748. e.preventDefault();
  749. }
  750. },
  751. }}
  752. />
  753. <OutlinedInput
  754. fullWidth
  755. error={Boolean(formik.touched.address2 && formik.errors.address2)}
  756. id="address2-signup"
  757. value={formik.values.address2}
  758. name="address2"
  759. onChange={formik.handleChange}
  760. placeholder="第二行"
  761. inputProps={{
  762. onKeyDown: (e) => {
  763. if (e.key === 'Enter') {
  764. e.preventDefault();
  765. }
  766. },
  767. }}
  768. />
  769. <OutlinedInput
  770. fullWidth
  771. error={Boolean(formik.touched.address3 && formik.errors.address3)}
  772. id="address3-signup"
  773. value={formik.values.address3}
  774. name="address3"
  775. onChange={formik.handleChange}
  776. placeholder="第三行"
  777. inputProps={{
  778. onKeyDown: (e) => {
  779. if (e.key === 'Enter') {
  780. e.preventDefault();
  781. }
  782. },
  783. }}
  784. />
  785. <Autocomplete
  786. disablePortal
  787. id="address4-combo"
  788. value={selectedAddress4}
  789. options={address4ComboList}
  790. onChange={(event, newValue) => {
  791. setSelectedAddress4(newValue);
  792. }}
  793. sx={{"& .MuiInputBase-root": { height: "41px" },"#address4-combo":{padding: "0px 0px 0px 0px"}, "& .MuiAutocomplete-endAdornment": { top: "auto" },}}
  794. renderInput={(params) => <TextField {...params} placeholder="區域 (只適用於香港)"/>}
  795. />
  796. <Autocomplete
  797. disablePortal
  798. id="address5-combo"
  799. value={selectedAddress5}
  800. options={address5ComboList}
  801. onChange={(event, newValue) => {
  802. setSelectedAddress5(newValue);
  803. }}
  804. sx={{"& .MuiInputBase-root": { height: "41px" },"#address5-combo":{padding: "0px 0px 0px 0px"}, "& .MuiAutocomplete-endAdornment": { top: "auto" },}}
  805. renderInput={(params) => <TextField {...params} placeholder="國家/地區"/>}
  806. />
  807. {formik.touched.address1 && formik.errors.address1 && (
  808. <FormHelperText error id="helper-text-address1-signup">
  809. {formik.errors.address1}
  810. </FormHelperText>
  811. )}
  812. {formik.touched.address2 && formik.errors.address2 && (
  813. <FormHelperText error id="helper-text-address2-signup">
  814. {formik.errors.address2}
  815. </FormHelperText>
  816. )}
  817. {formik.touched.address3 && formik.errors.address3 && (
  818. <FormHelperText error id="helper-text-address3-signup">
  819. {formik.errors.address3}
  820. </FormHelperText>
  821. )}
  822. </Stack>
  823. </Grid>
  824. <Grid item xs={12} mt={1} mb={1}>
  825. <Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
  826. <Typography display="inline" variant="h4" sx={{ color: 'primary.primary'}}>你的聯絡資料</Typography>
  827. </Stack>
  828. </Grid>
  829. <Grid item xs={12} md={12}>
  830. <Grid container>
  831. <Grid item xs={12} md={6}>
  832. <Stack spacing={1} sx={{mr:{md:1},mb:1}}>
  833. <InputLabel htmlFor="email-signup">電郵
  834. <span style={{color: '#f10000'}}>*</span>
  835. </InputLabel>
  836. <OutlinedInput
  837. fullWidth
  838. error={Boolean(formik.touched.email && formik.errors.email)}
  839. id="email-login"
  840. type="email"
  841. value={formik.values.email}
  842. name="email"
  843. onChange={formik.handleChange}
  844. placeholder="電郵"
  845. onBlur={formik.handleBlur}
  846. inputProps={{
  847. onKeyDown: (e) => {
  848. if (e.key === 'Enter') {
  849. e.preventDefault();
  850. }
  851. },
  852. }}
  853. />
  854. {formik.touched.email && formik.errors.email && (
  855. <FormHelperText error id="helper-text-email-signup">
  856. {formik.errors.email}
  857. </FormHelperText>
  858. )}
  859. </Stack>
  860. </Grid>
  861. <Grid item xs={12} md={6}>
  862. <Stack spacing={1} >
  863. <InputLabel htmlFor="emailConfirm-signup">確認電郵
  864. <span style={{color: '#f10000'}}>*</span>
  865. </InputLabel>
  866. <OutlinedInput
  867. fullWidth
  868. error={Boolean(formik.touched.emailConfirm && formik.errors.emailConfirm)}
  869. id="emailConfirm-login"
  870. type="email"
  871. value={formik.values.emailConfirm}
  872. name="emailConfirm"
  873. // onBlur={formik.handleBlur}
  874. onChange={formik.handleChange}
  875. placeholder="確認電郵"
  876. onBlur={formik.handleBlur}
  877. inputProps={{
  878. onKeyDown: (e) => {
  879. if (e.key === 'Enter') {
  880. e.preventDefault();
  881. }
  882. },
  883. }}
  884. />
  885. {formik.touched.emailConfirm && formik.errors.emailConfirm && (
  886. <FormHelperText error id="helper-text-emailConfirm-signup">
  887. {formik.errors.emailConfirm}
  888. </FormHelperText>
  889. )}
  890. </Stack>
  891. </Grid>
  892. </Grid>
  893. </Grid>
  894. <Grid item xs={12} md={12}>
  895. <Grid container>
  896. <Grid item xs={12} md={6}>
  897. <Grid container>
  898. <Grid item xs={12} md={12}>
  899. <Stack direction="column" spacing={1} sx={{mr:{md:1},mb:1}}>
  900. <InputLabel htmlFor="phone-signup">聯絡電話
  901. <span style={{color: '#f10000'}}>*</span>
  902. </InputLabel>
  903. <Stack direction="row">
  904. <OutlinedInput
  905. id="phoneCountryCode-login"
  906. type="phoneCountryCode"
  907. value={formik.values.phoneCountryCode}
  908. name="phoneCountryCode"
  909. // onBlur={formik.handleBlur}
  910. onChange={formik.handleChange}
  911. placeholder="國際區號"
  912. error={Boolean(formik.touched.phone && formik.errors.phone)}
  913. onBlur={formik.handleBlur}
  914. inputProps={{
  915. maxLength: 3,
  916. onKeyDown: (e) => {
  917. if (e.key === 'Enter') {
  918. e.preventDefault();
  919. }
  920. },
  921. }}
  922. sx={{width:'25%'}}
  923. />
  924. <OutlinedInput
  925. id="phone-login"
  926. type="phone"
  927. value={formik.values.phone}
  928. name="phone"
  929. // onBlur={formik.handleBlur}
  930. onChange={formik.handleChange}
  931. placeholder="聯絡電話"
  932. error={Boolean(formik.touched.phone && formik.errors.phone)}
  933. onBlur={formik.handleBlur}
  934. inputProps={{
  935. maxLength: 8,
  936. onKeyDown: (e) => {
  937. if (e.key === 'Enter') {
  938. e.preventDefault();
  939. }
  940. },
  941. }}
  942. sx={{width:'75%'}}
  943. />
  944. </Stack>
  945. {formik.touched.phone && formik.errors.phone && (
  946. <FormHelperText error id="helper-text-phone-signup">
  947. {formik.errors.phone}
  948. </FormHelperText>
  949. )}
  950. </Stack>
  951. </Grid>
  952. </Grid>
  953. </Grid>
  954. <Grid item xs={12} md={6}>
  955. <Grid container>
  956. <Grid item xs={12} md={12}>
  957. <Stack spacing={1} direction="column">
  958. <InputLabel htmlFor="fax-signup">傳真號碼</InputLabel>
  959. <Stack direction="row">
  960. <OutlinedInput
  961. error={Boolean(formik.touched.fax && formik.errors.fax)}
  962. id="faxCountryCode-login"
  963. type="faxCountryCode"
  964. value={formik.values.faxCountryCode}
  965. name="faxCountryCode"
  966. onChange={formik.handleChange}
  967. placeholder="國際區號"
  968. onBlur={formik.handleBlur}
  969. inputProps={{
  970. maxLength: 3,
  971. onKeyDown: (e) => {
  972. if (e.key === 'Enter') {
  973. e.preventDefault();
  974. }
  975. },
  976. }}
  977. sx={{width:'25%'}}
  978. />
  979. <OutlinedInput
  980. id="fax-login"
  981. type="fax"
  982. value={formik.values.fax}
  983. name="fax"
  984. onBlur={formik.handleBlur}
  985. onChange={formik.handleChange}
  986. placeholder="傳真號碼"
  987. inputProps={{
  988. maxLength: 8,
  989. onKeyDown: (e) => {
  990. if (e.key === 'Enter') {
  991. e.preventDefault();
  992. }
  993. },
  994. }}
  995. sx={{width:'75%'}}
  996. />
  997. </Stack>
  998. </Stack>
  999. </Grid>
  1000. </Grid>
  1001. </Grid>
  1002. </Grid>
  1003. </Grid>
  1004. <Grid item xs={12} md={12} mt={1} mb={1}>
  1005. <Grid container>
  1006. <Grid item xs={12} md={12}>
  1007. <Stack spacing={1} direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
  1008. <Typography display="inline" variant="h4" sx={{ color: 'primary.primary'}}>身份證明文件</Typography>
  1009. <Typography display="inline" variant="h6" sx={{ fontSize: 12,color: 'primary.primary'}}>請上傳你的 有效身份證明文件 的數碼檔案,以驗證你的身份。</Typography>
  1010. <Typography display="inline" variant="h6" sx={{ fontSize: 12,color: 'primary.primary'}}>如: 香港身份證; 護照; 中國內地身份證等</Typography>
  1011. <Stack mt={1} direction="row" justifyContent="flex-start" alignItems="center" spacing={2}>
  1012. <Button variant="contained" component="label" sx={{ fontSize: 12,height:'40px'}}>上傳身份證明文件
  1013. <input
  1014. accept="image/png, .jpg, .bmp, .pdf"
  1015. //className={classes.input}
  1016. id="contained-button-file"
  1017. multiple
  1018. type="file"
  1019. onChange={handleFileUpload}
  1020. style={{display: 'none'}}
  1021. />
  1022. </Button>
  1023. <Typography display="inline" variant="h6" sx={{ fontSize: 12, color: 'primary.primary'}}>如: 香港身份證; 護照; 中國內地身份證等</Typography>
  1024. </Stack>
  1025. {fileList !=null?
  1026. <UploadFileTable recordList={fileListData} setUpdateRows={setUpdateRows} />:null}
  1027. {/* <Stack mt={1} direction="row" justifyContent="flex-start" alignItems="center" spacing={2}>
  1028. <Button variant="contained" type="submit" sx={{ fontSize: 12,height:'25px'}}>Submit</Button>
  1029. <Button disabled={!formik.isValid} variant="contained" type="submit" sx={{ fontSize: 12,height:'25px'}}>Submit</Button>
  1030. </Stack> */}
  1031. </Stack>
  1032. </Grid>
  1033. </Grid>
  1034. </Grid>
  1035. </Grid>
  1036. <Grid item xs={12} md={12}>
  1037. <Grid container>
  1038. <Grid item xs={12} md={12}>
  1039. <Typography display="inline" variant="h4" sx={{ color: 'primary.primary'}}>
  1040. 條款和條件
  1041. <span style={{color: '#f10000'}}>*</span>
  1042. </Typography>
  1043. </Grid>
  1044. <Grid item xs={12} md={12}>
  1045. <Grid container>
  1046. <Grid item xs={12} md={12}>
  1047. <Typography height="80%" sx={{textAlign: "left",overflow: "scroll",borderRadius: "inherit", borderStyle: "solid",borderWidth: "1px",borderColor: "#0C489E"}}>
  1048. {termsAndCon}
  1049. </Typography>
  1050. </Grid>
  1051. </Grid>
  1052. <Grid item xs={12} s={12} md={12} lg={12}>
  1053. <Grid container>
  1054. <Grid item xs={6} s={6} md={2} lg={2}>
  1055. <Grid container>
  1056. <Grid item sx={{display: 'flex', alignItems: 'center'}}>
  1057. <Checkbox
  1058. checked={termsAndConAccept}
  1059. onChange={handleCheckBoxChange}
  1060. name="termsAndConAccept"
  1061. color="primary"
  1062. size="small"
  1063. />
  1064. <Typography>我接受</Typography>
  1065. </Grid>
  1066. </Grid>
  1067. </Grid>
  1068. <Grid item xs={6} s={6} md={2} lg={2}>
  1069. <Grid container>
  1070. <Grid item sx={{display: 'flex', alignItems: 'center'}}>
  1071. <Checkbox
  1072. checked={termsAndConNotAccept}
  1073. onChange={handleCheckBoxChange}
  1074. name="termsAndConNotAccept"
  1075. color="primary"
  1076. size="small"
  1077. />
  1078. <Typography>我不接受</Typography>
  1079. </Grid>
  1080. </Grid>
  1081. </Grid>
  1082. </Grid>
  1083. </Grid>
  1084. </Grid>
  1085. </Grid>
  1086. </Grid>
  1087. </Grid>
  1088. </Grid>
  1089. </FormGroup>
  1090. {/* Preview Form */}
  1091. <FormGroup id={"previewForm"} sx={{ display: props.step === 1 ? "" : "none"}}>
  1092. <Grid container spacing={3}>
  1093. <Grid item xs={12} md={12}>
  1094. <Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
  1095. <div style={{borderBottom: "3px solid #1A4399", width:"100%", margin_right: "15px"}}>
  1096. <Typography display="inline" variant="h3" sx={{ color: '#1A4399'}}>成為新的個人用戶</Typography>
  1097. </div>
  1098. {/* <Typography mt={0.25} variant="h6" sx={{ fontSize: 12,color: '#f10000'}}>註有*的項目必須輸入資料</Typography> */}
  1099. <Typography mt={0.25} variant="h4" sx={{ color: 'primary.primary'}}>你的登入資料</Typography>
  1100. {/* <Typography component={Link} to="/login" variant="body1" sx={{ textDecoration: 'none' }} color="primary">
  1101. Already have an account?
  1102. </Typography> */}
  1103. </Stack>
  1104. </Grid>
  1105. <Grid item xs={12} md={12}>
  1106. <Grid container spacing={2}>
  1107. <Grid item xs={12} >
  1108. <Stack spacing={2} direction="row">
  1109. <Typography>
  1110. 用戶登入名稱:
  1111. </Typography>
  1112. <Typography id="preview-username-login">
  1113. {formik.values.username}
  1114. </Typography>
  1115. </Stack>
  1116. </Grid>
  1117. <Grid item xs={12} mt={1} mb={1}>
  1118. <Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
  1119. <Typography display="inline" variant="h4" sx={{ color: 'primary.primary'}}>你的個人資料</Typography>
  1120. {/* <Typography component={Link} to="/login" variant="body1" sx={{ textDecoration: 'none' }} color="primary">
  1121. Already have an account?
  1122. </Typography> */}
  1123. </Stack>
  1124. </Grid>
  1125. <Grid item xs={12} md={12} >
  1126. <Stack spacing={1}>
  1127. <Typography>
  1128. 身份證明文件
  1129. </Typography>
  1130. </Stack>
  1131. </Grid>
  1132. <Grid item xs={12} md={6} >
  1133. <Stack spacing={1} direction="row">
  1134. <Typography>
  1135. 證件類別:
  1136. </Typography>
  1137. <Typography name = "preview-idDocType">
  1138. {selectedIdDocType.label}
  1139. </Typography>
  1140. </Stack>
  1141. </Grid>
  1142. <Grid item xs={12} md={6}>
  1143. <Stack spacing={1} direction="row">
  1144. <Typography>
  1145. 證件號碼:
  1146. </Typography>
  1147. <Typography id="idNo-login">
  1148. {formik.values.idNo} {selectedAddress5=="香港"?'('+formik.values.checkDigit+')':null}
  1149. </Typography>
  1150. </Stack>
  1151. </Grid>
  1152. <Grid item xs={12} md={6}>
  1153. <Stack spacing={1} direction="row">
  1154. <Typography>
  1155. 英文姓名:
  1156. </Typography>
  1157. <Typography id="preview-enName-signup">
  1158. {formik.values.enName}
  1159. </Typography>
  1160. </Stack>
  1161. </Grid>
  1162. <Grid item xs={12} md={6}>
  1163. <Stack spacing={1} direction="row">
  1164. <Typography>
  1165. 中文姓名:
  1166. </Typography>
  1167. <Typography id="preview-chName-signup">
  1168. {formik.values.chName}
  1169. </Typography>
  1170. </Stack>
  1171. </Grid>
  1172. <Grid item xs={12}>
  1173. <Stack spacing={1} direction="row">
  1174. <Typography>
  1175. 地址:
  1176. </Typography>
  1177. <Stack spacing={1} direction="column">
  1178. <Typography id="preview-address1-signup">
  1179. {formik.values.address1}
  1180. </Typography>
  1181. {formik.values.address2!=null?
  1182. <Typography id="preview-address2-signup">
  1183. {formik.values.address2}
  1184. </Typography>
  1185. :null}
  1186. {formik.values.address3!=null?
  1187. <Typography id="preview-address3-signup">
  1188. {formik.values.address3}
  1189. </Typography>
  1190. :null}
  1191. {selectedAddress5==("香港")?
  1192. <Typography id="preview-address4-signup">
  1193. 區域 (只適用於香港): {selectedAddress4}
  1194. </Typography>
  1195. :null}
  1196. <Typography id="preview-address5-signup">
  1197. 國家/地區: {selectedAddress5}
  1198. </Typography>
  1199. </Stack>
  1200. </Stack>
  1201. </Grid>
  1202. <Grid item xs={12} mt={1} mb={1}>
  1203. <Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
  1204. <Typography display="inline" variant="h4" sx={{ color: 'primary.primary'}}>你的聯絡資料</Typography>
  1205. </Stack>
  1206. </Grid>
  1207. <Grid item xs={12} md={12}>
  1208. <Stack spacing={1} direction="row">
  1209. <Typography>
  1210. 電郵:
  1211. </Typography>
  1212. <Typography id="preview-email-signup">
  1213. {formik.values.email}
  1214. </Typography>
  1215. </Stack>
  1216. </Grid>
  1217. <Grid item xs={12} md={6}>
  1218. <Stack spacing={1} direction="row">
  1219. <Typography>
  1220. 聯絡電話:
  1221. </Typography>
  1222. <Typography id="preview-phone-signup">
  1223. +{formik.values.phoneCountryCode} {formik.values.phone}
  1224. </Typography>
  1225. </Stack>
  1226. </Grid>
  1227. {formik.values.faxCountryCode!=""&&formik.values.fax!=""?
  1228. <Grid item xs={12} md={6}>
  1229. <Stack spacing={1} direction="row">
  1230. <Typography>
  1231. 傳真號碼:
  1232. </Typography>
  1233. <Typography id="preview-fax-signup">
  1234. +{formik.values.faxCountryCode} {formik.values.fax}
  1235. </Typography>
  1236. </Stack>
  1237. </Grid>
  1238. :null}
  1239. <Grid item xs={12} md={12} mt={1} mb={1}>
  1240. <Grid container>
  1241. <Grid item xs={12} md={12}>
  1242. <Stack spacing={1} direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
  1243. <Typography display="inline" variant="h4" sx={{ color: 'primary.primary'}}>身份證明文件</Typography>
  1244. {fileList !=null?
  1245. <UploadFileTable recordList={fileListData} updateRows={updateRows} />:null}
  1246. </Stack>
  1247. </Grid>
  1248. </Grid>
  1249. </Grid>
  1250. </Grid>
  1251. </Grid>
  1252. </Grid>
  1253. </FormGroup>
  1254. {/* Submit page */}
  1255. <FormGroup id={"submitForm"} sx={{ display: props.step === 2 ? "" : "none"}}>
  1256. <Grid container spacing={3}>
  1257. {isLoading ?
  1258. <LoadingComponent/>:
  1259. <Grid item xs={12}>
  1260. {checkUpload?
  1261. // SUCCESS page
  1262. <Stack mt={1} direction="column" justifyContent="flex-start" alignItems="center" spacing={2}>
  1263. <CheckCircleOutlineIcon color="success" sx={{width:"200px",height:"200px"}}/>
  1264. <Typography display="inline" variant="h4">帳戶申請已成功提交。</Typography>
  1265. <Typography display="inline" variant="h4">驗證電郵將發送到你的電郵地址,請要指示完成驗證及登入系統。</Typography>
  1266. <Button variant="outlined" component={Link} to="/login" sx={{ fontSize: 20,height:'60px'}}>返回登入頁面</Button>
  1267. </Stack>
  1268. :
  1269. // ERROR page
  1270. <Stack mt={1} direction="column" justifyContent="flex-start" alignItems="center" spacing={2}>
  1271. {/* <Button disabled={true} hidden={true} variant="contained" type="submit" sx={{ fontSize: 12,height:'25px'}}>Submit</Button> */}
  1272. <CancelOutlinedIcon color="error" sx={{width:"200px",height:"200px"}}/>
  1273. <Typography display="inline" variant="h4">申請失敗,請稍後嘗試</Typography>
  1274. <Button color="error" variant="outlined" component={Link} to="/login" sx={{ fontSize: 20,height:'60px'}}>返回登入頁面</Button>
  1275. </Stack>
  1276. }
  1277. </Grid>
  1278. }
  1279. </Grid>
  1280. </FormGroup>
  1281. </form>
  1282. </FormikProvider>
  1283. );
  1284. }
  1285. export default CustomFormWizard;