瀏覽代碼

Fix en & ch name & must input fields (register - prepress doc p.1)

master
cyril.tsui 1 年之前
父節點
當前提交
e7466d7df5
共有 2 個文件被更改,包括 42 次插入22 次删除
  1. +25
    -12
      src/pages/authentication/auth-forms/BusCustomFormWizard.js
  2. +17
    -10
      src/pages/authentication/auth-forms/CustomFormWizard.js

+ 25
- 12
src/pages/authentication/auth-forms/BusCustomFormWizard.js 查看文件

@@ -136,8 +136,10 @@ const BusCustomFormWizard = (props) => {
data.password !==""&&
data.confirmPassword !==""&&
data.password == data.confirmPassword&&
data.enCompanyName !==""&&
(data.enCompanyName !=="" || selectedAddress5 ==="內地")&&
data.chCompanyName !==""&&
data.enName !==""&&
data.chName !==""&&
data.address1 !==""&&
data.email !==""&&
data.emailConfirm !==""&&
@@ -148,6 +150,7 @@ const BusCustomFormWizard = (props) => {
fileList.length!==0&&
data.captchaField&&
data.brNo!==""&&
data.brExpiryDate!==""&&
handlePassword(data.password)&&
handleEmail(data.email)&&
handlePhone(data.phone)&&
@@ -433,6 +436,7 @@ const BusCustomFormWizard = (props) => {
confirmPassword: yup.string().min(8,'請最少輸入8位密碼').required('請確認密碼').oneOf([yup.ref('password'), null], '請輸入相同密碼'),
enName: yup.string().max(255).required('請輸入英文姓名'),
enCompanyName: yup.string().max(255).required('請輸入英文名稱'),
chCompanyName: yup.string().max(255).required('請輸入中文名稱'),
chName: yup.string().max(255).required('請輸入中文姓名'),
address1: yup.string().max(255).required('請輸入第一行地址'),
address2: yup.string().max(255).required('請輸入第二行地址'),
@@ -443,7 +447,7 @@ const BusCustomFormWizard = (props) => {
faxCountryCode: yup.string().min(2,'請輸入最少2位數字'),
phone: yup.string().min(8,'請輸入最少8位數字').required('請輸入聯絡電話'),
fax: yup.string().min(8,'請輸入最少8位數字'),
brExpiryDate: yup.string().min(8,'請輸入商業登記證有效日期'),
brExpiryDate: yup.string().min(8).required('請輸入商業登記證有效日期'),
brNo: yup.string().min(8,'請輸入商業登記證號碼').required('請輸入商業登記證號碼'),
captchaField: yup.string().required('請輸入驗證').oneOf([captcha], '請輸入有效驗證'),
})
@@ -649,7 +653,7 @@ const BusCustomFormWizard = (props) => {
<Grid item xs={12} md={6}>
<Stack spacing={1}>
<InputLabel htmlFor="enCompanyName-signup">機構/公司英文名稱
<span style={{color: '#f10000'}}>*</span>
{selectedAddress5 === "內地" ? "" : <span style={{color: '#f10000'}}>*</span>}
</InputLabel>
<OutlinedInput
id="enCompanyName-login"
@@ -657,10 +661,11 @@ const BusCustomFormWizard = (props) => {
value={formik.values.enCompanyName}
name="enCompanyName"
onChange={formik.handleChange}
placeholder="與商業登記證相同如有"
placeholder="與商業登記證相同"
fullWidth
error={Boolean(formik.touched.enCompanyName && formik.errors.enCompanyName)}
error={Boolean(formik.touched.enCompanyName && formik.errors.enCompanyName && selectedAddress5 !== "內地")}
onBlur={formik.handleBlur}
disabled={selectedAddress5 === "內地"}
inputProps={{
onKeyDown: (e) => {
if (e.key === 'Enter') {
@@ -669,7 +674,7 @@ const BusCustomFormWizard = (props) => {
},
}}
/>
{formik.touched.enCompanyName && formik.errors.enCompanyName && (
{formik.touched.enCompanyName && formik.errors.enCompanyName && selectedAddress5 !== "內地" && (
<FormHelperText error id="helper-text-enCompanyName-signup">
{formik.errors.enCompanyName}
</FormHelperText>
@@ -678,7 +683,9 @@ const BusCustomFormWizard = (props) => {
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={1}>
<InputLabel htmlFor="chCompanyName-signup">機構/公司中文名稱</InputLabel>
<InputLabel htmlFor="chCompanyName-signup">機構/公司中文名稱
<span style={{color: '#f10000'}}>*</span>
</InputLabel>
<OutlinedInput
fullWidth
error={Boolean(formik.touched.chCompanyName && formik.errors.chCompanyName)}
@@ -687,7 +694,8 @@ const BusCustomFormWizard = (props) => {
value={formik.values.chCompanyName.trim()}
name="chCompanyName"
onChange={formik.handleChange}
placeholder="與與商業登記證相同如有"
placeholder="與商業登記證相同"
onBlur={formik.handleBlur}
inputProps={{
onKeyDown: (e) => {
if (e.key === 'Enter') {
@@ -705,7 +713,9 @@ const BusCustomFormWizard = (props) => {
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={1}>
<InputLabel htmlFor="brNo-signup">商業登記證號碼</InputLabel>
<InputLabel htmlFor="brNo-signup">商業登記證號碼
<span style={{color: '#f10000'}}>*</span>
</InputLabel>
<OutlinedInput
fullWidth
error={Boolean(formik.touched.brNo && formik.errors.brNo)}
@@ -715,7 +725,7 @@ const BusCustomFormWizard = (props) => {
name="brNo"
onChange={formik.handleChange}
onBlur={formik.handleBlur}
placeholder="與商業登記證相同如有"
placeholder="與商業登記證相同"
inputProps={{
onKeyDown: (e) => {
if (e.key === 'Enter') {
@@ -733,7 +743,9 @@ const BusCustomFormWizard = (props) => {
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={1}>
<InputLabel htmlFor="brExpiryDate-signup">商業登記證有效日期</InputLabel>
<InputLabel htmlFor="brExpiryDate-signup">商業登記證有效日期
<span style={{color: '#f10000'}}>*</span>
</InputLabel>
<OutlinedInput
fullWidth
error={Boolean(formik.touched.brExpiryDate && formik.errors.brExpiryDate)}
@@ -742,7 +754,7 @@ const BusCustomFormWizard = (props) => {
value={formik.values.brExpiryDate}
name="brExpiryDate"
onChange={formik.handleChange}
placeholder="與商業登記證相同如有"
placeholder="與商業登記證相同"
inputProps={{
min: new Date().toISOString().split("T")[0],
onKeyDown: (e) => {
@@ -836,6 +848,7 @@ const BusCustomFormWizard = (props) => {
if(newValue=='香港'){
setCheckCountry(false)
}else{
if (newValue === "內地") formik.values.enCompanyName = ""
setSelectedAddress4("");
setCheckCountry(true)
}


+ 17
- 10
src/pages/authentication/auth-forms/CustomFormWizard.js 查看文件

@@ -132,7 +132,8 @@ const CustomFormWizard = (props) => {
data.password == data.confirmPassword&&
selectedIdDocType.type !==""&&
data.idNo !==""&&
data.enName !==""&&
(data.enName !=="" || selectedAddress5 === "內地")&&
data.chName !==""&&
data.address1 !==""&&
data.email !==""&&
data.emailConfirm !==""&&
@@ -497,7 +498,7 @@ const CustomFormWizard = (props) => {
const { values } = formik
useEffect(() => {
checkDataField(values)
}, [values])
}, [values])

return (
<FormikProvider value={formik}>
@@ -731,7 +732,7 @@ const CustomFormWizard = (props) => {
<OutlinedInput
id="idNo-login"
type="text"
value={formik.values.idNo.trim()}
value={formik.values.idNo.toUpperCase().trim()}
name="idNo"
onChange={formik.handleChange}
placeholder="證件號碼"
@@ -820,7 +821,7 @@ const CustomFormWizard = (props) => {
<Grid item xs={12} md={6}>
<Stack spacing={1}>
<InputLabel htmlFor="enName-signup">英文姓名
<span style={{color: '#f10000'}}>*</span>
{selectedAddress5 === "內地" ? "" : <span style={{color: '#f10000'}}>*</span>}
</InputLabel>
<OutlinedInput
id="enName-login"
@@ -830,8 +831,9 @@ const CustomFormWizard = (props) => {
onChange={formik.handleChange}
placeholder="與你的身份證明文件相同"
fullWidth
error={Boolean(formik.touched.enName && formik.errors.enName)}
error={Boolean(formik.touched.enName && formik.errors.enName && selectedAddress5 !== "內地")}
onBlur={formik.handleBlur}
disabled={selectedAddress5 === "內地"}
inputProps={{
onKeyDown: (e) => {
if (e.key === 'Enter') {
@@ -840,7 +842,7 @@ const CustomFormWizard = (props) => {
},
}}
/>
{formik.touched.enName && formik.errors.enName && (
{formik.touched.enName && formik.errors.enName && selectedAddress5 !== "內地" && (
<FormHelperText error id="helper-text-enName-signup">
{formik.errors.enName}
</FormHelperText>
@@ -849,7 +851,10 @@ const CustomFormWizard = (props) => {
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={1}>
<InputLabel htmlFor="chName-signup">中文姓名</InputLabel>
<InputLabel htmlFor="chName-signup">
中文姓名
<span style={{color: '#f10000'}}>*</span>
</InputLabel>
<OutlinedInput
fullWidth
error={Boolean(formik.touched.chName && formik.errors.chName)}
@@ -859,6 +864,7 @@ const CustomFormWizard = (props) => {
name="chName"
onChange={formik.handleChange}
placeholder="與你的身份證明文件相同"
onBlur={formik.handleBlur}
inputProps={{
maxLength: 6,
onKeyDown: (e) => {
@@ -952,6 +958,7 @@ const CustomFormWizard = (props) => {
if(newValue=='香港'){
setCheckCountry(false)
}else{
if (newValue === "內地") formik.values.enName = ""
setSelectedAddress4("");
setCheckCountry(true)
}
@@ -1193,7 +1200,7 @@ const CustomFormWizard = (props) => {
<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>
<Typography display="inline" variant="h4" sx={{ color: 'primary.primary'}}>身份證明文件<span style={{color: '#f10000'}}>*</span></Typography>
<Typography display="inline" variant="h6" sx={{ fontSize: 12,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}>
@@ -1280,10 +1287,10 @@ const CustomFormWizard = (props) => {
<span style={{color: '#f10000'}}>*</span>
</Typography>
<Stack spacing={1} direction="row">
<Grid item xs={5} lg={5} style={{"border":"1px solid black;"}}>
<Grid item xs={5} lg={5} style={{"border":"1px solid black"}}>
<img src={captchaImg} alt=""/>
</Grid>
<Grid item xs={1} lg={1} style={{"border":"1px solid black;"}}>
<Grid item xs={1} lg={1} style={{"border":"0px solid black"}}>
<IconButton aria-label="refrashCaptcha" size="large" onClick={()=>{onCaptchaChange()}}>
<LoopIcon fontSize="inherit" />
</IconButton>


Loading…
取消
儲存