Latest Changes

main
Pedram Keshavarzi 2 years ago
parent af611f97a8
commit 666fa19f38
  1. 14
      package-lock.json
  2. 2
      package.json
  3. 18
      src/App.js
  4. 7
      src/components/ShoppingCart/index.js
  5. 7
      src/components/Timer/index.js
  6. 40
      src/components/fileInput/index.js
  7. 19
      src/components/input/index.js
  8. 16
      src/components/nav/Nav.js
  9. 17
      src/redux/actions/userFactor.js
  10. 5
      src/redux/reducers/user.js
  11. 3
      src/redux/reducers/userFactor.js
  12. 18
      src/view/LoginSignUp/index.css
  13. 123
      src/view/LoginSignUp/index.js
  14. 71
      src/view/LoginSignUp/mobile/index.js
  15. 211
      src/view/register/index.js
  16. 89
      src/view/register/mobile/index.js
  17. 8
      yarn.lock

14
package-lock.json generated

@ -35,7 +35,7 @@
"react-router-dom": "^6.2.1",
"react-scripts": "5.0.0",
"react-slideshow-image": "^3.7.0",
"react-toastify": "^8.1.1",
"react-toastify": "^8.2.0",
"redux": "^4.1.2",
"redux-devtools-extension": "^2.13.9",
"redux-thunk": "^2.4.1",
@ -14656,9 +14656,9 @@
}
},
"node_modules/react-toastify": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-8.1.1.tgz",
"integrity": "sha512-KQa+j+JHjy69xpPYheaWUq3SjVw1sV2D7/QsXW6Tpo2x9HhUCvASezAMYDmLhfAYoSnaXUVnTNFAgZQA75SExQ==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-8.2.0.tgz",
"integrity": "sha512-Pg2Ju7NngAamarFvLwqrFomJ57u/Ay6i6zfLurt/qPynWkAkOthu6vxfqYpJCyNhHRhR4hu7+bySSeWWJu6PAg==",
"dependencies": {
"clsx": "^1.1.1"
},
@ -28095,9 +28095,9 @@
}
},
"react-toastify": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-8.1.1.tgz",
"integrity": "sha512-KQa+j+JHjy69xpPYheaWUq3SjVw1sV2D7/QsXW6Tpo2x9HhUCvASezAMYDmLhfAYoSnaXUVnTNFAgZQA75SExQ==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-8.2.0.tgz",
"integrity": "sha512-Pg2Ju7NngAamarFvLwqrFomJ57u/Ay6i6zfLurt/qPynWkAkOthu6vxfqYpJCyNhHRhR4hu7+bySSeWWJu6PAg==",
"requires": {
"clsx": "^1.1.1"
}

@ -30,7 +30,7 @@
"react-router-dom": "^6.2.1",
"react-scripts": "5.0.0",
"react-slideshow-image": "^3.7.0",
"react-toastify": "^8.1.1",
"react-toastify": "^8.2.0",
"redux": "^4.1.2",
"redux-devtools-extension": "^2.13.9",
"redux-thunk": "^2.4.1",

