|
|
@ -35,33 +35,23 @@ const Register = ({ |
|
|
|
province, |
|
|
|
province, |
|
|
|
city, |
|
|
|
city, |
|
|
|
user, |
|
|
|
user, |
|
|
|
|
|
|
|
getUserInfo, |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
const [steps, setSteps] = useState(0); |
|
|
|
const [steps, setSteps] = useState(0); |
|
|
|
|
|
|
|
console.log("user:&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"); |
|
|
|
|
|
|
|
console.log(user); |
|
|
|
const timeoutRef = useRef(null); |
|
|
|
const timeoutRef = useRef(null); |
|
|
|
const [activeStep, setActiveStep] = useState([true, false, false, false]); |
|
|
|
const [activeStep, setActiveStep] = useState([true, false, false, false]); |
|
|
|
const [error, setError] = useState(""); |
|
|
|
const [error, setError] = useState(""); |
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
getUserInfo(); |
|
|
|
getProvince(); |
|
|
|
getProvince(); |
|
|
|
getCity(); |
|
|
|
getCity(); |
|
|
|
}, []); |
|
|
|
}, []); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if (user?.firstName !== null) { |
|
|
|
if (user?.firstName !== null) { |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo(user); |
|
|
|
...userInfo, |
|
|
|
|
|
|
|
firstName: user.firstName, |
|
|
|
|
|
|
|
lastName: user.lastName, |
|
|
|
|
|
|
|
nationalId: user.nationalId, |
|
|
|
|
|
|
|
// birthDate: user.birthDate.toLocaleDateString('fa-IR'),
|
|
|
|
|
|
|
|
gender: user.gender, |
|
|
|
|
|
|
|
previousSchoolName: user.previousSchoolName, |
|
|
|
|
|
|
|
previousSchoolType: user.previousSchoolType, |
|
|
|
|
|
|
|
zone: user.zone, |
|
|
|
|
|
|
|
familyMemberCount: user.familyMemberCount, |
|
|
|
|
|
|
|
phone: user.phone, |
|
|
|
|
|
|
|
address: user.address, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, [user]); |
|
|
|
}, [user]); |
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
@ -120,154 +110,157 @@ const Register = ({ |
|
|
|
personalPic: null, |
|
|
|
personalPic: null, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const [userInfo, setUserInfo] = useState({ |
|
|
|
//ark added
|
|
|
|
firstName: null, |
|
|
|
const [userInfo, setUserInfo]=useState(user); |
|
|
|
lastName: null, |
|
|
|
//ark added
|
|
|
|
nationalId: null, |
|
|
|
// const [userInfo, setUserInfo] = useState({
|
|
|
|
birthDate: null, |
|
|
|
// firstName: null,
|
|
|
|
gender: null, |
|
|
|
// lastName: null,
|
|
|
|
gradeIds: null, |
|
|
|
// nationalId: null,
|
|
|
|
previousSchoolName: null, |
|
|
|
// birthDate: null,
|
|
|
|
previousSchoolType: null, |
|
|
|
// gender: null,
|
|
|
|
cityId: null, |
|
|
|
// gradeIds: null,
|
|
|
|
provinceId: null, |
|
|
|
// previousSchoolName: null,
|
|
|
|
zone: null, |
|
|
|
// previousSchoolType: null,
|
|
|
|
fatherInfo: { |
|
|
|
// cityId: null,
|
|
|
|
firstName: null, |
|
|
|
// provinceId: null,
|
|
|
|
nationalId: null, |
|
|
|
// zone: null,
|
|
|
|
lastName: null, |
|
|
|
// fatherInfo: {
|
|
|
|
job: null, |
|
|
|
// firstName: null,
|
|
|
|
education: null, |
|
|
|
// nationalId: null,
|
|
|
|
cellphone: null, |
|
|
|
// lastName: null,
|
|
|
|
workPlace: null, |
|
|
|
// job: null,
|
|
|
|
workPhone: null, |
|
|
|
// education: null,
|
|
|
|
}, |
|
|
|
// cellphone: null,
|
|
|
|
motherInfo: { |
|
|
|
// workPlace: null,
|
|
|
|
firstName: null, |
|
|
|
// workPhone: null,
|
|
|
|
nationalId: null, |
|
|
|
// },
|
|
|
|
lastName: null, |
|
|
|
// motherInfo: {
|
|
|
|
job: null, |
|
|
|
// firstName: null,
|
|
|
|
education: null, |
|
|
|
// nationalId: null,
|
|
|
|
cellphone: null, |
|
|
|
// lastName: null,
|
|
|
|
workPlace: null, |
|
|
|
// job: null,
|
|
|
|
workPhone: null, |
|
|
|
// education: null,
|
|
|
|
}, |
|
|
|
// cellphone: null,
|
|
|
|
|
|
|
|
// workPlace: null,
|
|
|
|
|
|
|
|
// workPhone: null,
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
|
|
familyMemberCount: null, |
|
|
|
// familyMemberCount: null,
|
|
|
|
address: null, |
|
|
|
// address: null,
|
|
|
|
phone: null, |
|
|
|
// phone: null,
|
|
|
|
rulesAccepted: false, |
|
|
|
// rulesAccepted: false,
|
|
|
|
}); |
|
|
|
// });
|
|
|
|
const finalViewInfo = [ |
|
|
|
const finalViewInfo = [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "نام", |
|
|
|
title: "نام", |
|
|
|
value: userInfo.firstName, |
|
|
|
value: userInfo?.firstName, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "نام خانوادگی", |
|
|
|
title: "نام خانوادگی", |
|
|
|
value: userInfo.lastName, |
|
|
|
value: userInfo?.lastName, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "جنسیت", |
|
|
|
title: "جنسیت", |
|
|
|
value: userInfo.gender, |
|
|
|
value: userInfo?.gender, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "کد ملی", |
|
|
|
title: "کد ملی", |
|
|
|
value: userInfo.nationalId, |
|
|
|
value: userInfo?.nationalId, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "تاریخ تولد", |
|
|
|
title: "تاریخ تولد", |
|
|
|
value: userInfo.birthDate?.toLocaleDateString("fa-IR"), |
|
|
|
value: userInfo?.birthDate?.toLocaleDateString("fa-IR"), |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "نام مدرسه ", |
|
|
|
title: "نام مدرسه ", |
|
|
|
value: userInfo.previousSchoolName, |
|
|
|
value: userInfo?.previousSchoolName, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "شهر", |
|
|
|
title: "شهر", |
|
|
|
value: userInfo.cityId, |
|
|
|
value: userInfo?.cityId, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "منطقه", |
|
|
|
title: "منطقه", |
|
|
|
value: userInfo.zone, |
|
|
|
value: userInfo?.zone, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "نام", |
|
|
|
title: "نام", |
|
|
|
value: userInfo.fatherInfo.firstName, |
|
|
|
value: userInfo?.fatherInfo?.firstName, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "نام خانوادگی", |
|
|
|
title: "نام خانوادگی", |
|
|
|
value: userInfo.fatherInfo.lastName, |
|
|
|
value: userInfo?.fatherInfo?.lastName, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "کدملی", |
|
|
|
title: "کدملی", |
|
|
|
value: userInfo.fatherInfo.nationalId, |
|
|
|
value: userInfo.fatherInfo?.nationalId, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "مدرک تحصیلی", |
|
|
|
title: "مدرک تحصیلی", |
|
|
|
value: madraks.find((itm) => itm.id == userInfo.fatherInfo.education) |
|
|
|
value: madraks.find((itm) => itm.id == userInfo?.fatherInfo?.education) |
|
|
|
?.title, |
|
|
|
?.title, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "تلفن همراه", |
|
|
|
title: "تلفن همراه", |
|
|
|
value: userInfo.fatherInfo.cellphone, |
|
|
|
value: userInfo?.fatherInfo?.cellphone, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "شغل", |
|
|
|
title: "شغل", |
|
|
|
value: userInfo.fatherInfo.job, |
|
|
|
value: userInfo?.fatherInfo?.job, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "محل کار", |
|
|
|
title: "محل کار", |
|
|
|
value: userInfo.fatherInfo.workPlace, |
|
|
|
value: userInfo?.fatherInfo?.workPlace, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "تلفن محل کار", |
|
|
|
title: "تلفن محل کار", |
|
|
|
value: userInfo.fatherInfo.workPhone, |
|
|
|
value: userInfo?.fatherInfo?.workPhone, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "نام", |
|
|
|
title: "نام", |
|
|
|
value: userInfo.motherInfo.firstName, |
|
|
|
value: userInfo?.motherInfo?.firstName, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "نام خانوادگی", |
|
|
|
title: "نام خانوادگی", |
|
|
|
value: userInfo.motherInfo.lastName, |
|
|
|
value: userInfo?.motherInfo?.lastName, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "کدملی", |
|
|
|
title: "کدملی", |
|
|
|
value: userInfo.motherInfo.nationalId, |
|
|
|
value: userInfo?.motherInfo?.nationalId, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "مدرک تحصیلی", |
|
|
|
title: "مدرک تحصیلی", |
|
|
|
value: madraks.find((itm) => itm.id == userInfo.motherInfo.education) |
|
|
|
value: madraks.find((itm) => itm.id == userInfo?.motherInfo?.education) |
|
|
|
?.title, |
|
|
|
?.title, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "تلفن همراه", |
|
|
|
title: "تلفن همراه", |
|
|
|
value: userInfo.motherInfo.cellphone, |
|
|
|
value: userInfo?.motherInfo?.cellphone, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "شغل", |
|
|
|
title: "شغل", |
|
|
|
value: userInfo.motherInfo.job, |
|
|
|
value: userInfo?.motherInfo?.job, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "محل کار", |
|
|
|
title: "محل کار", |
|
|
|
value: userInfo.motherInfo.workPlace, |
|
|
|
value: userInfo?.motherInfo?.workPlace, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "تلفن محل کار", |
|
|
|
title: "تلفن محل کار", |
|
|
|
value: userInfo.motherInfo.workPhone, |
|
|
|
value: userInfo?.motherInfo?.workPhone, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "تعداد افراد خانواده", |
|
|
|
title: "تعداد افراد خانواده", |
|
|
|
value: userInfo.familyMemberCount, |
|
|
|
value: userInfo?.familyMemberCount, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "نشانی محل سکونت", |
|
|
|
title: "نشانی محل سکونت", |
|
|
|
value: userInfo.address, |
|
|
|
value: userInfo?.address, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "تلفن ثابت", |
|
|
|
title: "تلفن ثابت", |
|
|
|
value: userInfo.phone, |
|
|
|
value: userInfo?.phone, |
|
|
|
}, |
|
|
|
}, |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
@ -421,7 +414,7 @@ const Register = ({ |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
toast.warning("لطفا تمامی فیلد ها را پر کنید"); |
|
|
|
toast.warning("لطفا تمامی فیلد ها را پر کنید"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return isMobile ? ( |
|
|
|
return isMobile ? ( |
|
|
|
<MobileRegister /> |
|
|
|
<MobileRegister /> |
|
|
@ -475,7 +468,7 @@ const Register = ({ |
|
|
|
gapSize="8" |
|
|
|
gapSize="8" |
|
|
|
direction="rtl" |
|
|
|
direction="rtl" |
|
|
|
id={0} |
|
|
|
id={0} |
|
|
|
value={userInfo.firstName} |
|
|
|
value={userInfo?.firstName} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
@ -716,12 +709,12 @@ const Register = ({ |
|
|
|
gapSize="8" |
|
|
|
gapSize="8" |
|
|
|
direction="rtl" |
|
|
|
direction="rtl" |
|
|
|
id={0} |
|
|
|
id={0} |
|
|
|
value={userInfo.fatherInfo.firstName} |
|
|
|
value={userInfo?.fatherInfo?.firstName} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
fatherInfo: { |
|
|
|
fatherInfo: { |
|
|
|
...userInfo.fatherInfo, |
|
|
|
...userInfo?.fatherInfo, |
|
|
|
firstName: _onInput.noNumber(e.target.value), |
|
|
|
firstName: _onInput.noNumber(e.target.value), |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -733,12 +726,12 @@ const Register = ({ |
|
|
|
borderType="rounded" |
|
|
|
borderType="rounded" |
|
|
|
id={1} |
|
|
|
id={1} |
|
|
|
direction="rtl" |
|
|
|
direction="rtl" |
|
|
|
value={userInfo.fatherInfo.lastName} |
|
|
|
value={userInfo?.fatherInfo?.lastName} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
fatherInfo: { |
|
|
|
fatherInfo: { |
|
|
|
...userInfo.fatherInfo, |
|
|
|
...userInfo?.fatherInfo, |
|
|
|
lastName: _onInput.noNumber(e.target.value), |
|
|
|
lastName: _onInput.noNumber(e.target.value), |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -752,7 +745,7 @@ const Register = ({ |
|
|
|
id={2} |
|
|
|
id={2} |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
max={10} |
|
|
|
max={10} |
|
|
|
value={userInfo.fatherInfo.nationalId} |
|
|
|
value={userInfo?.fatherInfo?.nationalId} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
@ -769,7 +762,7 @@ const Register = ({ |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
fatherInfo: { |
|
|
|
fatherInfo: { |
|
|
|
...userInfo.fatherInfo, |
|
|
|
...userInfo?.fatherInfo, |
|
|
|
education: e.target.value, |
|
|
|
education: e.target.value, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -789,12 +782,12 @@ const Register = ({ |
|
|
|
borderType="rounded" |
|
|
|
borderType="rounded" |
|
|
|
max={11} |
|
|
|
max={11} |
|
|
|
id={3} |
|
|
|
id={3} |
|
|
|
value={userInfo.fatherInfo.cellphone} |
|
|
|
value={userInfo?.fatherInfo?.cellphone} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
fatherInfo: { |
|
|
|
fatherInfo: { |
|
|
|
...userInfo.fatherInfo, |
|
|
|
...userInfo?.fatherInfo, |
|
|
|
cellphone: _onInput.phonenumber(e.target.value), |
|
|
|
cellphone: _onInput.phonenumber(e.target.value), |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -807,12 +800,12 @@ const Register = ({ |
|
|
|
direction="rtl" |
|
|
|
direction="rtl" |
|
|
|
gapSize="8" |
|
|
|
gapSize="8" |
|
|
|
id={4} |
|
|
|
id={4} |
|
|
|
value={userInfo.fatherInfo.job} |
|
|
|
value={userInfo?.fatherInfo?.job} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
fatherInfo: { |
|
|
|
fatherInfo: { |
|
|
|
...userInfo.fatherInfo, |
|
|
|
...userInfo?.fatherInfo, |
|
|
|
job: e.target.value, |
|
|
|
job: e.target.value, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -825,12 +818,12 @@ const Register = ({ |
|
|
|
borderType="rounded" |
|
|
|
borderType="rounded" |
|
|
|
id={5} |
|
|
|
id={5} |
|
|
|
direction="rtl" |
|
|
|
direction="rtl" |
|
|
|
value={userInfo.fatherInfo.workPlace} |
|
|
|
value={userInfo?.fatherInfo?.workPlace} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
fatherInfo: { |
|
|
|
fatherInfo: { |
|
|
|
...userInfo.fatherInfo, |
|
|
|
...userInfo?.fatherInfo, |
|
|
|
workPlace: e.target.value, |
|
|
|
workPlace: e.target.value, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -844,12 +837,12 @@ const Register = ({ |
|
|
|
id={6} |
|
|
|
id={6} |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
max={11} |
|
|
|
max={11} |
|
|
|
value={userInfo.fatherInfo.workPhone} |
|
|
|
value={userInfo?.fatherInfo?.workPhone} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
fatherInfo: { |
|
|
|
fatherInfo: { |
|
|
|
...userInfo.fatherInfo, |
|
|
|
...userInfo?.fatherInfo, |
|
|
|
workPhone: _onInput.numberOnly(e.target.value), |
|
|
|
workPhone: _onInput.numberOnly(e.target.value), |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -873,12 +866,12 @@ const Register = ({ |
|
|
|
gapSize="8" |
|
|
|
gapSize="8" |
|
|
|
direction="rtl" |
|
|
|
direction="rtl" |
|
|
|
id={7} |
|
|
|
id={7} |
|
|
|
value={userInfo.motherInfo.firstName} |
|
|
|
value={userInfo?.motherInfo?.firstName} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
motherInfo: { |
|
|
|
motherInfo: { |
|
|
|
...userInfo.motherInfo, |
|
|
|
...userInfo?.motherInfo, |
|
|
|
firstName: _onInput.noNumber(e.target.value), |
|
|
|
firstName: _onInput.noNumber(e.target.value), |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -891,12 +884,12 @@ const Register = ({ |
|
|
|
borderType="rounded" |
|
|
|
borderType="rounded" |
|
|
|
id={8} |
|
|
|
id={8} |
|
|
|
direction="rtl" |
|
|
|
direction="rtl" |
|
|
|
value={userInfo.motherInfo.lastName} |
|
|
|
value={userInfo?.motherInfo?.lastName} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
motherInfo: { |
|
|
|
motherInfo: { |
|
|
|
...userInfo.motherInfo, |
|
|
|
...userInfo?.motherInfo, |
|
|
|
lastName: _onInput.noNumber(e.target.value), |
|
|
|
lastName: _onInput.noNumber(e.target.value), |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -910,12 +903,12 @@ const Register = ({ |
|
|
|
id={9} |
|
|
|
id={9} |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
max={10} |
|
|
|
max={10} |
|
|
|
value={userInfo.motherInfo.nationalId} |
|
|
|
value={userInfo?.motherInfo?.nationalId} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
motherInfo: { |
|
|
|
motherInfo: { |
|
|
|
...userInfo.motherInfo, |
|
|
|
...userInfo?.motherInfo, |
|
|
|
nationalId: _onInput.numberOnly(e.target.value), |
|
|
|
nationalId: _onInput.numberOnly(e.target.value), |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -928,7 +921,7 @@ const Register = ({ |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
motherInfo: { |
|
|
|
motherInfo: { |
|
|
|
...userInfo.motherInfo, |
|
|
|
...userInfo?.motherInfo, |
|
|
|
education: e.target.value, |
|
|
|
education: e.target.value, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -949,12 +942,12 @@ const Register = ({ |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
id={10} |
|
|
|
id={10} |
|
|
|
max={11} |
|
|
|
max={11} |
|
|
|
value={userInfo.motherInfo.cellphone} |
|
|
|
value={userInfo?.motherInfo?.cellphone} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
motherInfo: { |
|
|
|
motherInfo: { |
|
|
|
...userInfo.motherInfo, |
|
|
|
...userInfo?.motherInfo, |
|
|
|
cellphone: _onInput.phonenumber(e.target.value), |
|
|
|
cellphone: _onInput.phonenumber(e.target.value), |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -967,12 +960,12 @@ const Register = ({ |
|
|
|
direction="rtl" |
|
|
|
direction="rtl" |
|
|
|
gapSize="8" |
|
|
|
gapSize="8" |
|
|
|
id={11} |
|
|
|
id={11} |
|
|
|
value={userInfo.motherInfo.job} |
|
|
|
value={userInfo?.motherInfo?.job} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
motherInfo: { |
|
|
|
motherInfo: { |
|
|
|
...userInfo.motherInfo, |
|
|
|
...userInfo?.motherInfo, |
|
|
|
job: e.target.value, |
|
|
|
job: e.target.value, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -985,12 +978,12 @@ const Register = ({ |
|
|
|
borderType="rounded" |
|
|
|
borderType="rounded" |
|
|
|
id={12} |
|
|
|
id={12} |
|
|
|
direction="rtl" |
|
|
|
direction="rtl" |
|
|
|
value={userInfo.motherInfo.workPlace} |
|
|
|
value={userInfo?.motherInfo?.workPlace} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
motherInfo: { |
|
|
|
motherInfo: { |
|
|
|
...userInfo.motherInfo, |
|
|
|
...userInfo?.motherInfo, |
|
|
|
workPlace: e.target.value, |
|
|
|
workPlace: e.target.value, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -1004,12 +997,12 @@ const Register = ({ |
|
|
|
id={13} |
|
|
|
id={13} |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
max={11} |
|
|
|
max={11} |
|
|
|
value={userInfo.motherInfo.workPhone} |
|
|
|
value={userInfo?.motherInfo?.workPhone} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
|
motherInfo: { |
|
|
|
motherInfo: { |
|
|
|
...userInfo.motherInfo, |
|
|
|
...userInfo?.motherInfo, |
|
|
|
workPhone: _onInput.numberOnly(e.target.value), |
|
|
|
workPhone: _onInput.numberOnly(e.target.value), |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
@ -1035,7 +1028,7 @@ const Register = ({ |
|
|
|
gapSize="40" |
|
|
|
gapSize="40" |
|
|
|
direction="rtl" |
|
|
|
direction="rtl" |
|
|
|
id={14} |
|
|
|
id={14} |
|
|
|
value={userInfo.familyMemberCount} |
|
|
|
value={userInfo?.familyMemberCount} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
@ -1051,7 +1044,7 @@ const Register = ({ |
|
|
|
direction="rtl" |
|
|
|
direction="rtl" |
|
|
|
id={15} |
|
|
|
id={15} |
|
|
|
max={11} |
|
|
|
max={11} |
|
|
|
value={userInfo.phone} |
|
|
|
value={userInfo?.phone} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ |
|
|
|
setUserInfo({ |
|
|
|
...userInfo, |
|
|
|
...userInfo, |
|
|
@ -1066,7 +1059,7 @@ const Register = ({ |
|
|
|
gapSize="40" |
|
|
|
gapSize="40" |
|
|
|
id={16} |
|
|
|
id={16} |
|
|
|
direction="rtl" |
|
|
|
direction="rtl" |
|
|
|
value={userInfo.address} |
|
|
|
value={userInfo?.address} |
|
|
|
onChange={(e) => |
|
|
|
onChange={(e) => |
|
|
|
setUserInfo({ ...userInfo, address: e.target.value }) |
|
|
|
setUserInfo({ ...userInfo, address: e.target.value }) |
|
|
|
} |
|
|
|
} |
|
|
@ -1093,25 +1086,25 @@ const Register = ({ |
|
|
|
// const inputs = document.querySelectorAll('.Login-box-form-item-input')
|
|
|
|
// const inputs = document.querySelectorAll('.Login-box-form-item-input')
|
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
if ( |
|
|
|
userInfo.motherInfo.cellphone && |
|
|
|
userInfo?.motherInfo.cellphone && |
|
|
|
userInfo.motherInfo.education && |
|
|
|
userInfo?.motherInfo.education && |
|
|
|
userInfo.motherInfo.firstName && |
|
|
|
userInfo?.motherInfo.firstName && |
|
|
|
userInfo.motherInfo.job && |
|
|
|
userInfo?.motherInfo.job && |
|
|
|
userInfo.motherInfo.lastName && |
|
|
|
userInfo?.motherInfo.lastName && |
|
|
|
userInfo.motherInfo.nationalId && |
|
|
|
userInfo?.motherInfo.nationalId && |
|
|
|
userInfo.motherInfo.workPhone && |
|
|
|
userInfo?.motherInfo.workPhone && |
|
|
|
userInfo.motherInfo.workPlace && |
|
|
|
userInfo?.motherInfo.workPlace && |
|
|
|
userInfo.fatherInfo.cellphone && |
|
|
|
userInfo?.fatherInfo.cellphone && |
|
|
|
userInfo.fatherInfo.education && |
|
|
|
userInfo?.fatherInfo.education && |
|
|
|
userInfo.fatherInfo.firstName && |
|
|
|
userInfo?.fatherInfo.firstName && |
|
|
|
userInfo.fatherInfo.job && |
|
|
|
userInfo?.fatherInfo.job && |
|
|
|
userInfo.fatherInfo.lastName && |
|
|
|
userInfo?.fatherInfo.lastName && |
|
|
|
userInfo.fatherInfo.nationalId && |
|
|
|
userInfo?.fatherInfo.nationalId && |
|
|
|
userInfo.fatherInfo.workPhone && |
|
|
|
userInfo?.fatherInfo.workPhone && |
|
|
|
userInfo.fatherInfo.workPlace && |
|
|
|
userInfo?.fatherInfo.workPlace && |
|
|
|
userInfo.familyMemberCount && |
|
|
|
userInfo?.familyMemberCount && |
|
|
|
userInfo.address && |
|
|
|
userInfo?.address && |
|
|
|
userInfo.phone |
|
|
|
userInfo?.phone |
|
|
|
) { |
|
|
|
) { |
|
|
|
setSteps(2); |
|
|
|
setSteps(2); |
|
|
|
|
|
|
|
|
|
|
@ -1209,14 +1202,14 @@ const Register = ({ |
|
|
|
اینجانبان |
|
|
|
اینجانبان |
|
|
|
<span className="text-red52 font-bold"> |
|
|
|
<span className="text-red52 font-bold"> |
|
|
|
{" "} |
|
|
|
{" "} |
|
|
|
{userInfo.fatherInfo.firstName}{" "} |
|
|
|
{userInfo?.fatherInfo?.firstName}{" "} |
|
|
|
{userInfo.fatherInfo.lastName}{" "} |
|
|
|
{userInfo?.fatherInfo?.lastName}{" "} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
و |
|
|
|
و |
|
|
|
<span className="text-red52 font-bold"> |
|
|
|
<span className="text-red52 font-bold"> |
|
|
|
{" "} |
|
|
|
{" "} |
|
|
|
{userInfo.motherInfo.firstName}{" "} |
|
|
|
{userInfo?.motherInfo?.firstName}{" "} |
|
|
|
{userInfo.motherInfo.lastName}{" "} |
|
|
|
{userInfo?.motherInfo?.lastName}{" "} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
سرپرست های دانش آموز |
|
|
|
سرپرست های دانش آموز |
|
|
|
<span className="text-red52 font-bold"> |
|
|
|
<span className="text-red52 font-bold"> |
|
|
@ -1331,7 +1324,7 @@ const Register = ({ |
|
|
|
<Button |
|
|
|
<Button |
|
|
|
borderType="rounded" |
|
|
|
borderType="rounded" |
|
|
|
title="تایید" |
|
|
|
title="تایید" |
|
|
|
to="/" |
|
|
|
// to="/"
|
|
|
|
onClick={async () => { |
|
|
|
onClick={async () => { |
|
|
|
// activeLogin()
|
|
|
|
// activeLogin()
|
|
|
|
try { |
|
|
|
try { |
|
|
@ -1397,6 +1390,7 @@ const mapDispatchToProps = { |
|
|
|
setProfile: user.setProfile, |
|
|
|
setProfile: user.setProfile, |
|
|
|
getProvince: publicApi.getProvince, |
|
|
|
getProvince: publicApi.getProvince, |
|
|
|
getCity: publicApi.getCity, |
|
|
|
getCity: publicApi.getCity, |
|
|
|
|
|
|
|
getUserInfo: user.getProfile, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Register); |
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Register); |
|
|
|