Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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