@ -7,6 +7,9 @@ import Nav from './components/nav/Nav';
import Dashboard from './view/dashboard/Dashboard';
import Accounting from './view/accounting/Accounting';
import Messages from './view/messages/Messages';
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
// import "react-modern-drawer/dist/index.css";
import Login from './view/login/Login';
import { useEffect, useState } from 'react';
// import {useParams} from 'react-router-dom';
@ -666,7 +669,7 @@ function App() {
return (
<Provider store={store}>
<div>
<Router>
<div className="App">
{LOGIN && <Header logOut={logOut} />}
@ -731,6 +734,19 @@ function App() {
</Routes>
</div>
</Router>
<ToastContainer
position="top-right"
theme="colored"
autoClose={5000}
hideProgressBar={false}
newestOnTop={true}
closeOnClick
rtl={true}
pauseOnFocusLoss
draggable
pauseOnHover
/>
</div>
</Provider>
);
}

@ -29,7 +29,8 @@ function ShoppingCart({
schoolList,
desktopContentTransform,
pushToCart,
pushSchoolToCart
pushSchoolToCart,
paySchool
}) {
const [phase, setPhase] = useState("products");
@ -144,7 +145,7 @@ function ShoppingCart({
<div className="text-xs h-10 flex items-center p-2 border-l-2 border-gray-300 text-gray-400"> رزرو پیش ثبت نام </div>
<h1 className="text-md font-black px-2 text-black40"> {school?.product?.name}</h1>
</div>
<button className="w-full px-1 h-12 mt-1 text-white bg-red52 rounded-lg font-semibold" style={{fontSize: '0.65vw'}}>
<button className="w-full px-1 h-12 mt-1 text-white bg-red52 rounded-lg font-semibold" style={{fontSize: '0.65vw'}} onClick={() => paySchool()}>
پرداخت مستقیم به حساب مدرسه با مبلغ {separate(school.price)} تومان
</button>
<p className="w-full text-right text-xs mt-2">
@ -226,6 +227,7 @@ function ShoppingCart({
title={`پرداخت هزینه : ${factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0} تومان`}
borderType='rounded-xl'
className='h-16 text-xl xl:text-sm'
onClick={() => payFactor()}
/>
</div>
@ -250,6 +252,7 @@ const mapDispatchToProps = {
getInfo: userProduct.info,
getFactorInfo: userFactor.info,
payFactor: userFactor.payment,
paySchool: userFactor.paymentSchool,
setHeaderOptions: publicApi.setHeaderOptions,
pushToCart: userProduct.add,
pushSchoolToCart: userProduct.addSchool,

@ -52,7 +52,7 @@ export default class Timer extends Component {
}
startTimer() {
if (this.timer === 0 && this.state.seconds > 0) {
if (this.timer === 0 && this.state.seconds >= 0) {
this.timer = setInterval(this.countDown, 1000);
}
}
@ -70,12 +70,15 @@ export default class Timer extends Component {
};
componentWillUnmount() {
if(this.props.refresh){
clearInterval(this.timer);
}
}
render() {
return (
<>
<div className="timer text-greenBA text-sm inline">
<div className="timer text-red52 text-sm inline">
{this.state.time ? this.state.time.m : ''}:{this.state.time ? this.state.time.s : ''}
</div>
</>

@ -5,7 +5,10 @@ import { useState, useEffect } from "react";
const FileInput = ({
title,
id,
mobile
mobile,
onChange,
file,
deleteHandler
}) => {
const [focus, setFocus] = useState('border-gray-300 border-dotted');
@ -13,10 +16,16 @@ const FileInput = ({
const [imageUrl, setImageUrl] = useState(null);
const [del, setDelete] = useState(false);
useEffect(() => {
if (selectedImage) {
setImageUrl(URL.createObjectURL(selectedImage));
if (file) {
setImageUrl(URL.createObjectURL(file));
setDelete(true)
}else{
setImageUrl(null);
setDelete(false)
setFocus('border-gray-300 border-dotted')
}
}, [selectedImage]);
}, [file]);
function overrideEventDefaults(event) {
event.preventDefault();
@ -32,21 +41,21 @@ const FileInput = ({
let files = Array.from(fileList);
// setFiles(files);
console.log(files);
setSelectedImage(files[0]);
onChange(files[0]);
}
};
useEffect(() => {
if(mobile){
setDelete(true)
}
}, [mobile])
// useEffect(() => {
// if(mobile){
// setDelete(true)
// }
// }, [mobile])
return (
<div className={mobile ? "w-full" : `max-w-48 min-w-40 w-52`} onDrop={overrideEventDefaults}
onDragEnter={overrideEventDefaults}
onDragLeave={overrideEventDefaults}
onDragOver={overrideEventDefaults}>
<input type='file' className="hidden" id={`file` + id} accept="image/*" onFocus={() => setFocus('border-red52')} onChange={e => { setSelectedImage(e.target.files[0]); setFocus('border-red52 border-solid') }} />
<input type='file' className="hidden" id={`file` + id} accept="image/*" onFocus={() => setFocus('border-red52')} onChange={e => { onChange(e.target.files[0]); setFocus('border-red52 border-solid') }} />
<label
onDrop={handleDragAndDropFiles}
onDragEnter={overrideEventDefaults}
@ -69,15 +78,16 @@ const FileInput = ({
</>
:
<>
<div className="h-40 flex flex-col justify-center items-center w-full" onMouseEnter={() => setDelete(true)} onMouseLeave={() => setDelete(false)}>
<div className="h-40 flex flex-col justify-center items-center w-full" >
<img src={imageUrl} className="rounded-lg max-w-full max-h-32" />
{del && <div className=" top-0 mt-2 relative bg-red-500 w-full h-12 flex items-center justify-center text-white rounded-lg" onClick={() => setSelectedImage(null)}>
<button>حذف</button>
</div>}
</div>
</>
}
</label>
{del && <div className=" top-0 mt-2 cursor-pointer relative bg-red-500 w-full h-12 flex items-center justify-center text-white rounded-lg" onClick={() => deleteHandler(null)}>
حذف
</div>}
</div>

@ -20,7 +20,7 @@ const Input = ({
useEffect(() => {
if(value !== null && value !== '' && value !== undefined){
blurHandler(id ? id : 0)
blurHandler2(id ? id : 0)
}
}, [value])
@ -32,6 +32,7 @@ const Input = ({
inputs[id].style.borderColor = "#df1452";
inputs[id].style.backgroundColor = "#fff";
inputs[id].style.color = '#404040';
label[id].style.transform = `translate(-10px,-27px)`;
label[id].style.color = "#df1452";
line[id].style.backgroundColor = "#fff";
@ -52,6 +53,20 @@ const Input = ({
line[id].style.backgroundColor = "#fff";
}
};
const blurHandler2 = (id) => {
let inputsBox = document.querySelectorAll(".Login-box-form-item");
let inputs = document.querySelectorAll(".Login-box-form-item-input");
let label = document.querySelectorAll(".Login-box-form-item-label");
let line = document.querySelectorAll(".Login-box-form-item-line");
if (inputs[id]) {
inputsBox[id].style.borderColor = "#404040";
label[id].style.transform = "translate(-10px,-27px)";
label[id].style.color = "#404040";
inputs[id].style.backgroundColor = "#fff";
line[id].style.backgroundColor = "#fff";
}
};
return (
<div style={style} className={`${className} Login-box-form-item w-full h-12 ${borderType ? borderType : 'rounded-lg'} border border-color7 mt-6 relative flex items-center flex-row-reverse`}>
@ -64,7 +79,7 @@ const Input = ({
name="Login-box-form-item-input-name"
id={`Login-box-form-item-input-name${id}`}
className={`Login-box-form-item-input w-full h-full px-4 outline-0 rounded-lg text-gray-700 focus:text-red52`}
className={`Login-box-form-item-input w-full h-full px-4 outline-0 rounded-lg text-gray-700 `}
style={{ direction: direction ? direction : "ltr", backgroundColor: bg }}
onFocus={() => {if(onFocus){onFocus();} focusHandler(id ? id : 0)}}

@ -174,14 +174,14 @@ useEffect(() => {
</div>
<div
className="back-item-img w-full h-[12.5%] bg-red52 absolute right-0 z-20 transition-all duration-300"
style={
initai_navId === 2
? { top: `${(3 / 12) * 100}%` }
: initai_navId === 5
? { top: `${(6 / 12) * 100}%` }
:
null
}
// style={
// initai_navId === 2
// ? { top: `${(3 / 12) * 100}%` }
// : initai_navId === 5
// ? { top: `${(6 / 12) * 100}%` }
// :
// null
// }
></div>
{/* ------------ */}

@ -10,6 +10,11 @@ const userFactor = {
async (dispatch) => {
await proxy.post("userFactor/payment", data, { dispatch });
},
paymentSchool:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.post("userFactor/paymentSchool", data, { dispatch });
},
add:
(data = {}, data2 = {}) =>
async (dispatch) => {
@ -24,12 +29,12 @@ const userFactor = {
},
//vod
payment:
(data1 = {}, data2 = {}) =>
async (dispatch) => {
await proxy.post("userProduct/addVOD", data1, { dispatch });
await proxy.post("userFactor/paymentVOD", data2, { dispatch });
},
// payment:
// (data1 = {}, data2 = {}) =>
// async (dispatch) => {
// await proxy.post("userProduct/addVOD", data1, { dispatch });
// await proxy.post("userFactor/paymentVOD", data2, { dispatch });
// },
verify:
(data = {}) =>
async (dispatch) =>

@ -4,8 +4,9 @@ import { toast } from "react-toastify";
const initialState = {
status: {
name: 'کوروش',
lastName: 'زراندوز',
name: '',
lastName: '',
displayName: '',
roles: [],
rolesString: [
{

@ -33,6 +33,9 @@ export default function userFactor(state = initialState, action) {
case "userFactor/payment":
window.location.replace(data);
return { ...state, loading: false, error: null };
case "userFactor/paymentSchool":
window.location.replace(data);
return { ...state, loading: false, error: null };
//vod
case "userFactor/myList":
return { ...state, loading: false, list: data, error: null };

@ -3,7 +3,16 @@
.slideshow {
margin: 0 auto;
overflow: hidden;
width:650px;
/* max-width:650px; */
width: 90%;
height: 90%;
display: flex;
flex-direction: column;
justify-content: between;
justify-items: center;
/* background: green */
}
.slideshowSlider {
@ -14,7 +23,8 @@
.slide {
display: inline-block;
height: 600px;
/* max-height: 600px; */
/* height: 40vh; */
width: 100%;
border-radius: 40px;
}
@ -27,8 +37,8 @@
.slideshowDot {
display: inline-block;
height: 6px;
width: 6px;
height: 0.3vw;
width: 0.3vw;
border-radius: 50%;
cursor: pointer;

@ -33,6 +33,7 @@ const LoginSignUp = ({ activeLogin,
const [index, setIndex] = useState(1);
const [register, setRegister] = useState(false);
const timeoutRef = useRef(null);
const [ppSection, setPpSection] = useState(false);
const focusHandler = (id) => {
let inputs = document.querySelectorAll(".Login-box-form-item");
@ -222,42 +223,103 @@ const LoginSignUp = ({ activeLogin,
navigate("/");
}
}, [loginFlag]);
useEffect(() => {
console.log(resend)
}, [resend])
const light = theme === "light";
return (
isMobile ? <LoginSignUpMobile activeLogin={activeLogin}/>:
<div className="w-full flex items-center justify-center" style={{ height: '100vh', direction: 'rtl' }}>
<div className="w-3/4 border border-solid border-gray-200 flex rounded-xl">
<div className="w-3/4 border h-4/5 items-center border-solid border-gray-200 flex rounded-xl">
{/* form */}
<div className="flex w-2/5 border-0 border-l border-solid border flex-col items-center p-6">
<div className="flex w-2/5 flex-col h-full max-h-full justify-between items-center p-6">
<div className="h-12 w-full flex justify-end">
{steps != 0 &&
<div className="w-12 h-full bg-gray-200 rounded-xl flex items-center justify-center text-gray-500 m-0 text-2xl font-light cursor-pointer" onClick={() => setSteps(steps - 1)}>
{steps != 0 && !ppSection &&
<div className="w-12 h-12 bg-gray-200 rounded-xl flex items-center justify-center text-gray-500 m-0 text-2xl font-light cursor-pointer" onClick={() => {
if(ppSection){
setPpSection(false)
}else{
setSteps(steps - 1)
}
}}>
{`>`}
</div>
}
{
ppSection &&
<div className="w-12 h-12 bg-gray-200 rounded-xl flex items-center justify-center text-gray-500 m-0 text-2xl font-light cursor-pointer" onClick={() => {
if(ppSection){
setPpSection(false)
}else{
setSteps(steps - 1)
}
}}>
{`>`}
</div>
}
</div>
<img src={logo} className="w-1/3 m-6" />
<div className="flex flex-col items-start justify-start leading-normal">
{/* privacy policy Section */}
{
steps == 2 ? <h1 className="text-red26 text-lg font-bold">تاییدیه ثبت نام</h1> : <>
ppSection ? <div className="h-4/5 w-full flex flex-col items-center">
<h1 className="text-lg font-bold text-red52"> قوانین و شرایط استفاده</h1>
<div className="w-full h-full text-gray-500 text-justify px-6 py-4 overflow-x-hidden overflow-scroll">
بند اول: موارد مربوط به آموزش مخاطبین
پیر مردی هر روز تو محله می دید پسر کی با کفش های پاره و پای برهنه با توپ پلاستیکی فوتبال بازی می کند، روزی رفت ی کتانی نو خرید و اومد و به پسرک گفت بیا این کفشا رو بپوشپسرک کفشا رو پوشید و خوشحال رو به پیر مرد کرد و گفت: شما خدایید؟! پیر مرد لبش را گزید و گفت نه! پسرک گفت پس دوست خدایی، چون من دیشب فقط به خدا گفتم كه کفش ندارم
هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس میزند... در نهایت این مرگ است که باید پیروز شود، زیرا از هنگام تولد بخشی از سرنوشت ما شده و فقط مدت کوتاهی پیش از بلعیدن طعمه اش، با آن بازی می کند. با این همه، ما تا آنجا که ممکن است، با علاقه فراوان و دلواپسی زیاد به زندگی ادامه می دهیم، همان طور که تا آنجا که ممکن است طولانی تر در یک حباب صابون می دمیم تا بزرگتر شود، گر چه با قطعیتی تمام می دانیم که خواهد ترکید.
پیر مردی هر روز تو محله می دید پسر کی با کفش های پاره و پای برهنه با توپ پلاستیکی فوتبال بازی می کند، روزی رفت ی کتانی نو خرید و اومد و به پسرک گفت بیا این کفشا رو بپوشپسرک کفشا رو پوشید و خوشحال رو به پیر مرد کرد و گفت: شما خدایید؟! پیر مرد لبش را گزید و گفت نه! پسرک گفت پس دوست خدایی، چون من دیشب فقط به خدا گفتم كه کفش ندارم
بند دوم: موارد مربوط به آموزش مخاطبین
خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﺍﺩﺍﻣﻪ ﺩﺍﺩ : ﺩﺭ ﺯﻧﺪﮔﯽ ﺩﺭﻭﻍ ﻧﮕﻮ ﭼﺮﺍ ﮐﻪ ﺍﮔﺮ ﮔﻔﺘﯽ ﺻﺪﺍﻗﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﯿﺎﻧﺖ ﻧﮑﻦ ﮐﻪ ﺍﮔﺮ ﮐﺮﺩﯼ ﻋﺸﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﺸﻮﻧﺖ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﻣﺤﺒﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﻧﺎ ﺣﻖ ﻧﮕﻮ ﺍﮔﺮ ﮔﻔﺘﯽ ﺣﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺑﯽ ﺣﯿﺎﯾﯽ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﺷﺮﺍﻓﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍی... ﭘﺲ ﺩﺭ ﺯﻧﺪﮔﯽ ﻓﻘﻂ ﺩﺯﺩﯼ نکن
پیر مردی هر روز تو محله می دید پسر کی با کفش های پاره و پای برهنه با توپ پلاستیکی فوتبال بازی می کند، روزی رفت ی کتانی نو خرید و اومد و به پسرک گفت بیا این کفشا رو بپوشپسرک کفشا رو پوشید و خوشحال رو به پیر مرد کرد و گفت: شما خدایید؟! پیر مرد لبش را گزید و گفت نه! پسرک گفت پس دوست خدایی، چون من دیشب فقط به خدا گفتم كه کفش ندارم
هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس میزند... در نهایت این مرگ است که باید پیروز شود، زیرا از هنگام تولد بخشی از سرنوشت ما شده و فقط مدت کوتاهی پیش از بلعیدن طعمه اش، با آن بازی می کند. با این همه، ما تا آنجا که ممکن است، با علاقه فراوان و دلواپسی زیاد به زندگی ادامه می دهیم، همان طور که تا آنجا که ممکن است طولانی تر در یک حباب صابون می دمیم تا بزرگتر شود، گر چه با قطعیتی تمام می دانیم که خواهد ترکید.
پیر مردی هر روز تو محله می دید پسر کی با کفش های پاره و پای برهنه با توپ پلاستیکی فوتبال بازی می کند، روزی رفت ی کتانی نو خرید و اومد و به پسرک گفت بیا این کفشا رو بپوشپسرک کفشا رو پوشید و خوشحال رو به پیر مرد کرد و گفت: شما خدایید؟! پیر مرد لبش را گزید و گفت نه! پسرک گفت پس دوست خدایی، چون من دیشب فقط به خدا گفتم كه کفش ندارم
بند سوم: موارد مربوط به آموزش مخاطبین
خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﺍﺩﺍﻣﻪ ﺩﺍﺩ : ﺩﺭ ﺯﻧﺪﮔﯽ ﺩﺭﻭﻍ ﻧﮕﻮ ﭼﺮﺍ ﮐﻪ ﺍﮔﺮ ﮔﻔﺘﯽ ﺻﺪﺍﻗﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﯿﺎﻧﺖ ﻧﮑﻦ ﮐﻪ ﺍﮔﺮ ﮐﺮﺩﯼ ﻋﺸﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﺸﻮﻧﺖ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﻣﺤﺒﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﻧﺎ ﺣﻖ ﻧﮕﻮ ﺍﮔﺮ ﮔﻔﺘﯽ ﺣﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺑﯽ ﺣﯿﺎﯾﯽ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﺷﺮﺍﻓﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍی... ﭘﺲ ﺩﺭ ﺯﻧﺪﮔﯽ ﻓﻘﻂ ﺩﺯﺩﯼ نکن
</div>
</div>
:
<>
<img src={logo} className="h-1/6" />
<div className="flex flex-col w-4/5 items-start justify-start leading-normal">
{
steps == 2 ? <h1 className="text-red26 w-full text-lg font-bold">تاییدیه ثبت نام</h1> : <>
<h1 className="text-red26 text-lg font-bold">ورود یا ثبت نام</h1>
<h1 className="text-red26 text-lg font-bold">سامانه ثبت نام مدارس موسسه علمی اندیشمند</h1>
<h1 className="text-red26 text-right font-bold" style={{fontSize: '100%'}}>سامانه ثبت نام مدارس موسسه علمی اندیشمند</h1>
</>
}
<p className="text-gray-500 text-sm mt-2">
<p className="text-gray-500 text-sm mt-1">
{
steps == 2 ? <div>
steps == 2 ? <div className="">
{resend ?
<div>
<span className="ml-2">کد تایید ارسال نشد؟</span>
<button className="text-red52"
onClick={() => {
checkPhoneNumber(signUpFields?.cellphone);
setResend(false)
}}
>درخواست مجدد کد تایید</button>
</div>
:<>
یک کد چهار رقمی تا &nbsp;{" "}
<Timer seconds={120} refresh={setResend} /> &nbsp; دیگر برای شماره
<Timer seconds={120} refresh={() => {setResend(true)}} /> &nbsp; دیگر برای شماره
&nbsp;{" "}
<span className="text-greenBA text-sm">
<span className="text-red52 text-sm">
{signUpFields?.cellphone}
</span>{" "}
&nbsp; ارسال خواهد شد.
</div> : <div>
</> } </div> : steps == 1 ?
<div>
<br />
کاربر گرامی لطفا شماره موبایل خود را وارد کنید
<br />
</div>
: <div className="text-right mt-1" style={{fontSize: '100%'}}>
کاربر گرامی لطفا یکی از دو گزینه زیر را انتخاب نمایید.
<br />
در صورتی که عضو نیستید روی دکمه ثبت نام بزنید
@ -372,7 +434,7 @@ const LoginSignUp = ({ activeLogin,
inputMode="numeric"
style={{ direction: "ltr" }}
name="otp1"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1 focus:bg-white focus:outline-red52 focus:text-red52"
onChange={(e) =>
onChange(
e.target.name,
@ -386,7 +448,7 @@ const LoginSignUp = ({ activeLogin,
inputMode="numeric"
style={{ direction: "ltr" }}
name="otp2"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1 focus:bg-white focus:outline-red52 focus:text-red52"
onChange={(e) =>
onChange(
e.target.name,
@ -400,7 +462,7 @@ const LoginSignUp = ({ activeLogin,
inputMode="numeric"
style={{ direction: "ltr" }}
name="otp3"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1 focus:bg-white focus:outline-red52 focus:text-red52"
onChange={(e) =>
onChange(
e.target.name,
@ -414,7 +476,7 @@ const LoginSignUp = ({ activeLogin,
inputMode="numeric"
style={{ direction: "ltr" }}
name="otp4"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1 focus:bg-white focus:outline-red52 focus:text-red52"
onChange={(e) =>
onChange(
e.target.name,
@ -442,7 +504,7 @@ const LoginSignUp = ({ activeLogin,
<div className="text-xs text-gray1">
شماره خود را اشتباه وارد کردید؟{" "}
<button
className="bg-transparent border-none text-greenBA font-medium"
className="bg-transparent border-none text-red52 font-medium"
onClick={() => {setSteps(1); setLevel("phonenumber")}}
>
اصلاح شماره تلفن
@ -452,26 +514,29 @@ const LoginSignUp = ({ activeLogin,
</div>
</>
}
</div>
<div className="w-full flex flex-col items-center justify-center">
<p className="w-3/5 text-xs my-20 text-center text-red26">
<p className="w-2/5 text-xs text-center text-red26">
ثبت نام شما در سامانه به منزله قبول
<Link to="" className="font-bold"> شرایط و قوانین استفاده </Link>
<Link to="" onClick={() => setPpSection(true)} className="font-bold"> شرایط و قوانین استفاده </Link>
میباشد
</p>
<p className="text-gray-300 text-xs">1401 - 1400</p>
</div>
</div>
</>
}
<p className="text-gray-300 text-xs">1401 - 1400</p>
</div>
{/* Slider */}
<div className="bg-grayEC w-3/5 rounded-tl-xl rounded-bl-xl flex flex-col items-center justify-center" >
<div className="slideshow" style={{ direction: 'ltr' }}>
<div className="bg-grayEC w-3/5 rounded-tl-xl h-full rounded-bl-xl flex flex-col items-center justify-center" >
<div className="slideshow justify-center" style={{ direction: 'ltr' }}>
<div
className="slideshowSlider"
className="slideshowSlider w-full"
style={{ transform: `translate3d(${-index * 100}%, 0, 0)` }}
>
{[slideContents[slideContents.length - 1],
@ -483,15 +548,15 @@ const LoginSignUp = ({ activeLogin,
>
<div className="w-full flex flex-col justify-center items-center">
<img src={item.image} style={{ height: '500px' }} />
<h1 className="w-4/5 text-xl my-2 text-red26 font-bold">{item.title}</h1>
<img src={item.image} className="h-72" />
<h1 className="w-4/5 text-xl my-2 text-red26 font-bold whitespace-normal">{item.title}</h1>
<p className=" px-12 text-right text-sm whitespace-normal">{item.description}</p>
</div>
</div>
))}
</div>
<div className="slideshowDots">
<div className="slideshowDots mt-2">
{slideContents.map((_, idx) => (
<div
key={idx}

@ -223,26 +223,26 @@ const LoginSignUpMobile = ({
return (
<div className="w-full flex flex-col items-center justify-center" style={{ height: '100vh', direction: 'rtl' }}>
<div className="w-full flex flex-col justify-between rounded-xl">
<div className="w-full flex flex-col h-full justify-between pt-10 pb-24 rounded-xl">
{/* form */}
<div className="flex w-full border-0 border-l border-solid border flex-col items-center justify-between p-6">
<div className="h-12 w-full flex justify-end">
<div className="h-12 w-full px-5 flex justify-end">
{steps != 0 &&
<div className="w-12 h-full bg-gray-200 rounded-xl flex items-center justify-center text-gray-500 m-0 text-2xl font-light cursor-pointer" onClick={() => setSteps(steps - 1)}>
<div className="w-12 h-12 bg-gray-200 rounded-xl flex items-center justify-center text-gray-500 m-0 text-2xl font-light cursor-pointer" onClick={() => setSteps(steps - 1)}>
{`>`}
</div>
}
</div>
<img src={logo} className="w-1/3 m-6" />
<div className={`flex w-full ${steps == 2 ? 'h-full justify-center' : 'justify-between'} flex-col items-center p-6`}>
<img src={logo} className="w-1/2 m-6" />
<div className="flex flex-col w-full items-start justify-start leading-normal">
{
steps == 2 ? <h1 className="text-red26 text-lg font-bold">تاییدیه ثبت نام</h1> :
<>
<div className=" w-full flex flex-col items-center justify-center" >
<div className="slideshow" style={{ direction: 'ltr' }}>
<div className=" w-full flex flex-col items-center justify-center h-4/5" >
<div className="slideshow items-center justify-center" style={{ direction: 'ltr' }}>
<div
className="slideshowSlider"
className="slideshowSlider w-full"
style={{ transform: `translate3d(${-index * 100}%, 0, 0)` }}
>
{[slideContents[slideContents.length - 1],
@ -253,8 +253,8 @@ const LoginSignUpMobile = ({
key={`sildeNo${index}`}
>
<div className="w-full flex flex-col justify-center items-center">
<img src={item.image} style={{ height: '200px' }} />
<div className="w-full h-full flex flex-col justify-center items-center">
<img src={item.image} className="h-2/5" />
<h1 className="w-4/5 text-sm my-2 text-red26 font-bold whitespace-normal">{item.title}</h1>
<p className=" px-12 text-right text-xs whitespace-normal">{item.description}</p>
</div>
@ -262,7 +262,7 @@ const LoginSignUpMobile = ({
))}
</div>
<div className="slideshowDots">
{/* <div className="slideshowDots">
{slideContents.map((_, idx) => (
<div
key={idx}
@ -272,25 +272,35 @@ const LoginSignUpMobile = ({
}}
></div>
))}
</div>
</div> */}
</div>
</div>
</>
}
<p className="text-gray-500 text-sm mt-2">
<p className="text-gray-500 text-sm mt-2 flex justify-center">
{
steps == 2 && <div>
steps == 2 && (resend ?
<div>
<span className="ml-2">کد تایید ارسال نشد؟</span>
<button className="text-red52"
onClick={() => {
checkPhoneNumber(signUpFields?.cellphone);
setResend(false)
}}
>درخواست مجدد کد تایید</button>
</div>
: <div className="w-4/5 ">
یک کد چهار رقمی تا &nbsp;{" "}
<Timer seconds={120} refresh={setResend} /> &nbsp; دیگر برای شماره
<Timer seconds={120} refresh={() => { setResend(true) }} /> &nbsp; دیگر برای شماره
&nbsp;{" "}
<span className="text-greenBA text-sm">
<span className="text-red52 text-sm">
{signUpFields?.cellphone}
</span>{" "}
&nbsp; ارسال خواهد شد.
</div>
</div>)
}
</p>
@ -364,7 +374,7 @@ const LoginSignUpMobile = ({
inputMode="numeric"
style={{ direction: "ltr" }}
name="otp1"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1 focus:text-red52 focus:bg-white focus:outline-red52"
onChange={(e) =>
onChange(
e.target.name,
@ -378,7 +388,7 @@ const LoginSignUpMobile = ({
inputMode="numeric"
style={{ direction: "ltr" }}
name="otp2"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1 focus:text-red52 focus:bg-white focus:outline-red52"
onChange={(e) =>
onChange(
e.target.name,
@ -392,7 +402,7 @@ const LoginSignUpMobile = ({
inputMode="numeric"
style={{ direction: "ltr" }}
name="otp3"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1 focus:text-red52 focus:bg-white focus:outline-red52"
onChange={(e) =>
onChange(
e.target.name,
@ -406,7 +416,7 @@ const LoginSignUpMobile = ({
inputMode="numeric"
style={{ direction: "ltr" }}
name="otp4"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1"
className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1 focus:text-red52 focus:bg-white focus:outline-red52"
onChange={(e) =>
onChange(
e.target.name,
@ -430,11 +440,11 @@ const LoginSignUpMobile = ({
>
تایید
</Link>
<div className="mt-2 flex flex-row text-center w-full justify-center">
<div className="mt-3 flex flex-row text-center w-full justify-center">
<div className="text-xs text-gray1">
شماره خود را اشتباه وارد کردید؟{" "}
<button
className="bg-transparent border-none text-greenBA font-medium"
className="bg-transparent border-none text-red52 font-medium"
onClick={() => setSteps(1)}
>
اصلاح شماره تلفن
@ -470,18 +480,17 @@ const LoginSignUpMobile = ({
};
const mapStateToProps = (state) => ({
loginFlag : state.user.status,
loginFlag: state.user.status,
isMobile: state.publicApi.isMobile,
});
});
const mapDispatchToProps = {
const mapDispatchToProps = {
sendOtp: user.otp_login,
sendPhoneNumber: user.otp,
setHeaderOptions: publicApi.setHeaderOptions,
};
};
export default connect(
export default connect(
mapStateToProps,
mapDispatchToProps
)(LoginSignUpMobile);
)(LoginSignUpMobile);

@ -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,9 +39,12 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
getProvince();
getCity();
}, [])
useEffect(() => {
if(user?.firstName !== null){
setUserInfo({...userInfo,
if (user?.firstName !== null) {
setUserInfo({
...userInfo,
firstName: user.firstName,
lastName: user.lastName,
nationalId: user.nationalId,
@ -47,7 +52,7 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
gender: user.gender,
previousSchoolName: user.previousSchoolName,
previousSchoolType: user.previousSchoolType,
zone:user.zone,
zone: user.zone,
familyMemberCount: user.familyMemberCount,
phone: user.phone,
address: user.address
@ -56,7 +61,7 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
}
}, [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,
@ -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: 'تلفن همراه',
@ -386,6 +395,7 @@ 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%' }}>
@ -451,13 +461,13 @@ 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)
@ -474,8 +484,7 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
day: 1
})
}
renderButton={(direction, handleClick) =>
{
renderButton={(direction, handleClick) => {
return <p className="text-red-500 cursor-pointer font-bold mx-2"
onClick={() => handleClick()}
>
@ -488,11 +497,12 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
/>
<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">
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>
@ -520,8 +542,8 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
<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">
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: {
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: {
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:{
<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 }})} />
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}
onChange={e => setUserInfo({ ...userInfo, fatherInfo:{...userInfo.fatherInfo, workPlace: 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) }})} />
onChange={e => setUserInfo({ ...userInfo, fatherInfo: { ...userInfo.fatherInfo, workPhone: _onInput.numberOnly(e.target.value) } })} />
@ -662,20 +692,22 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
<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) }})} />
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) }})} />
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) }})} />
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: {
<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>
))}
@ -689,29 +721,37 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
<Input className={'w-52'} title="تلفن همراه" borderType="rounded" type='text' id={10} max={11} value={userInfo.motherInfo.cellphone}
onChange={e => setUserInfo({ ...userInfo, motherInfo: {
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:{
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: {
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: {
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})
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={() => {
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>

@ -18,6 +18,8 @@ import persian_fa from "react-date-object/locales/persian_fa"
import DatePicker, { DateObject } from "react-multi-date-picker";
import "react-multi-date-picker/styles/colors/red.css"
import "react-multi-date-picker/styles/layouts/mobile.css"
import axios from "axios";
import { ApiConfig } from "../../../constants/defaultValues";
const MobileRegister = ({
@ -375,6 +377,11 @@ const MobileRegister = ({
},
]
const [files, setFiles] = useState({
shenasNameh: null,
personalPic: null
})
const CostumeDatePickerInput = ({ openCalendar, value, handleValueChange, title }) => {
return (
@ -459,9 +466,17 @@ const MobileRegister = ({
</select>
<br></br>
<FileInput title="بارگزاری صفحه اول شناسنامه" id={1} mobile />
<FileInput title="بارگزاری صفحه اول شناسنامه" id={1} mobile
file={files.shenasNameh}
onChange={e => setFiles({ ...files, shenasNameh: e })}
deleteHandler={e => setFiles({ ...files, shenasNameh: e })}
/>
<br></br>
<FileInput title="بارگزاری عکس پرسنلی" id={2} mobile />
<FileInput title="بارگزاری عکس پرسنلی" id={2}
file={files.personalPic}
onChange={e => setFiles({ ...files, personalPic: e })}
deleteHandler={e => setFiles({ ...files, personalPic: e })}
mobile />
<br></br>
@ -526,13 +541,15 @@ const MobileRegister = ({
<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 {
// toast.warn('لطفا تمامی فیلد ها را پر کنید')
// }
} else {
toast.warning('لطفا تمامی فیلد ها را پر کنید')
}
}} />
</div>
@ -711,10 +728,24 @@ const MobileRegister = ({
<Button borderType='rounded' title='مرحله بعد' onClick={() => {
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 {
toast.warning('لطفا تمامی فیلد ها را پر کنید')
}
}} />
@ -779,8 +810,12 @@ const MobileRegister = ({
<div className="w-1/2 mr-2">
<Button borderType='rounded' title='مرحله بعد' onClick={() => {
if(userInfo.rulesAccepted){
setSteps(3);
setActiveStep([true, true, true, true])
} else{
toast.warning('متاسفانه امکان رفتن به مرحله بعد در صورت عدم توافق با قوانین و مقررات نیست')
}
}} />
</div>
</div>
@ -849,9 +884,45 @@ const MobileRegister = ({
</div>
<div className="w-1/2 mr-2">
<Button borderType='rounded' title='تایید' to='/' onClick={() =>
setProfile(userInfo)
} />
<Button borderType='rounded' title='تایید' to='/' onClick={async () => {
// activeLogin()
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>

@ -7947,10 +7947,10 @@
"@tweenjs/tween.js" "^18.1.2"
"resize-observer-polyfill" "^1.5.1"
"react-toastify@^8.1.1":
"integrity" "sha512-KQa+j+JHjy69xpPYheaWUq3SjVw1sV2D7/QsXW6Tpo2x9HhUCvASezAMYDmLhfAYoSnaXUVnTNFAgZQA75SExQ=="
"resolved" "https://registry.npmjs.org/react-toastify/-/react-toastify-8.1.1.tgz"
"version" "8.1.1"
"react-toastify@^8.2.0":
"integrity" "sha512-Pg2Ju7NngAamarFvLwqrFomJ57u/Ay6i6zfLurt/qPynWkAkOthu6vxfqYpJCyNhHRhR4hu7+bySSeWWJu6PAg=="
"resolved" "https://registry.npmjs.org/react-toastify/-/react-toastify-8.2.0.tgz"
"version" "8.2.0"
dependencies:
"clsx" "^1.1.1"

Loading…
Cancel
Save