|
- import { useEffect, useState, } from 'react';
-
- // material-ui
- import {
- Box,
- Button,
- FormControl,
- FormHelperText,
- Grid, IconButton,
- InputAdornment,
- InputLabel, OutlinedInput,
- Stack,
- Typography,
- FormGroup,
- TextField,
- Checkbox
- // MenuItem
- } from '@mui/material';
- import { useForm, } from 'react-hook-form'
- import Autocomplete from "@mui/material/Autocomplete";
-
- // third party
- import { useFormik, FormikProvider } from 'formik';
- import * as yup from 'yup';
- // import axios from "axios";
-
- // project import
- // import AnimateButton from 'components/@extended/AnimateButton';
-
- import { strengthColorChi, strengthIndicator } from 'utils/password-strength';
- // import {apiPath} from "auth/utils";
- import axios from "axios";
- import { POST_PUBLIC_USER_REGISTER, POST_CAPTCHA, GET_USERNAME } from "utils/ApiPathConst";
- // import * as HttpUtils from 'utils/HttpUtils';
- import * as ComboData from "utils/ComboData";
-
- import Loadable from 'components/Loadable';
- import { lazy } from 'react';
- const UploadFileTable = Loadable(lazy(() => import('./UploadFileTable')));
- const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent')));
- const PreviewUploadFileTable = Loadable(lazy(() => import('./PreviewUploadFileTable')));
- // import UploadFileTable from './UploadFileTable';
- // import LoadingComponent from "../../extra-pages/LoadingComponent";
-
- // assets
- import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons';
- import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
- import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined';
-
- import { Link } from 'react-router-dom';
- import * as HttpUtils from "../../../utils/HttpUtils"
- import LoopIcon from '@mui/icons-material/Loop';
- import { useTheme } from '@mui/material/styles';
- //import { Invaild } from 'utils/IconUtils';
- // ============================|| FIREBASE - REGISTER ||============================ //
-
- const BusCustomFormWizard = (props) => {
-
- const theme = useTheme()
- const [level, setLevel] = useState();
- const [showPassword, setShowPassword] = useState(false);
- const [showConfirmPassword, setshowConfirmPassword] = useState(false);
- const [fileList, setFileList] = useState([]);
- const [fileListData, setFileListData] = useState([]);
- const [checkUpload, setCheckUpload] = useState(false);
- const [isLoading, setLoding] = useState(true);
- const [updateRows, setUpdateRows] = useState([]);
- const [userNameList, setUserNameList] = useState([]);
-
- const [captcha, setCaptcha] = useState([]);
- const [captchaImg, setCaptchaImage] = useState([]);
-
- const handleClickShowPassword = () => {
- setShowPassword(!showPassword);
- };
- const handleClickShowConfirmPassword = () => {
- setshowConfirmPassword(!showConfirmPassword);
- };
-
- const handleMouseDownPassword = (event) => {
- event.preventDefault();
- };
-
- const changePassword = (value) => {
- const temp = strengthIndicator(value);
- setLevel(strengthColorChi(temp));
- };
-
- const [selectedAddress4, setSelectedAddress4] = useState(null);
- const [selectedAddress5, setSelectedAddress5] = useState(ComboData.country[0]);
- const [termsAndConAccept, setTermsAndConAccept] = useState(false);
- const [termsAndConNotAccept, setTermsAndConNotAccept] = useState(false);
- const [isValid, setisValid] = useState(false);
- const [checkCountry, setCheckCountry] = useState(false);
-
- const address4ComboList = ComboData.district;
- const address5ComboList = ComboData.country;
- const termsAndCon = "此網址由香港特別行政區政府物流服務署製作及管理。本署會盡力確保網址上的資料無誤,\n"
- + "但有絕對酌情權隨時刪除、暫停登載或編輯各項資料而無須給予任何理由。\n由於任何與網址"
- + "內資料有關的理由或原因,而導致出現申索、損失或損害,本署概不負責。\n使用者須自行評"
- + "估本網址所載或與本網址有關連的各項資料,並應在根據該等資料行事前,參照印行的香港"
- + "特別行政區憲報以核實該等資料,以及徵詢獨立意見。\n版權公告本網頁的內容,包括但不限"
- + "於所有文本、平面圖像、圖畫、圖片、照片以及數據或其他資料的匯編,均受版權保障。\n香"
- + "港特別行政區政府是本網頁內所有版權作品的擁有人,除非預先得到政府物流服務署的書面"
- + "授權,否則嚴禁複製、改編、分發、發布或向公眾提供該等版權作品。"
- const refType = "identification";
-
- useEffect(() => {
- changePassword('');
-
- // if (localStorage.getItem('checkCode') != null){
- // setCaptcha(localStorage.getItem('checkCode'));
- // setCaptchaImage(localStorage.getItem('base64Url'));
- // localStorage.setItem("checkCode",null);
- // localStorage.setItem("base64Url",null);
- // }else{
- onCaptchaChange();
- // }
- axios.get(`${GET_USERNAME}`)
- .then((response) => {
- if (response.status === 200) {
- setUserNameList(response.data);
- }
-
- })
- .catch(error => {
- console.log(error);
- return false;
- });
- }, []);
-
- const onCaptchaChange = () => {
- HttpUtils.post({
- url: POST_CAPTCHA,
- params: { width: 130, height: 40 },
- onSuccess: (responseData) => {
- localStorage.setItem("checkCode", responseData.checkCode);
- localStorage.setItem("base64Url", responseData.base64Url);
- setCaptcha(localStorage.getItem('checkCode'));
- setCaptchaImage(localStorage.getItem('base64Url'));
- }
- });
- }
-
- const checkDataField = (data) => {
- // console.log(data.brExpiryDate)
- if (data.username !== "" &&
- data.password !== "" &&
- data.confirmPassword !== "" &&
- data.password == data.confirmPassword &&
- // (data.enCompanyName !=="" || selectedAddress5 ==="內地")&&
- (data.chCompanyName !== "" || data.enCompanyName !== "") &&
- data.enName !== "" &&
- data.chName !== "" &&
- data.address1 !== "" &&
- data.email !== "" &&
- data.emailConfirm !== "" &&
- data.email == data.emailConfirm &&
- data.phone !== "" &&
- data.phoneCountryCode !== "" &&
- termsAndConAccept == true &&
- fileList.length !== 0 &&
- data.captchaField &&
- data.brNo !== "" &&
- data.brExpiryDate !== "" &&
- handlePassword(data.password) &&
- handleEmail(data.email) &&
- handlePhone(data.phone) &&
- handleUserName(data.username) &&
- handleCaptcha(data.captchaField)
- ) {
- setisValid(true)
- return isValid
- } else {
- setisValid(false)
- return isValid
- }
- };
-
- const handleCheckBoxChange = (event) => {
- console.log(event.target)
- if (event.target.name == 'termsAndConAccept') {
- setTermsAndConAccept(event.target.checked)
- setTermsAndConNotAccept(!event.target.checked)
- }
- if (event.target.name == 'termsAndConNotAccept') {
- setTermsAndConNotAccept(event.target.checked)
- setTermsAndConAccept(!event.target.checked)
- }
- };
-
- useEffect(() => {
- let updateRowList = new DataTransfer();
- var updateRowsIndex = updateRows.length;
- const saveFileList = [];
-
- if (updateRowsIndex != null) {
- for (let i = 0; i < updateRowsIndex; i++) {
- const file = updateRows[i]
- file.id = i;
- updateRowList.items.add(file);
- saveFileList.push(file);
- }
- let updatedFileList = updateRowList.files;
- setFileList(updatedFileList);
- setFileListData(saveFileList)
-
- }
-
- }, [updateRows]);
-
- const handleFileUpload = (event) => {
- let updateList = new DataTransfer();
- let currentFileList = fileListData;
- const uploadFileList = event.target.files;
- const saveFileList = [];
- var currentIndex = 0;
-
- if (currentFileList.length != null) {
- currentIndex = currentFileList.length;
- for (let i = 0; i < currentIndex; i++) {
- const file = currentFileList[i]
- // file.id = currentIndex;
- updateList.items.add(file);
- saveFileList.push(file);
- }
- }
-
- for (let i = 0; i < uploadFileList.length && currentIndex < 5; i++) {
- const file = event.target.files[i]
- let isDuplicate = false;
-
- // Check if the file name already exists in saveFileList
- for (let j = 0; j < saveFileList.length; j++) {
- if (saveFileList[j].name === file.name) {
- isDuplicate = true;
- break;
- }
- }
- if (!isDuplicate && i + currentIndex < 5) {
- file.id = currentIndex + i
- saveFileList.push(file)
- updateList.items.add(file);
- }
- console.log("currentIndex")
- console.log(currentIndex)
- }
- let updatedFileList = updateList.files;
-
- setFileListData(saveFileList)
- setFileList(updatedFileList);
- };
-
- useEffect(() => {
- props.setUpdateValid(isValid)
- }, [isValid])
-
- useEffect(() => {
- checkDataField(values)
- }, [selectedAddress4, selectedAddress5,
- termsAndConAccept, termsAndConNotAccept, fileList])
-
- useEffect(() => {
- props.step == 2 ? _onSubmit() : null;
- onCaptchaChange();
- checkDataField(values)
- }, [props.step])
-
- const { handleSubmit } = useForm({})
- const _onSubmit = () => {
- setLoding(true);
- values.address4 = selectedAddress4
- values.address5 = selectedAddress5
- // console.log(values)
- const busUserAddress = {
- "addressLine1": "",
- "addressLine2": "",
- "addressLine3": "",
- "district": "",
- "country": ""
- };
- busUserAddress.addressLine1 = values.address1
- busUserAddress.addressLine2 = values.address2
- busUserAddress.addressLine3 = values.address3
- busUserAddress.district = values.address4
- busUserAddress.country = values.address5
-
- const userFaxNo = {
- "countryCode": values.faxCountryCode,
- "faxNumber": values.fax,
- };
- const busUserContactTel = {
- "countryCode": values.phoneCountryCode,
- "phoneNumber": values.phone,
- };
- let tncFlag = false;
- if (termsAndConAccept) {
- tncFlag = true
- }
- if (termsAndConNotAccept) {
- tncFlag = false
- }
-
- const user = {
- username: values.username,
- password: values.password,
- name: values.username,
- enCompanyName: values.enCompanyName,
- chCompanyName: values.chCompanyName,
- emailBus: values.email,
- brNo: values.brNo,
- brExpiryDate: values.brExpiryDate,
- contactPerson: values.enName,
- tncFlag: tncFlag,
- type: "ORG"
- };
-
- var formData = new FormData();
- for (let i = 0; i < fileListData.length; i++) {
- const file = fileListData[i]
- formData.append("multipartFileList", file);
- }
- formData.append("refType", refType);
-
- for (const [key, value] of Object.entries(user)) {
- formData.append(key, value);
- }
-
- formData.append("userFaxNo", JSON.stringify(userFaxNo));
- formData.append("busUserContactTel", JSON.stringify(busUserContactTel));
- formData.append("busUserAddress", JSON.stringify(busUserAddress));
-
- if (isValid) {
- axios.post(POST_PUBLIC_USER_REGISTER, formData, {
- headers: {
- "Content-Type": "multipart/form-data"
- }
- })
- .then((response) => {
- console.log(response)
- setCheckUpload(true)
- setLoding(false);
- })
- .catch(error => {
- console.error(error);
- setLoding(false);
- });
- } else {
- setLoding(false);
- }
- }
-
- function handlePhone(phone) {
- if (phone.length < 8) {
- return false;
- } else {
- return true;
- }
- }
-
- function handleUserName(username) {
- var symbol = /^(?=.*[!@#%&])/;
- var space = /\s/;
- if (username.length < 6) {
- return false;
- } else if (username.match(symbol)) {
- return false;
- } else if (username.match(space)) {
- return false;
- } else {
- return true;
- }
- }
-
- function handleCaptcha(captchaField) {
- return captchaField == captcha;
- }
-
- function handlePassword(password) {
- let new_pass = password;
- // regular expressions to validate password
- var lowerCase = /[a-z]/g;
- var upperCase = /[A-Z]/g;
- var numbers = /[0-9]/g;
- var symbol = /^(?=.*[!@#%&])/;
- var space = /\s/;
- if (!new_pass.match(lowerCase)) {
- return false;
- } else if (!new_pass.match(upperCase)) {
- return false;
- } else if (!new_pass.match(numbers)) {
- return false;
- } else if (!new_pass.match(symbol)) {
- return false;
- } else if (new_pass.length < 8) {
- return false;
- }
- else if (new_pass.match(space)) {
- return false;
- } else {
- // console.log("password true")
- return true;
- }
- }
-
- function handleEmail(email) {
- var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
- if (!email.match(validRegex)) {
- return false;
- } else {
- return true;
- }
- }
-
- function displayErrorMsg(errorMsg) {
- return <Typography variant="errorMessage1">{errorMsg}</Typography>
- }
-
- const formik = useFormik({
- initialValues: ({
- username: '',
- enName: '',
- enCompanyName: '',
- chCompanyName: '',
- email: '',
- address1: '',
- address2: '',
- address3: '',
- password: '',
- confirmPassword: '',
- phone: '',
- phoneCountryCode: '852',
- submit: null,
- fax: '',
- faxCountryCode: '852',
- brExpiryDate: '',
- brNo: '',
- emailConfirm: '',
- captchaField: ''
- }),
-
- validationSchema: yup.object().shape({
- username: yup.string().min(6, displayErrorMsg('用戶名稱最少6位')).required(displayErrorMsg('請輸入用戶名稱')).test(
- "checkUserNameUsed",
- displayErrorMsg("此用戶登入名稱已被注冊,請使用其他用戶登入名稱"),
- function (value) {
- if (userNameList.some(item => item.username === value)) {
- return false
- } else {
- return true
- }
- }
- )
- .matches(/^[aA-zZ0-9\s]+$/, {message: displayErrorMsg("用戶名稱不包含特殊字符")})
- .matches(/^\S*$/, {message: displayErrorMsg('用戶名稱不包含空格')}),
- password: yup.string().min(8, displayErrorMsg('請輸入最少8位密碼')).required(displayErrorMsg('請輸入密碼'))
- .matches(/^\S*$/, {message: displayErrorMsg('密碼不包含空格')})
- .matches(/^(?=.*[a-z])/, {message: displayErrorMsg('請包括最少1個小寫字母')})
- .matches(/^(?=.*[A-Z])/, {message: displayErrorMsg('請包括最少1個大寫字母')})
- .matches(/^(?=.*[0-9])/, {message: displayErrorMsg('請包括最少1個數字')})
- .matches(/^(?=.*[!@#%&])/, {message: displayErrorMsg('請包括最少1個特殊字符')}),
- confirmPassword: yup.string().min(8, displayErrorMsg('請最少輸入8位密碼')).required(displayErrorMsg('請確認密碼')).oneOf([yup.ref('password'), null], displayErrorMsg('請輸入相同密碼')),
- enName: yup.string().max(255).required(displayErrorMsg('請輸入英文姓名')),
- enCompanyName: yup.string().matches(/^[^$^*()]+$/, {message: displayErrorMsg('No special characters $/^/*/(/)')}).when('chCompanyName', {
- is: (chCompanyName) => !chCompanyName || chCompanyName.length === 0,
- then: yup.string().required(displayErrorMsg('Please enter either English or Chinese name')),
- }),
- chCompanyName: yup.string().matches(/^[^$^*()]+$/, {message: displayErrorMsg('不包含特殊字符 $/^/*/(/)')}).when('enCompanyName', {
- is: (enCompanyName) => !enCompanyName || enCompanyName.length === 0,
- then: yup.string().required(displayErrorMsg('請輸入英文或中文名稱')),
- }),
- chName: yup.string().max(255).required(displayErrorMsg('請輸入中文姓名')),
- address1: yup.string().max(255).required(displayErrorMsg('請輸入第一行地址')),
- address2: yup.string().max(255).required(displayErrorMsg('請輸入第二行地址')),
- address3: yup.string().max(255).required(displayErrorMsg('請輸入第三行地址')),
- email: yup.string().email(displayErrorMsg('請輸入電郵格式')).max(255).required(displayErrorMsg('請輸入電郵')),
- emailConfirm: yup.string().email(displayErrorMsg('請輸入電郵格式')).max(255).required(displayErrorMsg('請輸入電郵')).oneOf([yup.ref('email'), null], displayErrorMsg('請輸入相同電郵')),
- phoneCountryCode: yup.string().min(2, displayErrorMsg('請輸入最少2位數字')).required(displayErrorMsg('請輸入國際區號')),
- faxCountryCode: yup.string().min(2, displayErrorMsg('請輸入最少2位數字')),
- phone: yup.string().min(8, displayErrorMsg('請輸入最少8位數字')).required(displayErrorMsg('請輸入聯絡電話')),
- fax: yup.string().min(8, displayErrorMsg('請輸入最少8位數字')),
- brExpiryDate: yup.date().min(new Date().toISOString().split("T")[0], displayErrorMsg('請輸入商業登記證有效日期')).max("2099-12-31", displayErrorMsg('請輸入商業登記證有效日期')).required(displayErrorMsg('請輸入商業登記證有效日期')),
- brNo: yup.string().min(8, displayErrorMsg('請輸入商業登記證號碼')).required(displayErrorMsg('請輸入商業登記證號碼')),
- captchaField: yup.string().required(displayErrorMsg('請輸入驗證')).oneOf([captcha], displayErrorMsg('請輸入有效驗證')),
- }, ['enCompanyName', 'chCompanyName']),
-
- });
-
- const handleReset = (resetForm) => {
- resetForm();
- setSelectedAddress4("")
- setSelectedAddress5(ComboData.country[0])
- setCheckCountry(false)
- setFileList([])
- setFileListData([])
- onCaptchaChange()
- };
-
- const { values } = formik
- useEffect(() => {
- checkDataField(values)
- }, [values])
-
- return (
- <FormikProvider value={formik}>
- <form onSubmit={handleSubmit(_onSubmit)}>
- {/* Input Form */}
- <FormGroup id={"inputForm"} sx={{ display: props.step === 0 ? "" : "none" }}>
- <Grid container spacing={3}>
- <Grid item xs={12} md={12}>
- <Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
- <Button variant="outlined" type="reset" onClick={handleReset.bind(null, formik.resetForm)} sx={{ height: '40px' }}><Typography variant="h5">重置</Typography></Button>
- <div style={{ borderBottom: "3px solid #1A4399", width: "100%", margin_right: "15px" }}>
- <Typography display="inline" variant="h3" sx={{ color: '#1A4399' }}>成為新的機構/公司用戶</Typography>
- </div>
- <Typography mt={0.25} variant="h6" sx={{ color: '#f10000' }}>註有*的項目必須輸入資料</Typography>
- <Typography mt={0.25} variant="h4" sx={{ color: 'primary.primary' }}>你的登入資料</Typography>
- {/* <Typography component={Link} to="/login" variant="body1" sx={{ textDecoration: 'none' }} color="primary">
- Already have an account?
- </Typography> */}
- </Stack>
- </Grid>
- <Grid item xs={12} md={12}>
- <Grid container spacing={1}>
- <Grid item xs={12} md={12} >
- <Stack spacing={1}>
- <InputLabel htmlFor="username-signup">
- <Typography variant="h5">
- 用戶登入名稱
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- </InputLabel>
- <OutlinedInput
- id="username-login"
- type="text"
- value={formik.values.username.trim()}
- name="username"
- onChange={formik.handleChange}
- placeholder="用戶登入名稱"
- fullWidth
- error={Boolean(formik.touched.username && formik.errors.username)}
- onBlur={formik.handleBlur}
- inputProps={{
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- />
- {formik.touched.username && formik.errors.username && (
- <FormHelperText error id="helper-text-username-signup">
- {formik.errors.username}
- </FormHelperText>
- )}
- </Stack>
- </Grid>
- <Grid item xs={12} md={12}>
- <Grid container>
- <Grid item xs={12} md={6} >
- <Stack spacing={1} sx={{ mr: { md: 1 }, mb: 1 }}>
- <Stack direction="row" justifyContent="space-between">
- <InputLabel htmlFor="password-signup">
- <Typography variant="h5">
- 密碼
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- </InputLabel>
- </Stack>
- <OutlinedInput
- fullWidth
- error={Boolean(formik.touched.password && formik.errors.password)}
- id="password-signup"
- type={showPassword ? 'text' : 'password'}
- value={formik.values.password.trim()}
- name="password"
- onChange={(e) => {
- formik.handleChange(e);
- changePassword(e.target.value);
- }}
- endAdornment={
- <InputAdornment position="end">
- <IconButton
- aria-label="toggle password visibility"
- onClick={handleClickShowPassword}
- onMouseDown={handleMouseDownPassword}
- edge="end"
- size="large"
- >
- {showPassword ? <EyeOutlined /> : <EyeInvisibleOutlined />}
- </IconButton>
- </InputAdornment>
- }
- placeholder="密碼"
- onBlur={formik.handleBlur}
- inputProps={{
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- />
- {formik.touched.password && formik.errors.password && (
- <FormHelperText error id="helper-text-password-signup">
- {formik.errors.password}
- </FormHelperText>
- )}
- </Stack>
- <FormControl fullWidth sx={{ mt: 2 }}>
- <Grid container spacing={2} alignItems="center">
- <Grid item>
- <Box sx={{ bgcolor: level?.color, width: 85, height: 8, borderRadius: '7px' }} />
- </Grid>
- <Grid item>
- <Typography variant="subtitle1">
- {level?.label}
- </Typography>
- </Grid>
- </Grid>
- </FormControl>
- </Grid>
- <Grid item xs={12} md={6} >
- <Stack spacing={1}>
- <InputLabel htmlFor="confirmPassword-signup">
- <Typography variant="h5">
- 確認密碼
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- </InputLabel>
- <OutlinedInput
- id="confirmPassword-login"
- type={showConfirmPassword ? 'text' : 'password'}
- value={formik.values.confirmPassword.trim()}
- name="confirmPassword"
- onBlur={formik.handleBlur}
- onChange={(e) => {
- formik.handleChange(e);
- // changePassword(e.target.value);
- }}
- inputProps={{
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- endAdornment={
- <InputAdornment position="end">
- <IconButton
- aria-label="toggle password visibility"
- onClick={handleClickShowConfirmPassword}
- onMouseDown={handleMouseDownPassword}
- edge="end"
- size="large"
- >
- {showConfirmPassword ? <EyeOutlined /> : <EyeInvisibleOutlined />}
- </IconButton>
- </InputAdornment>
- }
- placeholder="確認密碼"
- fullWidth
- error={Boolean(formik.touched.confirmPassword && formik.errors.confirmPassword)}
- />
- {formik.touched.confirmPassword && formik.errors.confirmPassword && (
- <FormHelperText error id="helper-text-confirmPassword-signup">
- {formik.errors.confirmPassword}
- </FormHelperText>
- )}
- </Stack>
- <Grid container spacing={2} alignItems="center">
- <Grid item>
- <Typography variant="subtitle1">
- <br />
- •至少8個字元,字元越多越好 <br />
- •字母和數字的混合<br />
- •英文字母大寫與小寫的混合<br />
- •至少包含一個特殊符號,例如,@ # ?
- </Typography>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- <Grid item xs={12} mt={1} mb={1}>
- <Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
- <Typography display="inline" variant="h4" sx={{ color: '#1A4399' }}>你的機構/公司資料</Typography>
- {/* <Typography component={Link} to="/login" variant="body1" sx={{ textDecoration: 'none' }} color="primary">
- Already have an account?
- </Typography> */}
- </Stack>
- </Grid>
-
- <Grid item xs={12} md={12}>
- <Typography variant="subtitle1">
- <br />
- •請輸入機構/公司英文名稱或中文名稱<br />
- •Please enter the English/Chinese name of the organisation/company
- </Typography>
- </Grid>
- <Grid item xs={12} md={6}>
- <Stack spacing={1}>
- <InputLabel htmlFor="enCompanyName-signup">
- <Typography variant="h5">
- 機構/公司英文名稱
- </Typography>
- </InputLabel>
- <OutlinedInput
- id="enCompanyName-login"
- type="enCompanyName"
- value={formik.values.enCompanyName}
- name="enCompanyName"
- onChange={formik.handleChange}
- placeholder="與商業登記證相同"
- fullWidth
- error={Boolean(formik.touched.enCompanyName && formik.errors.enCompanyName && selectedAddress5 !== "內地")}
- onBlur={formik.handleBlur}
- inputProps={{
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- />
- {formik.touched.enCompanyName && formik.errors.enCompanyName && selectedAddress5 !== "內地" && (
- <FormHelperText error id="helper-text-enCompanyName-signup">
- {formik.errors.enCompanyName}
- </FormHelperText>
- )}
- </Stack>
- </Grid>
- <Grid item xs={12} md={6}>
- <Stack spacing={1}>
- <InputLabel htmlFor="chCompanyName-signup">
- <Typography variant="h5">
- 機構/公司中文名稱
- </Typography>
- </InputLabel>
- <OutlinedInput
- fullWidth
- error={Boolean(formik.touched.chCompanyName && formik.errors.chCompanyName)}
- id="chCompanyName-signup"
- type="text"
- value={formik.values.chCompanyName.trim()}
- name="chCompanyName"
- onChange={formik.handleChange}
- placeholder="與商業登記證相同"
- onBlur={formik.handleBlur}
- inputProps={{
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- />
- {formik.touched.chCompanyName && formik.errors.chCompanyName && (
- <FormHelperText error id="helper-text-chCompanyName-signup">
- {formik.errors.chCompanyName}
- </FormHelperText>
- )}
- </Stack>
- </Grid>
- <Grid item xs={12} md={6}>
- <Stack spacing={1}>
- <InputLabel htmlFor="brNo-signup">
- <Typography variant="h5">
- 商業登記證號碼
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- </InputLabel>
- <OutlinedInput
- fullWidth
- error={Boolean(formik.touched.brNo && formik.errors.brNo)}
- id="brNo-signup"
- type="text"
- value={formik.values.brNo.trim()}
- name="brNo"
- onChange={formik.handleChange}
- onBlur={formik.handleBlur}
- placeholder="與商業登記證相同"
- inputProps={{
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- />
- {formik.touched.brNo && formik.errors.brNo && (
- <FormHelperText error id="helper-text-brNo-signup">
- {formik.errors.brNo}
- </FormHelperText>
- )}
- </Stack>
- </Grid>
- <Grid item xs={12} md={6}>
- <Stack spacing={1}>
- <InputLabel htmlFor="brExpiryDate-signup">
- <Typography variant="h5">
- 商業登記證有效日期
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- </InputLabel>
- <OutlinedInput
- fullWidth
- error={Boolean(formik.touched.brExpiryDate && formik.errors.brExpiryDate)}
- id="brExpiryDate-signup"
- type="date"
- value={formik.values.brExpiryDate}
- name="brExpiryDate"
- onChange={formik.handleChange}
- onBlur={formik.handleBlur}
- placeholder="與商業登記證相同"
- inputProps={{
- max: "2099-12-31",
- min: new Date().toISOString().split("T")[0],
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- />
- {formik.touched.brExpiryDate && formik.errors.brExpiryDate && (
- <FormHelperText error id="helper-text-brExpiryDate-signup">
- {formik.errors.brExpiryDate}
- </FormHelperText>
- )}
- </Stack>
- </Grid>
- <Grid item xs={12}>
- <Stack spacing={1}>
- <InputLabel htmlFor="address1-signup">
- <Typography variant="h5">
- 地址
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- </InputLabel>
- <OutlinedInput
- fullWidth
- error={Boolean(formik.touched.address1 && formik.errors.address1)}
- id="address1-signup"
- value={formik.values.address1}
- name="address1"
- onChange={formik.handleChange}
- placeholder="第一行"
- onBlur={formik.handleBlur}
- inputProps={{
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- />
- <OutlinedInput
- fullWidth
- error={Boolean(formik.touched.address2 && formik.errors.address2)}
- id="address2-signup"
- value={formik.values.address2}
- name="address2"
- onChange={formik.handleChange}
- placeholder="第二行"
- inputProps={{
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- />
- <OutlinedInput
- fullWidth
- error={Boolean(formik.touched.address3 && formik.errors.address3)}
- id="address3-signup"
- value={formik.values.address3}
- name="address3"
- onChange={formik.handleChange}
- placeholder="第三行"
- inputProps={{
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- />
- <Autocomplete
- disablePortal
- id="address4-combo"
- value={selectedAddress4}
- options={address4ComboList}
- disabled={checkCountry}
- onChange={(event, newValue) => {
- setSelectedAddress4(newValue);
- }}
- sx={{ "& .MuiInputBase-root": { height: "41px" }, "#address4-combo": { padding: "0px 0px 0px 0px" }, "& .MuiAutocomplete-endAdornment": { top: "auto" }, }}
- renderInput={(params) => <TextField {...params} placeholder="區域 (只適用於香港)" />}
- />
- <Autocomplete
- disablePortal
- id="address5-combo"
- value={selectedAddress5}
- options={address5ComboList}
- onChange={(event, newValue) => {
- if (newValue !== null) {
- setSelectedAddress5(newValue);
- if (newValue == '香港') {
- setCheckCountry(false)
- } else {
- setSelectedAddress4("");
- setCheckCountry(true)
- }
- } else {
- setSelectedAddress4("");
- setCheckCountry(true)
- }
- }}
-
- sx={{ "& .MuiInputBase-root": { height: "41px" }, "#address5-combo": { padding: "0px 0px 0px 0px" }, "& .MuiAutocomplete-endAdornment": { top: "auto" }, }}
- renderInput={(params) => <TextField {...params} placeholder="國家/地區" />}
- />
- {formik.touched.address1 && formik.errors.address1 && (
- <FormHelperText error id="helper-text-address1-signup">
- {formik.errors.address1}
- </FormHelperText>
- )}
- {formik.touched.address2 && formik.errors.address2 && (
- <FormHelperText error id="helper-text-address2-signup">
- {formik.errors.address2}
- </FormHelperText>
- )}
- {formik.touched.address3 && formik.errors.address3 && (
- <FormHelperText error id="helper-text-address3-signup">
- {formik.errors.address3}
- </FormHelperText>
- )}
- </Stack>
- </Grid>
- <Grid item xs={12} mt={1} mb={1}>
- <Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
- <Typography display="inline" variant="h4" sx={{ color: 'primary.primary' }}>你的聯絡資料</Typography>
- </Stack>
- </Grid>
- <Grid item xs={12} md={12}>
- <Stack spacing={1}>
- <InputLabel htmlFor="enName-signup">
- <Typography variant="h5">
- 姓名
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- </InputLabel>
- <OutlinedInput
- id="enName-login"
- type="enName"
- value={formik.values.enName}
- name="enName"
- onChange={formik.handleChange}
- placeholder=""
- fullWidth
- error={Boolean(formik.touched.enName && formik.errors.enName)}
- onBlur={formik.handleBlur}
- inputProps={{
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- />
- {formik.touched.enName && formik.errors.enName && (
- <FormHelperText error id="helper-text-enName-signup">
- {formik.errors.enName}
- </FormHelperText>
- )}
- </Stack>
- </Grid>
- <Grid item xs={12} md={12}>
- <Grid container>
- <Grid item xs={12} md={6}>
- <Stack spacing={1} sx={{ mr: { md: 1 }, mb: 1 }}>
- <InputLabel htmlFor="email-signup">
- <Typography variant="h5">
- 電郵
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- </InputLabel>
- <OutlinedInput
- fullWidth
- error={Boolean(formik.touched.email && formik.errors.email)}
- id="email-login"
- type="email"
- value={formik.values.email.trim()}
- name="email"
- onChange={formik.handleChange}
- placeholder="電郵"
- onBlur={formik.handleBlur}
- inputProps={{
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- />
- {formik.touched.email && formik.errors.email && (
- <FormHelperText error id="helper-text-email-signup">
- {formik.errors.email}
- </FormHelperText>
- )}
- </Stack>
- </Grid>
- <Grid item xs={12} md={6}>
- <Stack spacing={1} >
- <InputLabel htmlFor="emailConfirm-signup">
- <Typography variant="h5">
- 確認電郵
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- </InputLabel>
- <OutlinedInput
- fullWidth
- error={Boolean(formik.touched.emailConfirm && formik.errors.emailConfirm)}
- id="emailConfirm-login"
- type="email"
- value={formik.values.emailConfirm.trim()}
- name="emailConfirm"
- // onBlur={formik.handleBlur}
- onChange={formik.handleChange}
- placeholder="確認電郵"
- onBlur={formik.handleBlur}
- inputProps={{
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- />
- {formik.touched.emailConfirm && formik.errors.emailConfirm && (
- <FormHelperText error id="helper-text-emailConfirm-signup">
- {formik.errors.emailConfirm}
- </FormHelperText>
- )}
- </Stack>
- </Grid>
- </Grid>
- </Grid>
- <Grid item xs={12} md={12}>
- <Grid container>
- <Grid item xs={12} md={6}>
- <Grid container>
- <Grid item xs={12} md={12}>
- <Stack direction="column" spacing={1} sx={{ mr: { md: 1 }, mb: 1 }}>
- <InputLabel htmlFor="phone-signup">
- <Typography variant="h5">
- 聯絡電話
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- </InputLabel>
- <Stack direction="row">
- <OutlinedInput
- id="phoneCountryCode-login"
- type="phoneCountryCode"
- value={formik.values.phoneCountryCode.trim()}
- name="phoneCountryCode"
- // onBlur={formik.handleBlur}
- // onChange={formik.handleChange}
- onChange={(event) => {
- const value = event.target.value;
- if (value.match(/[^0-9]/)) {
- return event.preventDefault();
- }
- formik.setFieldValue("phoneCountryCode", value);
- }}
- placeholder="國際區號"
- error={Boolean(formik.touched.phone && formik.errors.phone)}
- onBlur={formik.handleBlur}
- inputProps={{
- maxLength: 3,
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- sx={{ width: '25%' }}
- />
- <OutlinedInput
- id="phone-login"
- type="phone"
- value={formik.values.phone.trim()}
- name="phone"
- onBlur={formik.handleBlur}
- // onChange={formik.handleChange}
- onChange={(event) => {
- const value = event.target.value;
- if (value.match(/[^0-9]/)) {
- return event.preventDefault();
- }
- formik.setFieldValue("phone", value);
- }}
- placeholder="聯絡電話"
- error={Boolean(formik.touched.phone && formik.errors.phone)}
- inputProps={{
- maxLength: 11,
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- sx={{ width: '75%' }}
- />
- </Stack>
- {formik.touched.phone && formik.errors.phone && (
- <FormHelperText error id="helper-text-phone-signup">
- {formik.errors.phone}
- </FormHelperText>
- )}
- </Stack>
- </Grid>
- </Grid>
- </Grid>
- <Grid item xs={12} md={6}>
- <Grid container>
- <Grid item xs={12} md={12}>
- <Stack spacing={1} direction="column">
- <InputLabel htmlFor="fax-signup">
- <Typography variant="h5">
- 傳真號碼
- </Typography>
- </InputLabel>
- <Stack direction="row">
- <OutlinedInput
- error={Boolean(formik.touched.fax && formik.errors.fax)}
- id="faxCountryCode-login"
- type="faxCountryCode"
- value={formik.values.faxCountryCode.trim()}
- name="faxCountryCode"
- // onBlur={formik.handleBlur}
- // onChange={formik.handleChange}
- onChange={(event) => {
- const value = event.target.value;
- if (value.match(/[^0-9]/)) {
- return event.preventDefault();
- }
- formik.setFieldValue("faxCountryCode", value);
- }}
- placeholder="國際區號"
- inputProps={{
- maxLength: 3,
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- sx={{ width: '25%' }}
- />
- <OutlinedInput
- id="fax-login"
- type="fax"
- value={formik.values.fax.trim()}
- name="fax"
- // onBlur={formik.handleBlur}
- // onChange={formik.handleChange}
- onChange={(event) => {
- const value = event.target.value;
- if (value.match(/[^0-9]/)) {
- return event.preventDefault();
- }
- formik.setFieldValue("fax", value);
- }}
- placeholder="傳真號碼"
- inputProps={{
- maxLength: 8,
- onKeyDown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- }
- },
- }}
- sx={{ width: '75%' }}
- />
- </Stack>
- </Stack>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- <Grid item xs={12} md={12} mt={1} mb={1}>
- <Grid container>
- <Grid item xs={12} md={12}>
- <Stack spacing={1} direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
- <Typography display="inline" variant="h4" sx={{ color: 'primary.primary' }}>商業登記證及其他文件
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- <Typography display="inline" variant="h6" sx={{ color: 'primary.primary' }}>請上傳你的 有效商業登記證及其他文件 的數碼檔案,以驗證你的身份。</Typography>
- {/* <Typography display="inline" variant="h6" sx={{ fontSize: 12,color: 'primary.primary'}}>如: 香港身份證; 護照; 中國內地身份證等</Typography> */}
- <Stack mt={1} direction="row" justifyContent="flex-start" alignItems="center" spacing={2}>
- <Button variant="contained" component="label" sx={{ height: '40px' }}><Typography variant="h6">上傳商業登記證及其他文件</Typography>
- <input
- accept="image/png, .jpg, .bmp, .pdf"
- //className={classes.input}
- id="contained-button-file"
- multiple
- type="file"
- onChange={handleFileUpload}
- style={{ display: 'none' }}
- />
- </Button>
- {/* <Typography display="inline" variant="h6" sx={{ fontSize: 12, color: 'primary.primary'}}></Typography> */}
- </Stack>
- {fileList != null ?
- <UploadFileTable key="uploadTable" recordList={fileListData} setUpdateRows={setUpdateRows} /> : null}
- {/* <Stack mt={1} direction="row" justifyContent="flex-start" alignItems="center" spacing={2}>
- <Button variant="contained" type="submit" sx={{ fontSize: 12,height:'25px'}}>Submit</Button>
- <Button disabled={!formik.isValid} variant="contained" type="submit" sx={{ fontSize: 12,height:'25px'}}>Submit</Button>
- </Stack> */}
- </Stack>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- <Grid item xs={12} md={12}>
- <Grid container>
- <Grid item xs={12} md={12}>
- <Typography display="inline" variant="h4" sx={{ color: 'primary.primary' }}>
- 條款和條件
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- </Grid>
- <Grid item xs={12} md={12}>
- <Grid container>
- <Grid item xs={12} md={12}>
- <Typography variant="h6" height="80%" sx={{ textAlign: "left", overflow: "scroll", borderRadius: "inherit", borderStyle: "solid", borderWidth: "1px", borderColor: "#0C489E" }}>
- {termsAndCon}
- </Typography>
- </Grid>
- </Grid>
- <Grid item xs={12} s={12} md={12} lg={12}>
- <Grid container>
- <Grid item xs={6} s={6} md={2} lg={2}>
- <Grid container>
- <Grid item sx={{ display: 'flex', alignItems: 'center' }}>
- <Checkbox
- checked={termsAndConAccept}
- onChange={handleCheckBoxChange}
- name="termsAndConAccept"
- color="primary"
- size="small"
- />
- <Typography variant="h5">我接受</Typography>
- </Grid>
- </Grid>
- </Grid>
- <Grid item xs={6} s={6} md={2} lg={2}>
- <Grid container>
- <Grid item sx={{ display: 'flex', alignItems: 'center' }}>
- <Checkbox
- checked={termsAndConNotAccept}
- onChange={handleCheckBoxChange}
- name="termsAndConNotAccept"
- color="primary"
- size="small"
- />
- <Typography variant="h5">我不接受</Typography>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- <Grid item xs={12} lg={12}>
- <Grid container>
- <Stack direction="column">
- <Typography display="inline" variant="h4" sx={{ color: 'primary.primary' }}>
- 驗證
- <span style={{ color: '#f10000' }}>*</span>
- </Typography>
- <Stack spacing={1} direction="row">
- <Grid item xs={5} lg={5} style={{ "border": "1px solid black" }}>
- <img src={captchaImg} alt="" />
- </Grid>
- <Grid item xs={1} lg={1} style={{ "border": "0px solid black" }}>
- <IconButton aria-label="refrashCaptcha" size="large" onClick={() => { onCaptchaChange() }}>
- <LoopIcon fontSize="inherit" />
- </IconButton>
- </Grid>
- <Grid item xs={6} lg={6}>
- <OutlinedInput
- fullWidth
- id="captchaField"
- type="text"
- value={formik.values.captchaField.trim()}
- onBlur={formik.handleBlur}
- error={Boolean(formik.touched.captchaField && formik.errors.captchaField)}
- name="captchaField"
- onChange={(event) => {
- const value = event.target.value;
- formik.setFieldValue("captchaField", value);
- }}
- sx={{ width: '75%' }}
- />
- </Grid>
- </Stack>
- {formik.touched.captchaField && formik.errors.captchaField && (
- <FormHelperText error id="helper-text-captcha-signup">
- {formik.errors.captchaField}
- </FormHelperText>
- )}
- </Stack>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- </FormGroup>
- {/* Preview Form */}
- <FormGroup id={"previewForm"} sx={{ display: props.step === 1 ? "" : "none" }}>
- <Grid container spacing={2}>
- <Grid item xs={12}>
- <Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
- <div style={{ borderBottom: "3px solid #1A4399", width: "100%", margin_right: "15px" }}>
- <Typography display="inline" variant="h3" sx={{ color: '#1A4399' }}>成為新的機構/公司用戶</Typography>
- </div>
- {/* <Typography mt={0.25} variant="h6" sx={{ fontSize: 12,color: '#f10000'}}>註有*的項目必須輸入資料</Typography> */}
- <Typography mt={0.25} variant="h4" sx={{ color: 'primary.primary' }}>你的登入資料</Typography>
- {/* <Typography component={Link} to="/login" variant="body1" sx={{ textDecoration: 'none' }} color="primary">
- Already have an account?
- </Typography> */}
- </Stack>
- </Grid>
- <Grid item xs={12}>
- <Grid container spacing={1}>
- <Grid item xs={12} >
- <Stack spacing={1} direction="row">
- <Typography variant="h5" color={theme.palette.grey[600]}>
- 用戶登入名稱:
- </Typography>
- <Typography variant="h5" id="preview-username-login">
- {formik.values.username}
- </Typography>
- </Stack>
- </Grid>
- <Grid item xs={12} mt={1} mb={1}>
- <Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
- <Typography display="inline" variant="h4" sx={{ color: '#1A4399' }}>你的機構/公司資料</Typography>
- {/* <Typography component={Link} to="/login" variant="body1" sx={{ textDecoration: 'none' }} color="primary">
- Already have an account?
- </Typography> */}
- </Stack>
- </Grid>
-
- <Grid item xs={12} md={6}>
- <Stack spacing={1} direction="row">
- <Typography variant="h5" color={theme.palette.grey[600]}>
- 機構/公司英文名稱:
- </Typography>
- <Typography variant="h5" id="preview-enCompanyName-signup">
- {formik.values.enCompanyName}
- </Typography>
- </Stack>
- </Grid>
- <Grid item xs={12} md={6}>
- <Stack spacing={1} direction="row">
- <Typography variant="h5" color={theme.palette.grey[600]}>
- 機構/公司中文名稱:
- </Typography>
- <Typography variant="h5" id="preview-chCompanyName-signup">
- {formik.values.chCompanyName}
- </Typography>
- </Stack>
- </Grid>
-
- <Grid item xs={12} md={12} >
- <Stack spacing={1}>
- <Typography variant="h5" color={theme.palette.grey[600]}>
- 商業登記證
- </Typography>
- </Stack>
- </Grid>
-
- <Grid item xs={12} md={6}>
- <Stack spacing={1} direction="row">
- <Typography variant="h5" color={theme.palette.grey[600]}>
- 商業登記證號碼:
- </Typography>
- <Typography variant="h5" id="brNo-login">
- {formik.values.brNo}
- </Typography>
- </Stack>
- </Grid>
- <Grid item xs={12} md={6}>
- <Stack spacing={1} direction="row">
- <Typography variant="h5" color={theme.palette.grey[600]}>
- 商業登記證有效日期:
- </Typography>
- <Typography variant="h5" id="brExpiryDate-login">
- {formik.values.brExpiryDate}
- </Typography>
- </Stack>
- </Grid>
-
- <Grid item xs={12}>
- <Stack spacing={1} direction="row">
- <Typography variant="h5" color={theme.palette.grey[600]}>
- 地址:
- </Typography>
- <Stack spacing={1} direction="column">
- <Typography variant="h5" id="preview-address1-signup">
- {formik.values.address1}
- </Typography>
- {formik.values.address2 != null ?
- <Typography variant="h5" id="preview-address2-signup">
- {formik.values.address2}
- </Typography>
- : null}
- {formik.values.address3 != null ?
- <Typography variant="h5" id="preview-address3-signup">
- {formik.values.address3}
- </Typography>
- : null}
- {selectedAddress5 == ("香港") ?
- <Stack direction="row">
- <Typography variant="h5" color={theme.palette.grey[600]} id="preview-address4-signup">
- 區域 (只適用於香港):
- </Typography>
- <Typography variant="h5">
- {selectedAddress4}
- </Typography>
- </Stack>
- : null}
- <Stack direction="row">
- <Typography variant="h5" color={theme.palette.grey[600]} id="preview-address5-signup">
- 國家/地區:
- </Typography>
- <Typography variant="h5">
- {selectedAddress5}
- </Typography>
- </Stack>
- </Stack>
- </Stack>
- </Grid>
- <Grid item xs={12} mt={1} mb={1}>
- <Stack direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
- <Typography display="inline" variant="h4" sx={{ color: 'primary.primary' }}>你的聯絡資料</Typography>
- </Stack>
- </Grid>
- <Grid item xs={12} md={12}>
- <Stack spacing={1} direction="row">
- <Typography variant="h5" color={theme.palette.grey[600]}>
- 英文名稱:
- </Typography>
- <Typography variant="h5" id="preview-enName-signup">
- {formik.values.enName}
- </Typography>
- </Stack>
- </Grid>
- <Grid item xs={12} md={12}>
- <Stack spacing={1} direction="row">
- <Typography variant="h5" color={theme.palette.grey[600]}>
- 電郵:
- </Typography>
- <Typography variant="h5" id="preview-email-signup">
- {formik.values.email}
- </Typography>
- </Stack>
- </Grid>
- <Grid item xs={12} md={6}>
- <Stack spacing={1} direction="row">
- <Typography variant="h5" color={theme.palette.grey[600]}>
- 聯絡電話:
- </Typography>
- <Typography variant="h5" id="preview-phone-signup">
- +{formik.values.phoneCountryCode} {formik.values.phone}
- </Typography>
- </Stack>
- </Grid>
- <Grid item xs={12} md={6}>
- <Stack spacing={1} direction="row">
- <Typography variant="h5" color={theme.palette.grey[600]}>
- 傳真號碼:
- </Typography>
- <Typography variant="h5" id="preview-fax-signup">
- +{formik.values.faxCountryCode} {formik.values.fax}
- </Typography>
- </Stack>
- </Grid>
- <Grid item xs={12} md={12} mt={1} mb={1}>
- <Grid container>
- <Grid item xs={12} md={12}>
- <Stack spacing={1} direction="column" justifyContent="space-between" alignItems="baseline" sx={{ mb: { xs: -0.5, sm: 0.5 } }}>
- <Typography display="inline" variant="h4" sx={{ color: 'primary.primary' }}>身份證明文件</Typography>
- {fileList != null ?
- <PreviewUploadFileTable key="previewTable" recordList={fileListData} /> : null}
- </Stack>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- </Grid>
- </FormGroup>
- {/* Submit page */}
- <FormGroup id={"submitForm"} sx={{ display: props.step === 2 ? "" : "none" }}>
- <Grid container spacing={3}>
- {isLoading ?
- <LoadingComponent /> :
- <Grid item xs={12}>
- {checkUpload ?
- // SUCCESS page
- <Stack mt={1} direction="column" justifyContent="flex-start" alignItems="center" spacing={2}>
- <CheckCircleOutlineIcon color="success" sx={{ width: "200px", height: "200px" }} />
- <Typography display="inline" variant="h4">帳戶申請已成功提交。</Typography>
- <Typography display="inline" variant="h4">驗證電郵將發送到你的電郵地址,請要指示完成驗證及登入系統。</Typography>
- <Button variant="outlined" component={Link} to="/login" sx={{ fontSize: 20, height: '60px' }}><Typography variant="h5">返回登入頁面</Typography></Button>
- </Stack>
- :
- // ERROR page
- <Stack mt={1} direction="column" justifyContent="flex-start" alignItems="center" spacing={2}>
- {/* <Button disabled={true} hidden={true} variant="contained" type="submit" sx={{ fontSize: 12,height:'25px'}}>Submit</Button> */}
- <CancelOutlinedIcon color="error" sx={{ width: "200px", height: "200px" }} />
- <Typography display="inline" variant="h4">申請失敗,請稍後嘗試</Typography>
- <Button color="error" variant="outlined" component={Link} to="/login" sx={{ fontSize: 20, height: '60px' }}><Typography variant="h5">返回登入頁面</Typography></Button>
- </Stack>
- }
- </Grid>
- }
- </Grid>
- </FormGroup>
- </form>
- </FormikProvider>
- );
- }
-
- export default BusCustomFormWizard;
|