選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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