|
|
|
@ -22,14 +22,16 @@ import Checkbox from "../../components/Checkbox"; |
|
|
|
|
import { ostan } from "../../constants/states"; |
|
|
|
|
import { cities } from "../../constants/cities"; |
|
|
|
|
import _onInput from "../../utils/onInput"; |
|
|
|
|
import { publicApi, user } from "../../redux/actions"; |
|
|
|
|
import { file, publicApi, user } from "../../redux/actions"; |
|
|
|
|
import { VscDebugBreakpointUnsupported } from "react-icons/vsc"; |
|
|
|
|
import axios from "axios"; |
|
|
|
|
import { ApiConfig } from "../../constants/defaultValues"; |
|
|
|
|
import { toast } from "react-toastify"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, province, city, user }) => { |
|
|
|
|
const [steps, setSteps] = useState(0); |
|
|
|
|
const [index, setIndex] = useState(1); |
|
|
|
|
const [register, setRegister] = useState(false); |
|
|
|
|
|
|
|
|
|
const timeoutRef = useRef(null); |
|
|
|
|
const [activeStep, setActiveStep] = useState([true, false, false, false]); |
|
|
|
|
const [error, setError] = useState(''); |
|
|
|
@ -37,26 +39,29 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
getProvince(); |
|
|
|
|
getCity(); |
|
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if(user?.firstName !== null){ |
|
|
|
|
setUserInfo({...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 |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
if (user?.firstName !== null) { |
|
|
|
|
setUserInfo({ |
|
|
|
|
...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]) |
|
|
|
|
useEffect(() => { |
|
|
|
|
window.scrollTo(0,0); |
|
|
|
|
window.scrollTo(0, 0); |
|
|
|
|
}, [steps]) |
|
|
|
|
|
|
|
|
|
const madraks = [ |
|
|
|
@ -106,6 +111,10 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
const [files, setFiles] = useState({ |
|
|
|
|
shenasNameh: null, |
|
|
|
|
personalPic: null |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const [userInfo, setUserInfo] = useState({ |
|
|
|
|
firstName: null, |
|
|
|
@ -144,7 +153,7 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
address: null, |
|
|
|
|
phone: null, |
|
|
|
|
rulesAccepted: false, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
@ -195,7 +204,7 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: 'مدرک تحصیلی', |
|
|
|
|
value:madraks.find(itm => itm.id == userInfo.fatherInfo.education)?.title |
|
|
|
|
value: madraks.find(itm => itm.id == userInfo.fatherInfo.education)?.title |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: 'تلفن همراه', |
|
|
|
@ -383,9 +392,10 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [selectedState, setSelectedState] = useState(null); |
|
|
|
|
const [selectedCity, setSelectedCity] = useState(null); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
isMobile ? <MobileRegister /> : |
|
|
|
|
<div className="flex justify-center mb-4" style={{ direction: 'rtl', marginTop: '8.5%', marginRight: '6.5%', width: '93.5%', marginRight: '6.5%' }}> |
|
|
|
@ -435,7 +445,7 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* Content */} |
|
|
|
|
|
|
|
|
@ -451,48 +461,48 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
<div className="flex justify-between"> |
|
|
|
|
<div className="flex w-3/5 flex-wrap justify-start"> |
|
|
|
|
|
|
|
|
|
<Input className={'w-52 mx-1'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={0} value={userInfo.firstName} onChange={(e) => setUserInfo({ ...userInfo, firstName: _onInput.noNumber(e.target.value)})} /> |
|
|
|
|
<Input className={'w-52 mx-1'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={0} value={userInfo.firstName} onChange={(e) => setUserInfo({ ...userInfo, firstName: _onInput.noNumber(e.target.value) })} /> |
|
|
|
|
<Input className={'w-52 mx-1'} title="نام خانوادگی" borderType="rounded" id={1} direction='rtl' value={userInfo.lastName} onChange={(e) => setUserInfo({ ...userInfo, lastName: _onInput.noNumber(e.target.value) })} /> |
|
|
|
|
<Input className={'w-52 mx-1'} title="کدملی" borderType="rounded" gapSize="12" id={2} type='textNumber' max={10} value={userInfo.nationalId} onChange={e => setUserInfo({ ...userInfo, nationalId: _onInput.numberOnly(e.target.value) })} /> |
|
|
|
|
{/* <Input className={'w-52'} title="تاریخ تولد" borderType="rounded" gapSize="16" id={3} type='number' /> */} |
|
|
|
|
<DatePicker |
|
|
|
|
format="YYYY/MM/DD" |
|
|
|
|
onChange={(e) =>{ |
|
|
|
|
onChange={(e) => { |
|
|
|
|
// console.log(e)
|
|
|
|
|
var s = new Date(e.unix * 1000) |
|
|
|
|
// console.log(date)
|
|
|
|
|
setUserInfo({ ...userInfo, birthDate: s }) |
|
|
|
|
}} |
|
|
|
|
setUserInfo({ ...userInfo, birthDate: s }) |
|
|
|
|
}} |
|
|
|
|
calendar={persian} |
|
|
|
|
className="red" |
|
|
|
|
locale={persian_fa} |
|
|
|
|
maxDate="1396/01/01" |
|
|
|
|
currentDate={ |
|
|
|
|
new DateObject({
|
|
|
|
|
year: 2017, |
|
|
|
|
month: 1, |
|
|
|
|
day: 1 |
|
|
|
|
new DateObject({ |
|
|
|
|
year: 2017, |
|
|
|
|
month: 1, |
|
|
|
|
day: 1 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
renderButton={(direction, handleClick) =>
|
|
|
|
|
{ |
|
|
|
|
return <p className="text-red-500 cursor-pointer font-bold mx-2"
|
|
|
|
|
} |
|
|
|
|
renderButton={(direction, handleClick) => { |
|
|
|
|
return <p className="text-red-500 cursor-pointer font-bold mx-2" |
|
|
|
|
onClick={() => handleClick()} |
|
|
|
|
> |
|
|
|
|
{direction === "right" ? ">" : "<"} |
|
|
|
|
</p> |
|
|
|
|
} |
|
|
|
|
> |
|
|
|
|
{direction === "right" ? ">" : "<"} |
|
|
|
|
</p> |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
render={<CostumeDatePickerInput title='تاریخ تولد' />} |
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
<select
|
|
|
|
|
onChange={e => setUserInfo({...userInfo, gender: e.target.value})} |
|
|
|
|
className="bg-white border border-solid border-gray-200 w-52 px-3 mx-1 rounded text-gray-400 outline-red52 py-1 h-12 mt-6"> |
|
|
|
|
<select |
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, gender: e.target.value })} |
|
|
|
|
className="bg-white border border-solid border-gray-200 w-52 px-3 mx-1 rounded text-black outline-red52 py-1 h-12 mt-6"> |
|
|
|
|
{genders.map((item) => ( |
|
|
|
|
<option key={`gender${item.id}`} value={item.id}>{item.title}</option> |
|
|
|
|
))} |
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -504,10 +514,22 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
<div className=" flex justify-between"> |
|
|
|
|
|
|
|
|
|
<div className="mx-1 ml-2"> |
|
|
|
|
<FileInput title="بارگزاری صفحه اول شناسنامه" id={1} /> |
|
|
|
|
<FileInput |
|
|
|
|
title="بارگزاری صفحه اول شناسنامه" |
|
|
|
|
id={1} |
|
|
|
|
file={files.shenasNameh} |
|
|
|
|
onChange={e => setFiles({ ...files, shenasNameh: e })} |
|
|
|
|
deleteHandler={e => setFiles({ ...files, shenasNameh: e })} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<FileInput title="بارگزاری عکس پرسنلی" id={2} /> |
|
|
|
|
<FileInput |
|
|
|
|
title="بارگزاری عکس پرسنلی" |
|
|
|
|
id={2} |
|
|
|
|
file={files.personalPic} |
|
|
|
|
onChange={e => setFiles({ ...files, personalPic: e })} |
|
|
|
|
deleteHandler={e => setFiles({ ...files, personalPic: e })} |
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@ -519,9 +541,9 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
<h1 className="font-black">پایه تحصیلی</h1> |
|
|
|
|
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا پایه تحصیلی دانش آموز را وارد کنید</p> |
|
|
|
|
</div> |
|
|
|
|
<select
|
|
|
|
|
onChange={e => setUserInfo({...userInfo, gradeIds: e.target.value})} |
|
|
|
|
className="bg-white border border-solid border-gray-300 w-48 p-3 rounded-lg text-gray-400 outline-red52 mx-6"> |
|
|
|
|
<select |
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, gradeIds: e.target.value })} |
|
|
|
|
className="bg-white border border-solid border-gray-300 w-48 p-3 rounded-lg text-black outline-red52 mx-6"> |
|
|
|
|
{grades.map((item) => ( |
|
|
|
|
<option key={`Grade__${item.id}`} value={item.id}>{item.title}</option> |
|
|
|
|
))} |
|
|
|
@ -536,7 +558,7 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
<Input className={'w-64'} title="نام مدرسه" borderType="rounded" gapSize="20" direction='rtl' id={4} value={userInfo.previousSchoolName} onChange={e => setUserInfo({ ...userInfo, previousSchoolName: e.target.value })} /> |
|
|
|
|
|
|
|
|
|
<select |
|
|
|
|
className="bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-gray-400 outline-red52 mx-3 mt-6" |
|
|
|
|
className="bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-black outline-red52 mx-3 mt-6" |
|
|
|
|
onChange={e => { setSelectedState(e.target.value); setUserInfo({ ...userInfo, previousSchoolType: e.target.value }) }}> |
|
|
|
|
<option value={null}>نوع مدرسه</option> |
|
|
|
|
<option value={1}>دولتی</option> |
|
|
|
@ -545,7 +567,7 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
<option value={4}>تیزهوشان</option> |
|
|
|
|
</select> |
|
|
|
|
<select |
|
|
|
|
className="bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-gray-400 outline-red52 mx-3 mr-0 mt-6" |
|
|
|
|
className="bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-black outline-red52 mx-3 mr-0 mt-6" |
|
|
|
|
onChange={e => { setSelectedState(e.target.value); setUserInfo({ ...userInfo, provinceId: e.target.value }) }}> |
|
|
|
|
<option value={null}>استان</option> |
|
|
|
|
{ |
|
|
|
@ -554,7 +576,7 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select |
|
|
|
|
className="bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-gray-400 outline-red52 mx-3 mr-0 mt-6" |
|
|
|
|
className="bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-black outline-red52 mx-3 mr-0 mt-6" |
|
|
|
|
onChange={(e) => { setSelectedCity(e.target.value); setUserInfo({ ...userInfo, cityId: e.target.value }) }}> |
|
|
|
|
<option value={null}> |
|
|
|
|
شهر |
|
|
|
@ -572,12 +594,14 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
<div className="w-40"> |
|
|
|
|
<Button borderType='rounded' title='مرحله بعد' onClick={() => { |
|
|
|
|
const inputs = document.querySelectorAll('.Login-box-form-item-input') |
|
|
|
|
if (inputs[0].value) { |
|
|
|
|
if (userInfo.firstName && userInfo.lastName && userInfo.birthDate && userInfo.gradeIds |
|
|
|
|
&& userInfo.nationalId && userInfo.gender && userInfo.previousSchoolName && userInfo.previousSchoolType |
|
|
|
|
&& userInfo.zone && files.personalPic && files.shenasNameh) { |
|
|
|
|
setSteps(1) |
|
|
|
|
setActiveStep([true, true, false, false]) |
|
|
|
|
setError('') |
|
|
|
|
} else { |
|
|
|
|
alert('لطفا تمامی فیلد ها را پر کنید') |
|
|
|
|
toast.warning('لطفا تمامی فیلد ها را پر کنید') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}} /> |
|
|
|
@ -608,17 +632,21 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
} |
|
|
|
|
})} /> |
|
|
|
|
<Input className={'w-52'} title="نام خانوادگی" borderType="rounded" id={1} direction='rtl' value={userInfo.fatherInfo.lastName} |
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, fatherInfo:{...userInfo.fatherInfo, lastName: _onInput.noNumber(e.target.value) }})} /> |
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, fatherInfo: { ...userInfo.fatherInfo, lastName: _onInput.noNumber(e.target.value) } })} /> |
|
|
|
|
<Input className={'w-52'} title="کدملی" borderType="rounded" gapSize="12" id={2} type='text' max={10} value={userInfo.fatherInfo.nationalId} |
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, fatherInfo: { |
|
|
|
|
...userInfo.fatherInfo, |
|
|
|
|
nationalId : _onInput.numberOnly(e.target.value) |
|
|
|
|
} })} /> |
|
|
|
|
<select className="bg-white border border-solid border-gray-200 w-52 px-3 rounded text-gray-400 outline-red52 py-1 h-12 mt-6"
|
|
|
|
|
onChange={e => setUserInfo({...userInfo, fatherInfo: { |
|
|
|
|
...userInfo.fatherInfo, |
|
|
|
|
education: e.target.value |
|
|
|
|
}})}> |
|
|
|
|
onChange={e => setUserInfo({ |
|
|
|
|
...userInfo, fatherInfo: { |
|
|
|
|
...userInfo.fatherInfo, |
|
|
|
|
nationalId: _onInput.numberOnly(e.target.value) |
|
|
|
|
} |
|
|
|
|
})} /> |
|
|
|
|
<select className="bg-white border border-solid border-gray-200 w-52 px-3 rounded text-black outline-red52 py-1 h-12 mt-6" |
|
|
|
|
onChange={e => setUserInfo({ |
|
|
|
|
...userInfo, fatherInfo: { |
|
|
|
|
...userInfo.fatherInfo, |
|
|
|
|
education: e.target.value |
|
|
|
|
} |
|
|
|
|
})}> |
|
|
|
|
{madraks.map((item) => ( |
|
|
|
|
<option key={`madraks${item.id}`} value={item.id}>{item.title}</option> |
|
|
|
|
))} |
|
|
|
@ -631,19 +659,21 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
<div className="flex flex-wrap justify-between"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Input className={'w-52'} title="تلفن همراه" borderType="rounded" max={11} id={3} value={userInfo.fatherInfo.cellphone} onChange={e => setUserInfo({ ...userInfo, fatherInfo:{ |
|
|
|
|
...userInfo.fatherInfo, |
|
|
|
|
cellphone: _onInput.phonenumber(e.target.value) |
|
|
|
|
}})} /> |
|
|
|
|
<Input className={'w-52'} title="شغل" borderType="rounded" direction='rtl' gapSize="8" id={4} value={userInfo.fatherInfo.job}
|
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, fatherInfo: { ...userInfo.fatherInfo, job:e.target.value }})} /> |
|
|
|
|
<Input className={'w-52'} title="تلفن همراه" borderType="rounded" max={11} id={3} value={userInfo.fatherInfo.cellphone} onChange={e => setUserInfo({ |
|
|
|
|
...userInfo, fatherInfo: { |
|
|
|
|
...userInfo.fatherInfo, |
|
|
|
|
cellphone: _onInput.phonenumber(e.target.value) |
|
|
|
|
} |
|
|
|
|
})} /> |
|
|
|
|
<Input className={'w-52'} title="شغل" borderType="rounded" direction='rtl' gapSize="8" id={4} value={userInfo.fatherInfo.job} |
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, fatherInfo: { ...userInfo.fatherInfo, job: e.target.value } })} /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Input className={'w-52'} title="محل کار" borderType="rounded" id={5} direction='rtl' value={userInfo.fatherInfo.workPlace} |
|
|
|
|
|
|
|
|
|
<Input className={'w-52'} title="محل کار" borderType="rounded" id={5} direction='rtl' value={userInfo.fatherInfo.workPlace}
|
|
|
|
|
|
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, fatherInfo:{...userInfo.fatherInfo, workPlace: e.target.value }})} /> |
|
|
|
|
<Input className={'w-52'} title="تلفن محل کار" borderType="rounded" gapSize="28" id={6} type='text' max={11} value={userInfo.fatherInfo.workPhone}
|
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, fatherInfo:{...userInfo.fatherInfo, workPhone: _onInput.numberOnly(e.target.value) }})} /> |
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, fatherInfo: { ...userInfo.fatherInfo, workPlace: e.target.value } })} /> |
|
|
|
|
<Input className={'w-52'} title="تلفن محل کار" borderType="rounded" gapSize="28" id={6} type='text' max={11} value={userInfo.fatherInfo.workPhone} |
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, fatherInfo: { ...userInfo.fatherInfo, workPhone: _onInput.numberOnly(e.target.value) } })} /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -661,21 +691,23 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
<div className="flex flex-wrap justify-between"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Input className={'w-52'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={7} value={userInfo.motherInfo.firstName}
|
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, motherInfo:{...userInfo.motherInfo, firstName: _onInput.noNumber(e.target.value) }})} /> |
|
|
|
|
<Input className={'w-52'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={7} value={userInfo.motherInfo.firstName} |
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, motherInfo: { ...userInfo.motherInfo, firstName: _onInput.noNumber(e.target.value) } })} /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Input className={'w-52'} title="نام خانوادگی" borderType="rounded" id={8} direction='rtl' value={userInfo.motherInfo.lastName}
|
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, motherInfo:{...userInfo.motherInfo, lastName: _onInput.noNumber(e.target.value) }})} /> |
|
|
|
|
<Input className={'w-52'} title="کدملی" borderType="rounded" gapSize="12" id={9} type='text' max={10} value={userInfo.motherInfo.nationalId}
|
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, motherInfo:{...userInfo.motherInfo, nationalId: _onInput.numberOnly(e.target.value) }})} /> |
|
|
|
|
<Input className={'w-52'} title="نام خانوادگی" borderType="rounded" id={8} direction='rtl' value={userInfo.motherInfo.lastName} |
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, motherInfo: { ...userInfo.motherInfo, lastName: _onInput.noNumber(e.target.value) } })} /> |
|
|
|
|
<Input className={'w-52'} title="کدملی" borderType="rounded" gapSize="12" id={9} type='text' max={10} value={userInfo.motherInfo.nationalId} |
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, motherInfo: { ...userInfo.motherInfo, nationalId: _onInput.numberOnly(e.target.value) } })} /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select className="bg-white border border-solid border-gray-200 w-52 px-3 rounded text-gray-400 outline-red52 py-1 h-12 mt-6" |
|
|
|
|
onChange={e => setUserInfo({...userInfo, motherInfo: { |
|
|
|
|
...userInfo.motherInfo, |
|
|
|
|
education: e.target.value |
|
|
|
|
}})}> |
|
|
|
|
<select className="bg-white border border-solid border-gray-200 w-52 px-3 rounded text-black outline-red52 py-1 h-12 mt-6" |
|
|
|
|
onChange={e => setUserInfo({ |
|
|
|
|
...userInfo, motherInfo: { |
|
|
|
|
...userInfo.motherInfo, |
|
|
|
|
education: e.target.value |
|
|
|
|
} |
|
|
|
|
})}> |
|
|
|
|
{madraks.map((item) => ( |
|
|
|
|
<option key={`madraks${item.id}`} value={item.id}>{item.title}</option> |
|
|
|
|
))} |
|
|
|
@ -688,30 +720,38 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
<div className="flex flex-wrap justify-between"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Input className={'w-52'} title="تلفن همراه" borderType="rounded" type='text' id={10} max={11} value={userInfo.motherInfo.cellphone}
|
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, motherInfo: { |
|
|
|
|
...userInfo.motherInfo, |
|
|
|
|
cellphone: _onInput.phonenumber(e.target.value) |
|
|
|
|
}})} /> |
|
|
|
|
<Input className={'w-52'} title="شغل" borderType="rounded" direction='rtl' gapSize="8" id={11} value={userInfo.motherInfo.job}
|
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, motherInfo:{ |
|
|
|
|
...userInfo.motherInfo, |
|
|
|
|
job: e.target.value |
|
|
|
|
} })} /> |
|
|
|
|
<Input className={'w-52'} title="تلفن همراه" borderType="rounded" type='text' id={10} max={11} value={userInfo.motherInfo.cellphone} |
|
|
|
|
onChange={e => setUserInfo({ |
|
|
|
|
...userInfo, motherInfo: { |
|
|
|
|
...userInfo.motherInfo, |
|
|
|
|
cellphone: _onInput.phonenumber(e.target.value) |
|
|
|
|
} |
|
|
|
|
})} /> |
|
|
|
|
<Input className={'w-52'} title="شغل" borderType="rounded" direction='rtl' gapSize="8" id={11} value={userInfo.motherInfo.job} |
|
|
|
|
onChange={e => setUserInfo({ |
|
|
|
|
...userInfo, motherInfo: { |
|
|
|
|
...userInfo.motherInfo, |
|
|
|
|
job: e.target.value |
|
|
|
|
} |
|
|
|
|
})} /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Input className={'w-52'} title="محل کار" borderType="rounded" id={12} direction='rtl' |
|
|
|
|
value={userInfo.motherInfo.workPlace}
|
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, motherInfo: { |
|
|
|
|
...userInfo.motherInfo, |
|
|
|
|
workPlace: e.target.value |
|
|
|
|
} })} /> |
|
|
|
|
<Input className={'w-52'} title="تلفن محل کار" borderType="rounded" gapSize="28" id={13} type='text' max={11}
|
|
|
|
|
value={userInfo.motherInfo.workPhone}
|
|
|
|
|
onChange={e => setUserInfo({ ...userInfo, motherInfo: { |
|
|
|
|
...userInfo.motherInfo, |
|
|
|
|
workPhone: _onInput.numberOnly(e.target.value) |
|
|
|
|
} })} /> |
|
|
|
|
value={userInfo.motherInfo.workPlace} |
|
|
|
|
onChange={e => setUserInfo({ |
|
|
|
|
...userInfo, motherInfo: { |
|
|
|
|
...userInfo.motherInfo, |
|
|
|
|
workPlace: e.target.value |
|
|
|
|
} |
|
|
|
|
})} /> |
|
|
|
|
<Input className={'w-52'} title="تلفن محل کار" borderType="rounded" gapSize="28" id={13} type='text' max={11} |
|
|
|
|
value={userInfo.motherInfo.workPhone} |
|
|
|
|
onChange={e => setUserInfo({ |
|
|
|
|
...userInfo, motherInfo: { |
|
|
|
|
...userInfo.motherInfo, |
|
|
|
|
workPhone: _onInput.numberOnly(e.target.value) |
|
|
|
|
} |
|
|
|
|
})} /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -751,14 +791,24 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
|
|
|
|
|
<div className="w-40"> |
|
|
|
|
<Button borderType='rounded' title='مرحله بعد' onClick={() => { |
|
|
|
|
const inputs = document.querySelectorAll('.Login-box-form-item-input') |
|
|
|
|
if (inputs[0].value) { |
|
|
|
|
// const inputs = document.querySelectorAll('.Login-box-form-item-input')
|
|
|
|
|
|
|
|
|
|
if( userInfo.motherInfo.cellphone && userInfo.motherInfo.education |
|
|
|
|
&& userInfo.motherInfo.firstName && userInfo.motherInfo.job |
|
|
|
|
&& userInfo.motherInfo.lastName && userInfo.motherInfo.nationalId |
|
|
|
|
&& userInfo.motherInfo.workPhone && userInfo.motherInfo.workPlace |
|
|
|
|
&& userInfo.fatherInfo.cellphone && userInfo.fatherInfo.education |
|
|
|
|
&& userInfo.fatherInfo.firstName && userInfo.fatherInfo.job |
|
|
|
|
&& userInfo.fatherInfo.lastName && userInfo.fatherInfo.nationalId |
|
|
|
|
&& userInfo.fatherInfo.workPhone && userInfo.fatherInfo.workPlace
|
|
|
|
|
&& userInfo.familyMemberCount && userInfo.address |
|
|
|
|
&& userInfo.phone) { |
|
|
|
|
setSteps(2); |
|
|
|
|
|
|
|
|
|
setActiveStep([true, true, true, false]) |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
alert('لطفا تمامی فیلد ها را پر کنید') |
|
|
|
|
toast.warning('لطفا تمامی فیلد ها را پر کنید') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -775,13 +825,13 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
{ |
|
|
|
|
steps == 2 && |
|
|
|
|
<> |
|
|
|
|
<div className="w-full px-10 pb-6 border-b border-solid border-gray-200"> |
|
|
|
|
<div className="w-full px-10 pb-6 border-bflex flex-col border-solid border-gray-200"> |
|
|
|
|
<div className="mb-4"> |
|
|
|
|
<h1 className="font-black">قوانین و مقررات ثبت نام</h1> |
|
|
|
|
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا قوانین و مقررات را مطالعه فرمایید</p> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<p className="text-gray-500 text-justify"> |
|
|
|
|
<div className="text-gray-500 text-justify"> |
|
|
|
|
بند اول: موارد مربوط به آموزش مخاطبین |
|
|
|
|
پیر مردی هر روز تو محله می دید پسر کی با کفش های پاره و پای برهنه با توپ پلاستیکی فوتبال بازی می کند، روزی رفت ی کتانی نو خرید و اومد و به پسرک گفت بیا این کفشا رو بپوش…پسرک کفشا رو پوشید و خوشحال رو به پیر مرد کرد و گفت: شما خدایید؟! پیر مرد لبش را گزید و گفت نه! پسرک گفت پس دوست خدایی، چون من دیشب فقط به خدا گفتم كه کفش ندارم |
|
|
|
|
هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس میزند... در نهایت این مرگ است که باید پیروز شود، زیرا از هنگام تولد بخشی از سرنوشت ما شده و فقط مدت کوتاهی پیش از بلعیدن طعمه اش، با آن بازی می کند. با این همه، ما تا آنجا که ممکن است، با علاقه فراوان و دلواپسی زیاد به زندگی ادامه می دهیم، همان طور که تا آنجا که ممکن است طولانی تر در یک حباب صابون می دمیم تا بزرگتر شود، گر چه با قطعیتی تمام می دانیم که خواهد ترکید. |
|
|
|
@ -794,17 +844,17 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
بند سوم: موارد مربوط به آموزش مخاطبین |
|
|
|
|
خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ﺩﺍﺩ : ﺩﺭ ﺯﻧﺪﮔﯽ ﺩﺭﻭﻍ ﻧﮕﻮ ﭼﺮﺍ ﮐﻪ ﺍﮔﺮ ﮔﻔﺘﯽ ﺻﺪﺍﻗﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﯿﺎﻧﺖ ﻧﮑﻦ ﮐﻪ ﺍﮔﺮ ﮐﺮﺩﯼ ﻋﺸﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﺸﻮﻧﺖ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﻣﺤﺒﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﻧﺎ ﺣﻖ ﻧﮕﻮ ﺍﮔﺮ ﮔﻔﺘﯽ ﺣﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺑﯽ ﺣﯿﺎﯾﯽ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﺷﺮﺍﻓﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍی... ﭘﺲ ﺩﺭ ﺯﻧﺪﮔﯽ ﻓﻘﻂ ﺩﺯﺩﯼ نکن |
|
|
|
|
|
|
|
|
|
</p> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
<div className="flex items-center px-10 py-6"> |
|
|
|
|
{/* <input type="checkbox" className="w-6 h-6" />*/} |
|
|
|
|
<Checkbox name={'PARENTS_CHECKED'} onChange={e =>
|
|
|
|
|
e.target.checked ? setUserInfo({...userInfo, rulesAccepted: true}) |
|
|
|
|
:setUserInfo({...userInfo, rulesAccepted: false}) |
|
|
|
|
<Checkbox name={'PARENTS_CHECKED'} onChange={e => |
|
|
|
|
e.target.checked ? setUserInfo({ ...userInfo, rulesAccepted: true }) |
|
|
|
|
: setUserInfo({ ...userInfo, rulesAccepted: false }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}/> |
|
|
|
|
} /> |
|
|
|
|
<label className="mr-4 font-bold text-gray-500"> |
|
|
|
|
اینجانبان |
|
|
|
|
<span className="text-red52 font-bold"> {userInfo.fatherInfo.firstName} {userInfo.fatherInfo.lastName} </span> |
|
|
|
@ -825,8 +875,12 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
|
|
|
|
|
<div className="w-40"> |
|
|
|
|
<Button borderType='rounded' title='مرحله بعد' onClick={() => { |
|
|
|
|
setSteps(3); |
|
|
|
|
if(userInfo.rulesAccepted){ |
|
|
|
|
setSteps(3); |
|
|
|
|
setActiveStep([true, true, true, true]) |
|
|
|
|
} else{ |
|
|
|
|
toast.warning('متاسفانه امکان رفتن به مرحله بعد در صورت عدم توافق با قوانین و مقررات نیست') |
|
|
|
|
} |
|
|
|
|
}} /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -897,10 +951,45 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div className="w-40"> |
|
|
|
|
<Button borderType='rounded' title='تایید' to='/' onClick={() => |
|
|
|
|
<Button borderType='rounded' title='تایید' to='/' onClick={async () => { |
|
|
|
|
// activeLogin()
|
|
|
|
|
setProfile(userInfo) |
|
|
|
|
} /> |
|
|
|
|
try { |
|
|
|
|
let access = window.localStorage.getItem("access"); |
|
|
|
|
const formData = new FormData(); |
|
|
|
|
formData.append("file", files.shenasNameh); |
|
|
|
|
let res = await axios.post(ApiConfig.baseUrl + '/file/upload', formData, { |
|
|
|
|
headers: { |
|
|
|
|
'content-type': 'multipart/form-data',
|
|
|
|
|
Authorization: `Bearer ${access}` |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if (res.data) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
const personalPic = new FormData(); |
|
|
|
|
personalPic.append("file", files.personalPic); |
|
|
|
|
let resp = await axios.post(ApiConfig.baseUrl + '/file/upload', personalPic, { |
|
|
|
|
headers: { |
|
|
|
|
'content-type': 'multipart/form-data',
|
|
|
|
|
Authorization: `Bearer ${access}` |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(resp.data){ |
|
|
|
|
|
|
|
|
|
setProfile({...userInfo,
|
|
|
|
|
shenasnamehFileId: res.data?.data?.id, |
|
|
|
|
personalPicFileId: resp.data?.data?.id |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} catch (err) { |
|
|
|
|
console.error(err) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (error) { |
|
|
|
|
console.error(error) |
|
|
|
|
} |
|
|
|
|
}} /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|