Faze 1 Final Changes

main
Pedram Keshavarzi 3 years ago
parent 19f0edea4e
commit af611f97a8
  1. 49
      package-lock.json
  2. 2
      package.json
  3. 32
      src/App.js
  4. 31
      src/components/Map/index.js
  5. BIN
      src/components/Map/pin.png
  6. 8
      src/components/Product/index.js
  7. 13
      src/components/ShoppingCart/Code/index.js
  8. 14
      src/components/ShoppingCart/Product/index.js
  9. 320
      src/components/ShoppingCart/index.js
  10. 2
      src/components/Stepper/index.js
  11. 9
      src/components/exam/Carousel/index.js
  12. 23
      src/components/fileInput/index.js
  13. 35
      src/components/header/Header.js
  14. 15
      src/components/header/MobileSideMenu/index.js
  15. 20
      src/components/input/index.js
  16. 2
      src/components/input/signUpInput.js
  17. 40
      src/components/nav/Nav.js
  18. 2
      src/constants/defaultValues.js
  19. 4
      src/redux/actions/book.js
  20. 2
      src/redux/actions/product.js
  21. 7
      src/redux/actions/user.js
  22. 9
      src/redux/actions/userProduct.js
  23. 2
      src/redux/proxy.js
  24. 4
      src/redux/reducers/book.js
  25. 7
      src/redux/reducers/product.js
  26. 36
      src/redux/reducers/public.js
  27. 22
      src/redux/reducers/user.js
  28. 7
      src/redux/reducers/userProduct.js
  29. 15
      src/utils/onInput.js
  30. 55
      src/view/LoginSignUp/index.js
  31. 2
      src/view/LoginSignUp/mobile/index.js
  32. 4
      src/view/addExam/index.js
  33. 2
      src/view/addExam/views/AddDescription.js
  34. 2
      src/view/addExam/views/AddGradeGroup.js
  35. 28
      src/view/addExam/views/AddQuestionsFromBank.js
  36. 10
      src/view/addExam/views/ViewExam.js
  37. 2
      src/view/addProduct/components/metrics.js
  38. 4
      src/view/addProduct/components/payment.js
  39. 38
      src/view/contact/index.js
  40. 42
      src/view/dashboard2/Games.js
  41. 462
      src/view/register/index.js
  42. 560
      src/view/register/mobile/index.js
  43. 207
      src/view/services/index.js
  44. 10
      src/view/services/service/index.js
  45. 21
      yarn.lock

49
package-lock.json generated

@ -16,6 +16,7 @@
"draft-js": "^0.11.7", "draft-js": "^0.11.7",
"jalaali-js": "^1.2.3", "jalaali-js": "^1.2.3",
"jalali-moment": "^3.3.10", "jalali-moment": "^3.3.10",
"leaflet": "^1.7.1",
"lord-icon-element": "^3.3.3", "lord-icon-element": "^3.3.3",
"lottie-web": "^5.8.1", "lottie-web": "^5.8.1",
"mapir-react-component": "^2.0.1", "mapir-react-component": "^2.0.1",
@ -28,6 +29,7 @@
"react-dropzone": "^11.4.2", "react-dropzone": "^11.4.2",
"react-icons": "^4.3.1", "react-icons": "^4.3.1",
"react-indiana-drag-scroll": "^2.1.0", "react-indiana-drag-scroll": "^2.1.0",
"react-leaflet": "^3.2.5",
"react-multi-date-picker": "^3.3.0", "react-multi-date-picker": "^3.3.0",
"react-redux": "^7.2.6", "react-redux": "^7.2.6",
"react-router-dom": "^6.2.1", "react-router-dom": "^6.2.1",
@ -2833,6 +2835,16 @@
"node": ">= 8" "node": ">= 8"
} }
}, },
"node_modules/@react-leaflet/core": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@react-leaflet/core/-/core-1.1.1.tgz",
"integrity": "sha512-7PGLWa9MZ5x/cWy8EH2VzI4T8q5WpuHbixzCDXqixP/WyqwIrg5NDUPgYuFnB4IEIZF+6nA265mYzswFo/h1Pw==",
"peerDependencies": {
"leaflet": "^1.7.1",
"react": "^17.0.1",
"react-dom": "^17.0.1"
}
},
"node_modules/@react-pdf-viewer/core": { "node_modules/@react-pdf-viewer/core": {
"version": "3.1.2", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/@react-pdf-viewer/core/-/core-3.1.2.tgz", "resolved": "https://registry.npmjs.org/@react-pdf-viewer/core/-/core-3.1.2.tgz",
@ -11403,6 +11415,11 @@
"language-subtag-registry": "~0.3.2" "language-subtag-registry": "~0.3.2"
} }
}, },
"node_modules/leaflet": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.7.1.tgz",
"integrity": "sha512-/xwPEBidtg69Q3HlqPdU3DnrXQOvQU/CCHA1tcDQVzOwm91YMYaILjNp7L4Eaw5Z4sOYdbBz6koWyibppd8Zqw=="
},
"node_modules/leven": { "node_modules/leven": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
@ -14436,6 +14453,19 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
}, },
"node_modules/react-leaflet": {
"version": "3.2.5",
"resolved": "https://registry.npmjs.org/react-leaflet/-/react-leaflet-3.2.5.tgz",
"integrity": "sha512-Z3KZ+4SijsRbbrt2I1a3ZDY6+V6Pm91eYTdxTN18G6IOkFRsJo1BuSPLFnyFrlF3WDjQFPEcTPkEgD1VEeAoBg==",
"dependencies": {
"@react-leaflet/core": "^1.1.1"
},
"peerDependencies": {
"leaflet": "^1.7.1",
"react": "^17.0.1",
"react-dom": "^17.0.1"
}
},
"node_modules/react-mapbox-gl": { "node_modules/react-mapbox-gl": {
"version": "4.8.6", "version": "4.8.6",
"resolved": "https://registry.npmjs.org/react-mapbox-gl/-/react-mapbox-gl-4.8.6.tgz", "resolved": "https://registry.npmjs.org/react-mapbox-gl/-/react-mapbox-gl-4.8.6.tgz",
@ -19533,6 +19563,12 @@
} }
} }
}, },
"@react-leaflet/core": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@react-leaflet/core/-/core-1.1.1.tgz",
"integrity": "sha512-7PGLWa9MZ5x/cWy8EH2VzI4T8q5WpuHbixzCDXqixP/WyqwIrg5NDUPgYuFnB4IEIZF+6nA265mYzswFo/h1Pw==",
"requires": {}
},
"@react-pdf-viewer/core": { "@react-pdf-viewer/core": {
"version": "3.1.2", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/@react-pdf-viewer/core/-/core-3.1.2.tgz", "resolved": "https://registry.npmjs.org/@react-pdf-viewer/core/-/core-3.1.2.tgz",
@ -25844,6 +25880,11 @@
"language-subtag-registry": "~0.3.2" "language-subtag-registry": "~0.3.2"
} }
}, },
"leaflet": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.7.1.tgz",
"integrity": "sha512-/xwPEBidtg69Q3HlqPdU3DnrXQOvQU/CCHA1tcDQVzOwm91YMYaILjNp7L4Eaw5Z4sOYdbBz6koWyibppd8Zqw=="
},
"leven": { "leven": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
@ -27910,6 +27951,14 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
}, },
"react-leaflet": {
"version": "3.2.5",
"resolved": "https://registry.npmjs.org/react-leaflet/-/react-leaflet-3.2.5.tgz",
"integrity": "sha512-Z3KZ+4SijsRbbrt2I1a3ZDY6+V6Pm91eYTdxTN18G6IOkFRsJo1BuSPLFnyFrlF3WDjQFPEcTPkEgD1VEeAoBg==",
"requires": {
"@react-leaflet/core": "^1.1.1"
}
},
"react-mapbox-gl": { "react-mapbox-gl": {
"version": "4.8.6", "version": "4.8.6",
"resolved": "https://registry.npmjs.org/react-mapbox-gl/-/react-mapbox-gl-4.8.6.tgz", "resolved": "https://registry.npmjs.org/react-mapbox-gl/-/react-mapbox-gl-4.8.6.tgz",

@ -11,6 +11,7 @@
"draft-js": "^0.11.7", "draft-js": "^0.11.7",
"jalaali-js": "^1.2.3", "jalaali-js": "^1.2.3",
"jalali-moment": "^3.3.10", "jalali-moment": "^3.3.10",
"leaflet": "^1.7.1",
"lord-icon-element": "^3.3.3", "lord-icon-element": "^3.3.3",
"lottie-web": "^5.8.1", "lottie-web": "^5.8.1",
"mapir-react-component": "^2.0.1", "mapir-react-component": "^2.0.1",
@ -23,6 +24,7 @@
"react-dropzone": "^11.4.2", "react-dropzone": "^11.4.2",
"react-icons": "^4.3.1", "react-icons": "^4.3.1",
"react-indiana-drag-scroll": "^2.1.0", "react-indiana-drag-scroll": "^2.1.0",
"react-leaflet": "^3.2.5",
"react-multi-date-picker": "^3.3.0", "react-multi-date-picker": "^3.3.0",
"react-redux": "^7.2.6", "react-redux": "^7.2.6",
"react-router-dom": "^6.2.1", "react-router-dom": "^6.2.1",

@ -631,8 +631,11 @@ function App() {
} }
} }
} }
let loginStorage = localStorage.getItem('login') let loginStorage = localStorage.getItem('userData');
const [LOGIN,setLOGIN]=useState(true); let userData = JSON.parse(loginStorage);
console.log(loginStorage == null);
console.log(userData)
const [LOGIN,setLOGIN]=useState(loginStorage == undefined ? false : true);
const activeLogin=()=>{ const activeLogin=()=>{
setLOGIN(true) setLOGIN(true)
localStorage.setItem('login', true) localStorage.setItem('login', true)
@ -645,9 +648,9 @@ function App() {
localStorage.setItem('login', false) localStorage.setItem('login', false)
}; };
useEffect(() => { // useEffect(() => {
setLOGIN(true); // setLOGIN(true);
}, [loginStorage]) // }, [loginStorage])
//--UserFullInfo--------------------- //--UserFullInfo---------------------
const [ActiveUserFullInfo, setActiveUserFullInfo] = useState(false); const [ActiveUserFullInfo, setActiveUserFullInfo] = useState(false);
@ -667,14 +670,17 @@ function App() {
<Router> <Router>
<div className="App"> <div className="App">
{LOGIN && <Header logOut={logOut} />} {LOGIN && <Header logOut={logOut} />}
{LOGIN && <Nav logOut={logOut} />} {LOGIN && <Nav />}
<Routes> <Routes>
<Route path='/' element={window.innerWidth <= 1024 && <Dashboard <Route path='/' element={LOGIN ? (
window.innerWidth <= 1024 && <Dashboard
ActiveUserFullInfo={ActiveUserFullInfo} ActiveUserFullInfo={ActiveUserFullInfo}
UserFullInfoData={UserFullInfoData} UserFullInfoData={UserFullInfoData}
showUserFullInfo={showUserFullInfo} showUserFullInfo={showUserFullInfo}
hideUserFullInfo={hideUserFullInfo} hideUserFullInfo={hideUserFullInfo}
/>} /> />)
: <LoginSignUp activeLogin={activeLogin}/>
} />
<Route path="/myServices" element={LOGIN ? <Route path="/myServices" element={LOGIN ?
<Dashboard <Dashboard
ActiveUserFullInfo={ActiveUserFullInfo} ActiveUserFullInfo={ActiveUserFullInfo}
@ -683,12 +689,9 @@ function App() {
hideUserFullInfo={hideUserFullInfo} hideUserFullInfo={hideUserFullInfo}
/> />
: <LoginSignUp activeLogin={activeLogin}/>} /> : <LoginSignUp activeLogin={activeLogin}/>} />
<Route
path="/login"
element={
<Login activeLogin={activeLogin} />} {
/> LOGIN ? <>
<Route <Route
path="/buy-packages/:id" path="/buy-packages/:id"
element={ element={
@ -722,6 +725,9 @@ function App() {
<Route path='/contacts' element={<ContactUs />} /> <Route path='/contacts' element={<ContactUs />} />
<Route exact path="/azmoon_list/enter_exam/:id" element={<ENTER_EXAM />}/> <Route exact path="/azmoon_list/enter_exam/:id" element={<ENTER_EXAM />}/>
<Route exact path="/dashboard/azmoon_list/exam/:id" element={<EXAM />} /> <Route exact path="/dashboard/azmoon_list/exam/:id" element={<EXAM />} />
</>
: <Route path='*' element={<LoginSignUp activeLogin={activeLogin}/>} />
}
</Routes> </Routes>
</div> </div>
</Router> </Router>

@ -1,6 +1,6 @@
import Mapir from "mapir-react-component"; import Mapir from "mapir-react-component";
import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet'
// import blueMark from '../../../assets/icons/marker-blue.png'; import blueMark from './pin.png';
// import './index.scss'; // import './index.scss';
@ -19,21 +19,16 @@ const Map = Mapir.setToken({
export default function location() { export default function location() {
return ( return (
<Mapir <MapContainer center={[35.717468300391516,51.39856669551662]} zoom={13}>
userLocation={true} <TileLayer
Map={Map} attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
apiKey={ url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjliNzIxYmZhZDZlMGI3MzYxMzFiMTMyNjEyZDQ1M2E3ZDg4YTEzMjc2ZDUyYTA5ZDNmOThiNWFjZTM1NDZlMmMwZDU2M2Y5YzY3N2U0NGFhIn0.eyJhdWQiOiIxNDc1OSIsImp0aSI6IjliNzIxYmZhZDZlMGI3MzYxMzFiMTMyNjEyZDQ1M2E3ZDg4YTEzMjc2ZDUyYTA5ZDNmOThiNWFjZTM1NDZlMmMwZDU2M2Y5YzY3N2U0NGFhIiwiaWF0IjoxNjI1NjY2NzI2LCJuYmYiOjE2MjU2NjY3MjYsImV4cCI6MTYyODI1ODcyNiwic3ViIjoiIiwic2NvcGVzIjpbImJhc2ljIl19.OIjSLWyNCGALY2C0EFDGPEEUbPqOxL6GxCDkeX1B5C218eTk0qkmlGs8z4E87Y-qL7_PG814UZwcngjdRybVwabMtgfHsJj7DRDtrdBzCW7HRlJXqrSRG7xOuJmFhcn4-HtXRQUOEUn8quQukXPek8zvMtRBoMNsefS5s6es2oAg7Fmv0o5T2uZyDzMnRAfrTb1SKtv52Q_yXWYPtQNZdZcwe9Ed-ZkGeAXuTY2tafow92Oq8mmRxrzaq9Ne3gtu98UqXA3rwzRaQ1ToXU_Tcjh5UCVS6hZAzhI-GQk7KfrLbOOyDCxfd9v7_qXnIkRR6dd3bZ69H-jvlytaxMl51Q" />
} <Marker position={[35.717468300391516,51.39856669551662]}>
center={[51.401464,35.700815 ]} {/* <Popup>
> A pretty CSS3 popup. <br /> Easily customizable.
<Mapir.Marker </Popup> */}
coordinates={[51.401464,35.700815 ]} </Marker>
anchor="top" </MapContainer>
// Image={blueMark}
style={{width:20, height: 20}}
className="marker"
></Mapir.Marker>
</Mapir>
); );
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -75,7 +75,7 @@ const ProductDesign = ({
] ]
if (catId == 1) { if (catId == 3) {
return ( return (
<div className={`flex flex-col cursor-pointer pt-4 text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`} <div className={`flex flex-col cursor-pointer pt-4 text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`}
style={{ width: !isMobile && '375px' , direction: 'rtl' }} style={{ width: !isMobile && '375px' , direction: 'rtl' }}
@ -119,7 +119,7 @@ const ProductDesign = ({
) )
} }
if (catId == 2) { if (catId == 5) {
return ( return (
<div className="w-full flex justify-center"> <div className="w-full flex justify-center">
<div className={`flex ${isMobile ? 'flex-col w-11/12 border-red52' : 'border-red82OP pt-4'} border my-4 rounded-lg `} style={{width: !isMobile && '90%' }}> <div className={`flex ${isMobile ? 'flex-col w-11/12 border-red52' : 'border-red82OP pt-4'} border my-4 rounded-lg `} style={{width: !isMobile && '90%' }}>
@ -188,7 +188,7 @@ const ProductDesign = ({
</div> </div>
) )
} }
if(catId == 3){ if(catId == 2){
return( return(
<div className={`flex cursor-pointer flex-col pt-4 text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`} <div className={`flex cursor-pointer flex-col pt-4 text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`}
style={{ width: !isMobile && '375px', direction: 'rtl' }} style={{ width: !isMobile && '375px', direction: 'rtl' }}
@ -247,7 +247,7 @@ const ProductDesign = ({
) )
} }
if(catId == 4){ if(catId == 1){
return ( return (
<div className={`flex flex-col cursor-pointer text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`} <div className={`flex flex-col cursor-pointer text-right rounded-xl justify-start w-full m-4 border border-red82OP ${isMobile && 'w-11/12'}`}
style={{ width: !isMobile && '375px', direction: 'rtl' }} style={{ width: !isMobile && '375px', direction: 'rtl' }}

@ -1,23 +1,26 @@
import React, {useState} from "react"; import React, {useState} from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { userFactor } from "../../../redux/actions"; import { userFactor } from "../../../redux/actions";
import _onInput from "../../../utils/onInput";
function Code({ codeId, setCodeId, userId, factorId }) { function Code({ codeId, setCodeId, userId, factorId }) {
const [value, setValue] = React.useState(codeId || ""); const [value, setValue] = useState(codeId || "");
const setOff = () => { const setOff = () => {
setCodeId({ offCodeValue: value, userId: userId, id: factorId }); setCodeId({ offCodeValue: value, userId: userId, id: factorId });
} }
return ( return (
<form className="flex w-full flex-row border border-red52 border-solid rounded-xl my-3 overflow-hidden"> <div className="flex w-full items-center h-14 my-3 overflow-hidden">
<input <input
type="text" type="text"
className="border-0 flex-1 text-right pr-3 font-medium text-tiny bg-white outline-none placeholder:text-blue5F dark:text-white" className="border-red52 border-solid w-full border rounded-xl rounded-l-none flex-1 text-right pr-3 h-full font-medium text-tiny bg-white outline-none placeholder:text-blue5F dark:text-white"
placeholder={"کد تخفیف دارید ؟"} placeholder={"کد تخفیف دارید ؟"}
value={value}
onChange={e => setValue(_onInput.englishAndNumberWithoutSpace(e.target.value))}
/> />
<button className={"py-4 px-6 text-tiny bg-red52 text-white border border-red52 border-solid"} onClick={setOff}>ثبت کد</button> <button className={" w-20 h-full text-tiny bg-red52 text-white border border-red52 border-solid rounded-xl rounded-r-none"} onClick={() => setOff()}>ثبت کد</button>
</form> </div>
); );
} }

@ -6,8 +6,9 @@ import { userProduct } from "../../../redux/actions";
// import bookImage from "../../../assets/images/zist-11.svg"; // import bookImage from "../../../assets/images/zist-11.svg";
import exitIcon from "../../../assets/img/exit.svg"; import exitIcon from "../../../assets/img/exit.svg";
import deleteIcon from "../../../assets/img/delete.svg"; import deleteIcon from "../../../assets/img/delete.svg";
import separate from "../../../utils/separate";
function Product({ product, grades, pushToCart, isMobile }) { function Product({ product, grades, pushToCart, isMobile, productTypes }) {
// return isMobile ? ( // return isMobile ? (
// <div className="flex flex-row justify-between py-5 border-b border-solid border-grayDB dark:border-gray45"> // <div className="flex flex-row justify-between py-5 border-b border-solid border-grayDB dark:border-gray45">
// <div className="flex flex-row"> // <div className="flex flex-row">
@ -146,10 +147,10 @@ function Product({ product, grades, pushToCart, isMobile }) {
// </div> // </div>
// </div> // </div>
return ( return (
<div className="flex bg-white justify-between items-center border-2 border-gray-300 p-4 rounded-xl m-2 " style={{ width: '90%' }}> <div className="flex bg-white justify-between items-center border-2 border-gray-300 p-4 pr-2 rounded-xl m-2 " style={{ width: '90%' }}>
<div className="flex items-center "> <div className="flex items-center ">
<div className="text-sm h-10 flex items-center p-2 border-l-2 border-gray-300 text-gray-400"> {product?.product?.book?.category} </div> <div className="text-xs h-10 flex items-center p-1 border-l-2 border-gray-300 text-gray-400"> {productTypes.find(itm => itm.id == product?.productType).title} </div>
<h1 className="text-lg font-black px-2 text-black40"> {product?.product?.book?.name}</h1> <h1 className="text-sm font-black px-2 text-black40"> {product?.product?.name}</h1>
</div> </div>
<div className="flex items-center p-0 "> <div className="flex items-center p-0 ">
@ -157,7 +158,7 @@ function Product({ product, grades, pushToCart, isMobile }) {
{ {
product.count > 1 && <p className="ml-2 text-xs text-red52">{product?.count} عدد</p> product.count > 1 && <p className="ml-2 text-xs text-red52">{product?.count} عدد</p>
} }
<p>{product?.product?.price} تومان</p> <p>{separate(product?.product?.price)} تومان</p>
</div> </div>
<div <div
@ -168,7 +169,7 @@ function Product({ product, grades, pushToCart, isMobile }) {
{ {
productId: product?.productId, productId: product?.productId,
userId: product?.userId, userId: product?.userId,
count: -product?.count, count: product?.count == 1 ? -product?.count : -1,
}, },
{}, {},
{ id: product?.factorId } { id: product?.factorId }
@ -205,6 +206,7 @@ function Product({ product, grades, pushToCart, isMobile }) {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
grades: state.publicApi.grades, grades: state.publicApi.grades,
isMobile: state.publicApi.isMobile, isMobile: state.publicApi.isMobile,
productTypes: state.publicApi.productTypes
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -10,6 +10,7 @@ import Button from "../../components/Button";
import alertIcon from "../../assets/img/alert.svg"; import alertIcon from "../../assets/img/alert.svg";
import { connect } from "react-redux"; import { connect } from "react-redux";
import separate from "../../utils/separate";
function ShoppingCart({ function ShoppingCart({
isDark, isDark,
@ -25,206 +26,81 @@ function ShoppingCart({
payFactor, payFactor,
headerOptions, headerOptions,
setHeaderOptions, setHeaderOptions,
schoolList,
desktopContentTransform, desktopContentTransform,
pushToCart,
pushSchoolToCart
}) { }) {
const [phase, setPhase] = useState("products"); const [phase, setPhase] = useState("products");
useEffect(() => { useEffect(() => {
getList(); getList();
getFactorInfo({ userId }); getFactorInfo({userId});
setHeaderOptions(headerOptions); setHeaderOptions(headerOptions);
}, []); }, []);
// const Table = () => {
// return (
// <div className="w-full flex flex-col">
// <header className="w-full flex flex-row gap-10">
// <strong className="w-1/2 pb-2 border-b border-solid border-gray-200 text-gray70 text-sm font-normal">
// کالاهای انتخابی{" "}
// </strong>
// <strong className="w-1/4 pb-2 border-b border-solid border-gray-200 text-gray70 text-sm font-normal">
// تعداد سفارش
// </strong>
// <strong className="w-1/4 pb-2 border-b border-solid border-gray-200 text-gray70 text-sm font-normal">
// مبلغ
// </strong>
// </header>
// <ul className="w-full mt-2 list-none p-0">
// {list.map((product, index) => (
// <Product key={index} product={product} />
// ))}
// </ul>
// </div>
// );
// };
// const PriceStatus = ({ name, value, type }) => {
// return isMobile ? (
// <div className="w-full flex flex-row justify-between py-2">
// <strong className="font-light text-sm dark:text-white">{name}</strong>
// <span
// className="font-bold text-lg dark:text-white"
// style={{
// color: !isDark ? (type === "error" ? "#F1420D" : "#246E8A") : "",
// }}
// >
// {value + " " + "تومان"}
// </span>
// </div>
// ) : (
// <div className="w-full flex flex-row justify-between py-4">
// <strong className="font-light text-tiny dark:text-white text-blue5F">
// {name}
// </strong>
// <span
// className="font-medium text-lg dark:text-white"
// style={{
// color: !isDark ? (type === "error" ? "#F1420D" : "#246E8A") : "",
// }}
// >
// {value}
// <span
// style={{
// color: !isDark ? (type === "error" ? "#F1420D" : "#246E8A") : "",
// }}
// className="text-sm mr-2"
// >
// تومان
// </span>
// </span>
// </div>
// );
// };
// isMobile ? (
// <div className="w-full flex flex-col px-4">
// {list.map((product, index) => (
// <Product key={index} product={product} />
// ))}
// <Code />
// <div className="flex flex-col w-full border-t py-2 border-gray-300 border-b mt-6">
// <PriceStatus
// name="مبلغ سبد خرید"
// value={factorInfo?.sumPrice}
// type="normal"
// />
// <PriceStatus
// name="میزان تخفیف"
// value={factorInfo?.offPrice}
// type="error"
// />
// <PriceStatus
// name="مالیات بر ارزش افزوده"
// value={factorInfo?.sumPrice * 0.009}
// type="error"
// />
// </div>
// <div className="flex flex-row justify-between items-center w-full py-3">
// <strong className="font-light text-sm dark:text-white">
// جمع کل سبد خرید
// </strong>
// <p className="font-medium text-greenBA text-lg dark:text-white">
// {factorInfo?.payPrice + " " + "تومان"}
// </p>
// </div>
// <Button
// title="ادامه فرایند خرید"
// backgroundColor="bg-blueC0"
// border={{ color: "#196EC055", width: "1px" }}
// width="100%"
// color="text-white"
// onClick={() => {}}
// />
// </div>
// ) : (
// <div
// className={`w-full flex flex-row relative gap-10 px-5 mt-10 ${
// desktopContentTransform ? "top-24" : ""
// }`}
// >
// <div className="flex flex-col w-3/4">
// {/* {phase === "products" && <Table />}
// {phase === "delivery-form" && <DeliveryForm />} */}
// </div>
// <div
// className="flex flex-col w-1/4 p-10 bg-grayF9 border border-solid border-grayDB rounded-md px-4 py-4"
// style={{ height: "fit-content" }}
// >
// <div className="flex flex-col w-full border-t py-2 border-gray-300 border-b">
// <PriceStatus
// name="مبلغ سبد خرید"
// value={factorInfo?.sumPrice}
// type="normal"
// />
// <PriceStatus
// name="میزان تخفیف"
// value={factorInfo?.offPrice}
// type="error"
// />
// <PriceStatus
// name="مالیات بر ارزش افزوده"
// value={factorInfo?.sumPrice * 0.009}
// type="error"
// />
// </div>
// <div className="flex flex-row justify-between items-center w-full py-4 border-t border-b border-grayDB border-solid">
// <strong className="font-medium text-tiny text-blue5F dark:text-white">
// جمع کل سبد خرید
// </strong>
// <p className="font-medium text-greenBA text-xl dark:text-white">
// {factorInfo?.payPrice}
// <span className="font-medium text-greenBA text-sm mr-2">تومان</span>
// </p>
// </div>
// {phase === "delivery-form" && (
// <div className="flex flex-col mt-10">
// <strong className="text-tiny text-blue52 mb-5 font-medium">
// انتخاب شیوه پرداخت
// </strong>
// <Button
// title="ادامه فرایند خرید"
// backgroundColor="bg-transparent"
// border={{ color: "#77777755", width: "1px" }}
// width="100%"
// color="text-blue52"
// onClick={() =>
// setPhase(phase === "products" ? "delivery-form" : "")
// }
// />
// <br />
// <Button
// title="پرداخت در محل"
// backgroundColor="bg-transparent"
// border={{ color: "#77777755", width: "1px" }}
// width="100%"
// color="text-blue52"
// onClick={() =>
// setPhase(phase === "products" ? "delivery-form" : "")
// }
// />
// <br/>
// <br/>
// </div>
// )}
// <Button
// title="ادامه فرایند خرید"
// backgroundColor="bg-blueC0"
// border={{ color: "#196EC055", width: "1px" }}
// width="100%"
// color="text-white"
// onClick={() => setPhase(phase === "products" ? "delivery-form" : "")}
// />
// </div>
// </div>
return(isMobile ? return(isMobile ?
<div className="w-full flex flex-col justify-between items-center bg-gray-200 rtl left-0 pt-24" style={{height: '100vh'}}> <div className="w-full flex flex-col justify-between items-center bg-gray-200 rtl left-0 pt-24" style={{height: '100vh'}}>
<div className={`w-full flex items-center flex-col ${list?.length > 3 && 'overflow-x-hidden overflow-scroll'}`} style={{height: '35%'}}> <div className={`w-full flex items-center flex-col ${list?.length > 3 && 'overflow-x-hidden overflow-scroll'}`} style={{height: '35%'}}>
{
schoolList.map((school, index) => (
<div className="flex bg-white justify-between items-center border-2 border-gray-300 p-4 rounded-xl m-2 " style={{ width: '90%' }}>
<div className="flex items-center ">
<div className="text-sm h-10 flex items-center p-2 border-l-2 border-gray-300 text-gray-400"> {school?.product?.book?.category} </div>
<h1 className="text-lg font-black px-2 text-black40"> {school?.product?.name}</h1>
</div>
<div className="flex items-center p-0 ">
<div className="text-sm text-black40 flex items-center" style={{ transform: 'translateX(-20px)' }} >
{
school.count > 1 && <p className="ml-2 text-xs text-red52">{school?.count} عدد</p>
}
<p>{separate(school?.product?.price)} تومان</p>
</div>
<div
className="w-8 h-8 text-white text-sm rounded-full cursor-pointer flex justify-center items-center bg-red52"
style={{ transform: 'translateX(-30px)' }}
onClick={() =>
pushToCart(
{
productId: school?.productId,
userId: school?.userId,
count: school?.count == 1 ? -school?.count : -1,
},
{},
{ id: school?.factorId }
)
}
>
{school.count == 1 ?<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 15.044 15.044">
<g id="vuesax_linear_card-remove" data-name="vuesax/linear/card-remove" transform="translate(-252.46 -511.461)">
<g id="card-remove" transform="translate(253.309 512.31)">
<path id="Vector" d="M0,13.347,13.347,0" fill="none" stroke="#fff" strokeLinecap="round" strokeWidth="2" />
<path id="Vector-2" data-name="Vector" d="M13.347,13.347,0,0" fill="none" stroke="#fff" strokeLinecap="round" strokeWidth="2" />
</g>
</g>
</svg>:
<svg width="100" height="100" viewBox="0 0 100 100">
<g stroke = "#fff" strokeWidth = "5" fill="none">
<path d="M 25 50 L 75 50
M 50 5
" />
</g>
</svg>}
</div>
</div>
</div>
))
}
{list.map((product, index) => ( {list.map((product, index) => (
<Product key={index} product={product} /> <Product key={index} product={product} />
))} ))}
@ -248,7 +124,7 @@ function ShoppingCart({
</div> </div>
</div> </div>
<Button <Button
title={`پرداخت هزینه : ${factorInfo?.payPrice} تومان`} title={`پرداخت هزینه : ${factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0} تومان`}
borderType='rounded-xl' borderType='rounded-xl'
className='h-16 w-full mx-none text-xl' className='h-16 w-full mx-none text-xl'
/> />
@ -259,8 +135,71 @@ function ShoppingCart({
: :
<div className="flex flex-col justify-between items-center bg-gray-100 left-0 pt-24" style={{height: '100vh'}}> <div className="flex flex-col justify-between items-center bg-gray-100 left-0 pt-24" style={{height: '100vh'}}>
<div className={`w-full flex items-center flex-col ${list?.length > 3 && 'overflow-x-hidden overflow-scroll'}`} style={{height: '60%'}}> <div className={`w-full flex items-center flex-col ${list?.length > 1 && 'overflow-x-hidden overflow-scroll'}`} style={{height: '60%'}}>
{
schoolList.map((school, index) => (
<div className="flex bg-white justify-between items-center border-2 border-gray-300 p-4 rounded-xl m-2 " key={`SCHOOL_${index}`} style={{ width: '90%' }}>
<div className="flex flex-col items-center w-full">
<div className="flex items-center w-full">
<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'}}>
پرداخت مستقیم به حساب مدرسه با مبلغ {separate(school.price)} تومان
</button>
<p className="w-full text-right text-xs mt-2">
<span className="text-red-600 font-bold"> توجه: </span>
نحوه پرداخت برای رزرو پیش ثبتنام از طریق دکمه بالا خواهد بود
و می بایست ازین طریق جداگانه پرداخت گردد
</p>
</div>
<div className="flex items-center p-0 ">
<div
className="w-8 h-8 text-white text-sm rounded-full cursor-pointer flex justify-center items-center bg-red52"
style={{ transform: 'translateX(-30px)' }}
onClick={() =>
pushSchoolToCart(
{
productId: school?.productId,
userId: school?.userId,
count: school?.count == 1 ? -school?.count : -1,
},
{},
{ id: school?.factorId }
)
}
>
{school.count == 1 ?<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 15.044 15.044">
<g id="vuesax_linear_card-remove" data-name="vuesax/linear/card-remove" transform="translate(-252.46 -511.461)">
<g id="card-remove" transform="translate(253.309 512.31)">
<path id="Vector" d="M0,13.347,13.347,0" fill="none" stroke="#fff" strokeLinecap="round" strokeWidth="2" />
<path id="Vector-2" data-name="Vector" d="M13.347,13.347,0,0" fill="none" stroke="#fff" strokeLinecap="round" strokeWidth="2" />
</g>
</g>
</svg>:
<svg width="100" height="100" viewBox="0 0 100 100">
<g stroke = "#fff" strokeWidth = "5" fill="none">
<path d="M 25 50 L 75 50
M 50 5
" />
</g>
</svg>}
</div>
</div>
</div>
))
}
{
schoolList.length > 0 && <div className="bg-gray-300 my-2 pb-1 rounded-full w-11/12"></div>
}
{list.map((product, index) => ( {list.map((product, index) => (
<Product key={index} product={product} /> <Product key={index} product={product} />
))} ))}
@ -284,9 +223,9 @@ function ShoppingCart({
</div> </div>
</div> </div>
<Button <Button
title={`پرداخت هزینه : ${factorInfo?.payPrice} تومان`} title={`پرداخت هزینه : ${factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0} تومان`}
borderType='rounded-xl' borderType='rounded-xl'
className='h-16 text-xl' className='h-16 text-xl xl:text-sm'
/> />
</div> </div>
@ -298,6 +237,7 @@ const mapStateToProps = (state) => ({
isDark: state.publicApi.isDark, isDark: state.publicApi.isDark,
isMobile: state.publicApi.isMobile, isMobile: state.publicApi.isMobile,
list: state.userProduct.list, list: state.userProduct.list,
schoolList: state.userProduct.schoolList,
payPrice: state.userProduct.sum, payPrice: state.userProduct.sum,
factorInfo: state.userFactor.info, factorInfo: state.userFactor.info,
userId: state.user.status.id, userId: state.user.status.id,
@ -311,6 +251,8 @@ const mapDispatchToProps = {
getFactorInfo: userFactor.info, getFactorInfo: userFactor.info,
payFactor: userFactor.payment, payFactor: userFactor.payment,
setHeaderOptions: publicApi.setHeaderOptions, setHeaderOptions: publicApi.setHeaderOptions,
pushToCart: userProduct.add,
pushSchoolToCart: userProduct.addSchool,
}; };
export default connect(mapStateToProps, mapDispatchToProps)(ShoppingCart); export default connect(mapStateToProps, mapDispatchToProps)(ShoppingCart);

@ -62,7 +62,7 @@ function Stepper({
// borderRight: direction === "vertical" ? `3px solid ${ // borderRight: direction === "vertical" ? `3px solid ${
// currentStep === Number(index) ? activeColor : deactiveColor // currentStep === Number(index) ? activeColor : deactiveColor
// }` : '', // }` : '',
transform : `${direction === "horizontal" ? 'translateY(1px)' : 'translateX(64px)'}` transform : `${direction === "horizontal" ? 'translateY(1px)' : 'translateX(70px)'}`
}} }}
></span> ></span>

@ -10,10 +10,10 @@ import moment from "jalali-moment";
import { state } from "./state"; import { state } from "./state";
import ScrollContainer from "react-indiana-drag-scroll"; import ScrollContainer from "react-indiana-drag-scroll";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { publicApi } from "../../../redux/actions"; import { product, publicApi } from "../../../redux/actions";
const MyExamList = ({isMobile}) => { const MyExamList = ({isMobile, listExams}) => {
//create suitable data list with main data---------------------------------------------------- //create suitable data list with main data----------------------------------------------------
let d = new Date(); let d = new Date();
@ -126,6 +126,7 @@ const MyExamList = ({isMobile}) => {
useEffect(() => { useEffect(() => {
// console.log("render---------------"); // console.log("render---------------");
listExams();
if(!isMobile){ if(!isMobile){
document.querySelector(".melc-content-item").style.right = `0px`; document.querySelector(".melc-content-item").style.right = `0px`;
} }
@ -397,7 +398,7 @@ const MyExamList = ({isMobile}) => {
<ScrollContainer className=" flex w-full overflow-scroll overflow-y-hidden p-4 pr-0"> <ScrollContainer className=" flex w-full overflow-scroll overflow-y-hidden p-4 pr-0">
{data.map((item, i) => ( {data.map((item, i) => (
<div <div
style={item.isActive ? { color: "white", background: '#df1452', minWidth: '125px' } : {minWidth: '125px', color: '#df1452'}} style={item.isActive ? { color: "white", background: '#df1452', minWidth: '125px', fontSize:'70%' } : {minWidth: '125px', color: '#df1452',fontSize:'70%'}}
key={item.id || i} key={item.id || i}
className="w-72 flex items-center h-12 bg-gray-100 mx-2 rounded-lg justify-center font-bold text-sm" className="w-72 flex items-center h-12 bg-gray-100 mx-2 rounded-lg justify-center font-bold text-sm"
onClick={() => change_tab(item.id)} onClick={() => change_tab(item.id)}
@ -493,7 +494,7 @@ const mapStateToProps = (state) => ({
}); });
const mapDispatchToProps = { const mapDispatchToProps = {
listExams: product.listExams,
setHeaderOptions: publicApi.setHeaderOptions, setHeaderOptions: publicApi.setHeaderOptions,
}; };

@ -4,7 +4,8 @@ import { useState, useEffect } from "react";
const FileInput = ({ const FileInput = ({
title, title,
id id,
mobile
}) => { }) => {
const [focus, setFocus] = useState('border-gray-300 border-dotted'); const [focus, setFocus] = useState('border-gray-300 border-dotted');
@ -34,8 +35,13 @@ const FileInput = ({
setSelectedImage(files[0]); setSelectedImage(files[0]);
} }
}; };
useEffect(() => {
if(mobile){
setDelete(true)
}
}, [mobile])
return ( return (
<div onDrop={overrideEventDefaults} <div className={mobile ? "w-full" : `max-w-48 min-w-40 w-52`} onDrop={overrideEventDefaults}
onDragEnter={overrideEventDefaults} onDragEnter={overrideEventDefaults}
onDragLeave={overrideEventDefaults} onDragLeave={overrideEventDefaults}
onDragOver={overrideEventDefaults}> onDragOver={overrideEventDefaults}>
@ -47,7 +53,8 @@ const FileInput = ({
onDragLeave={overrideEventDefaults} onDragLeave={overrideEventDefaults}
onDragOver={overrideEventDefaults} onDragOver={overrideEventDefaults}
for={"file" + id} className={`flex flex-col text-center justify-center items-center border-2 ${focus} rounded-lg p-4 cursor-pointer`} style={{ maxHeight: '200px' }}> for={"file" + id}
className={`flex flex-col w-full max-w-52 text-center justify-center items-center py-6 border-2 ${focus} rounded-lg p-4 cursor-pointer`} style={{ maxHeight: '200px' }}>
{imageUrl == null ? {imageUrl == null ?
<> <>
<div> <div>
@ -56,15 +63,15 @@ const FileInput = ({
<path d="M13.7601 18.32C11.4101 18.49 11.4101 21.89 13.7601 22.06H19.3201C19.9901 22.06 20.6501 21.81 21.1401 21.36C22.7901 19.92 21.91 17.04 19.74 16.77C18.96 12.08 12.1801 13.86 13.7801 18.33" stroke="rgba(110,132,159,0.3)" strokeWidth="1.5" strokeMiterlimit="10" strokeLinecap="round" strokeLinejoin="round" /> <path d="M13.7601 18.32C11.4101 18.49 11.4101 21.89 13.7601 22.06H19.3201C19.9901 22.06 20.6501 21.81 21.1401 21.36C22.7901 19.92 21.91 17.04 19.74 16.77C18.96 12.08 12.1801 13.86 13.7801 18.33" stroke="rgba(110,132,159,0.3)" strokeWidth="1.5" strokeMiterlimit="10" strokeLinecap="round" strokeLinejoin="round" />
</svg> </svg>
</div> </div>
<h1 className="text-xl font-bold text-gray-400">{title}</h1> <h1 className=" text-ellipsis w-full font-bold text-gray-400" style={{fontSize: '80%'}}>{title}</h1>
<p className="text-sm leading-7 text-gray-400">فایل خود را بکشید و اینجا رها کنید</p> <p className="text-sm leading-7 text-gray-400" style={{fontSize: '70%'}}>فایل خود را بکشید و اینجا رها کنید</p>
<p className="bg-gray-200 p-2 rounded text-sm mt-1 text-gray-500">انتخاب فایل</p> <p className="bg-gray-200 p-2 rounded text-sm mt-1 text-gray-500">انتخاب فایل</p>
</> </>
: :
<> <>
<div className="h-40" onMouseEnter={() => setDelete(true)} onMouseLeave={() => setDelete(false)}> <div className="h-40 flex flex-col justify-center items-center w-full" onMouseEnter={() => setDelete(true)} onMouseLeave={() => setDelete(false)}>
<img src={imageUrl} className="rounded-lg h-full" /> <img src={imageUrl} className="rounded-lg max-w-full max-h-32" />
{del && <div className=" top-0 -mt-20 relative bg-red-500 w-full h-12 flex items-center justify-center text-white rounded-lg" onClick={() => setSelectedImage(null)}> {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> <button>حذف</button>
</div>} </div>}
</div> </div>

@ -1,4 +1,4 @@
import React from 'react'; import React, { useEffect } from 'react';
import { useLocation, useNavigate } from 'react-router-dom'; import { useLocation, useNavigate } from 'react-router-dom';
import './Header.scss'; import './Header.scss';
import searchIcon from "../../assets/img/Group 1148.svg"; import searchIcon from "../../assets/img/Group 1148.svg";
@ -13,26 +13,33 @@ import arrowIcon from './MobileSideMenu/arrow-down.svg'
import exitIcon from '../../assets/img/group-9.svg' import exitIcon from '../../assets/img/group-9.svg'
import backIcon from './arrow-left-1.svg'; import backIcon from './arrow-left-1.svg';
import profileIcon from './MobileSideMenu/profile-active.svg' import profileIcon from './MobileSideMenu/profile-active.svg'
import { user } from '../../redux/actions';
import { grades } from '../../redux/reducers/public';
const Header = ({ const Header = ({
isMobile, cart, isMobile, cart,
logOut logOut,
setUserStatus,
user
}) => { }) => {
let today = moment().locale("fa").format("YYYY/M/D"); let today = moment().locale("fa").format("YYYY/M/D");
console.log("today:"); console.log("today:");
console.log(today); console.log(today);
let weekday = new Date().getDay(); let weekday = new Date().getDay();
let weekdayList = ["یکشنبه", "دوشنبه", "سهشنبه", "چهارشنبه", 'پنجشنبه', 'جمعه', "شنبه"]; let weekdayList = ["یکشنبه", "دوشنبه", "سهشنبه", "چهارشنبه", 'پنجشنبه', 'جمعه', "شنبه"];
console.log("weekday:"); // console.log("weekday:");
console.log(weekday); // console.log(weekday);
const [menuPopup, setMenuPopup] = useState(false); const [menuPopup, setMenuPopup] = useState(false);
const [subMenu, setSubMenu] = useState(false); const [subMenu, setSubMenu] = useState(false);
const location = useLocation(); const location = useLocation();
const navigate = useNavigate(); const navigate = useNavigate();
useEffect(() => {
setUserStatus()
}, [])
return ( return (
<> <>
<div className={`header w-full h-[8.5%] z-10 bg-white fixed top-0 left-0 flex items-center ${!isMobile && 'shadow-md'}`}> <div className={`header w-full h-[6.5%] bg-white fixed top-0 left-0 flex items-center ${!isMobile ? 'shadow-md z-10' : 'z-40'}`}>
{ {
subMenu && <div className={`w-1/6 p-4 flex flex-col text-right bg-white shadow-xl absolute top-[108.5%] rounded-lg left-5 transition duration-700 ease-in-out ${subMenu && 'subMenu'}`} subMenu && <div className={`w-1/6 p-4 flex flex-col text-right bg-white shadow-xl absolute top-[108.5%] rounded-lg left-5 transition duration-700 ease-in-out ${subMenu && 'subMenu'}`}
@ -50,7 +57,7 @@ const Header = ({
<Link to='/register' onClick={() => setSubMenu(false)} className='w-full text-right border-b border-gray-200 py-2'> <Link to='/register' onClick={() => setSubMenu(false)} className='w-full text-right border-b border-gray-200 py-2'>
افزودن حساب کاربری جدید ویرایش حساب کاربری
</Link> </Link>
</div> </div>
} }
@ -97,10 +104,10 @@ const Header = ({
</div> </div>
<div className="header-profile-text-container w-fit text-right ml-4"> <div className="header-profile-text-container w-fit text-right ml-4">
<div className="header-profile-text-container-name text-sm"> <div className="header-profile-text-container-name text-sm">
کوروش زراندوز {user.displayName ? user.displayName : user?.firstName + ' ' + user?.lastName}
</div> </div>
<div className="header-profile-text-container-role text-xs"> <div className="header-profile-text-container-role text-xs">
پایه ششم {grades[user.gradeIds]}
</div> </div>
</div> </div>
@ -121,7 +128,7 @@ const Header = ({
{today} {today}
</span> </span>
<span className="header-date-and-date-text3 text-color4 text-xs"> <span className="header-date-and-date-text3 text-color4 text-xs">
روز ملی صنعت نفت {/* روز ملی صنعت نفت */}
</span> </span>
</div> </div>
</div> </div>
@ -146,10 +153,10 @@ const Header = ({
<> <>
<div className='h-screen top-0 w-full z-30 backdrop-blur bg-black bg-opacity-20 fixed'></div> <div className='h-screen top-0 w-full z-30 backdrop-blur bg-black bg-opacity-20 fixed'></div>
<div className='w-full flex'> <div className='w-full flex'>
<MobileSideMenu logOut={logOut} profilePic={avatar1} users={[ <MobileSideMenu profilePic={avatar1} users={[
{ {
name: 'کوروش زراندوز', name: user?.displayName,
title: 'پایه ششم' title: grades[user.gradeIds]
}, },
{ {
name: 'کوروش زراندوز', name: 'کوروش زراندوز',
@ -175,9 +182,11 @@ const Header = ({
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
isMobile: state.publicApi.isMobile, isMobile: state.publicApi.isMobile,
cart: state.userProduct.list cart: state.userProduct.list,
user: state.user.status,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {
setUserStatus: user.setUserStatus
}; };
export default connect(mapStateToProps, mapDispatchToProps)(Header); export default connect(mapStateToProps, mapDispatchToProps)(Header);

@ -20,6 +20,8 @@ import bookIconActive from './book-1-active.svg';
import smsIconActive from './sms-active.svg'; import smsIconActive from './sms-active.svg';
import mapIconActive from './map-active.svg'; import mapIconActive from './map-active.svg';
import radarIconActive from './radar-1-active.svg'; import radarIconActive from './radar-1-active.svg';
import { connect } from "react-redux";
import { user } from "../../../redux/actions";
const MobileSideMenu = ({ const MobileSideMenu = ({
profilePic, profilePic,
@ -89,7 +91,7 @@ const MobileSideMenu = ({
}, },
] ]
return ( return (
<div className="flex flex-col w-4/5 h-screen top-0 rtl right-0 fixed bg-white z-40"> <div className="flex flex-col w-4/5 h-screen top-0 rtl right-0 fixed bg-white z-50">
<div className="w-full mt-6 px-2 h-2/12 flex items-start justify-between"> <div className="w-full mt-6 px-2 h-2/12 flex items-start justify-between">
<img src={profilePic} className="rounded-full border border-green-600 w-1/5" /> <img src={profilePic} className="rounded-full border border-green-600 w-1/5" />
<div className="w-full flex flex-col pb-3 text-right mx-3"> <div className="w-full flex flex-col pb-3 text-right mx-3">
@ -129,4 +131,13 @@ const MobileSideMenu = ({
</div> </div>
) )
} }
export default MobileSideMenu;
const mapStateToProps = (state) => ({
});
const mapDispatchToProps = {
logOut: user.logout,
};
export default connect(mapStateToProps, mapDispatchToProps)(MobileSideMenu);

@ -1,4 +1,5 @@
import React from "react"; import React, { useEffect } from "react";
import _onInput from "../../utils/onInput";
const Input = ({ const Input = ({
@ -16,6 +17,13 @@ const Input = ({
max, max,
onFocus onFocus
}) => { }) => {
useEffect(() => {
if(value !== null && value !== '' && value !== undefined){
blurHandler(id ? id : 0)
}
}, [value])
const focusHandler = (id) => { const focusHandler = (id) => {
let inputs = document.querySelectorAll(".Login-box-form-item"); let inputs = document.querySelectorAll(".Login-box-form-item");
@ -36,12 +44,14 @@ const Input = ({
let inputs = document.querySelectorAll(".Login-box-form-item-input"); let inputs = document.querySelectorAll(".Login-box-form-item-input");
let label = document.querySelectorAll(".Login-box-form-item-label"); let label = document.querySelectorAll(".Login-box-form-item-label");
let line = document.querySelectorAll(".Login-box-form-item-line"); let line = document.querySelectorAll(".Login-box-form-item-line");
if (inputs[id].value === "") { if (inputs[id]) {
inputsBox[id].style.borderColor = "#EBEBEB"; inputsBox[id].style.borderColor = "#EBEBEB";
label[id].style.transform = "translate(0px,0px)"; label[id].style.transform = "translate(-10px,-27px)";
label[id].style.color = "#959595"; label[id].style.color = "#959595";
line[id].style.backgroundColor = "#EBEBEB"; inputs[id].style.backgroundColor = "#fff";
line[id].style.backgroundColor = "#fff";
} }
}; };
return ( 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`}> <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`}>
@ -51,12 +61,14 @@ const Input = ({
</div> </div>
<input <input
type={type ? type : 'text'} type={type ? type : 'text'}
name="Login-box-form-item-input-name" name="Login-box-form-item-input-name"
id={`Login-box-form-item-input-name${id}`} 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 focus:text-red52`}
style={{ direction: direction ? direction : "ltr", backgroundColor: bg }} style={{ direction: direction ? direction : "ltr", backgroundColor: bg }}
onFocus={() => {if(onFocus){onFocus();} focusHandler(id ? id : 0)}} onFocus={() => {if(onFocus){onFocus();} focusHandler(id ? id : 0)}}
onBlur={() => blurHandler(id ? id : 0)} onBlur={() => blurHandler(id ? id : 0)}
onChange={onChange} onChange={onChange}
value={value} value={value}

@ -111,7 +111,7 @@ const blurHandler = (id) => {
className={_.join( className={_.join(
[ [
`flex-1 border border-gray-300 dark:bg-opacity-10 bg-transparent rounded-md outline-none py-3 px-4 text-tiny ${backgroundColor} ${align}`, `flex-1 dark:bg-opacity-10 bg-transparent rounded-md outline-none py-3 px-4 text-tiny ${backgroundColor} ${align}`,
inputStatusHandler( inputStatusHandler(
value, value,
focusToggle, focusToggle,

@ -8,18 +8,20 @@ import logo from "../../assets/img/logo.png";
import img1 from "../../assets/img/Group 1440.svg"; import img1 from "../../assets/img/Group 1440.svg";
import { Link, useLocation } from "react-router-dom"; import { Link, useLocation } from "react-router-dom";
import MinimalNav from "./minimalNav"; import MinimalNav from "./minimalNav";
import { user } from "../../redux/actions";
// defineLordIconElement(loadAnimation); // defineLordIconElement(loadAnimation);
// let oldNavItemId = 1; // let oldNavItemId = 1;
let location = window.location.pathname;
const Nav = ({ const Nav = ({
logOut, logOut,
isMobile, isMobile,
isLogin, isLogin,
logout
}) => { }) => {
let locationL = useLocation();
let location = locationL.pathname;
const [type, setType] = useState('default'); const [type, setType] = useState('default');
const location2 = useLocation(); const location2 = useLocation();
useEffect(() => { useEffect(() => {
@ -189,6 +191,7 @@ useEffect(() => {
className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer" className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer"
onClick={() => chaneNav(1)} onClick={() => chaneNav(1)}
> >
<div className="w-full flex items-center justify-center" style={{width: '7vw'}}>
<svg <svg
id="vuesax_bold_element-4" id="vuesax_bold_element-4"
data-name="vuesax/bold/element-4" data-name="vuesax/bold/element-4"
@ -240,9 +243,10 @@ useEffect(() => {
/> />
</g> </g>
</svg> </svg>
</div>
<div <div
className="nav-menu-container-item-title text-sm" className="nav-menu-container-item-title px-2"
style={1 === navId ? { color: "#fff" } : { color: "#A5A8AB" }} style={1 === navId ? { color: "#fff", fontSize: '0.7vw' } : { color: "#A5A8AB", fontSize: '0.7vw' }}
> >
منوی اصلی منوی اصلی
</div> </div>
@ -253,6 +257,7 @@ useEffect(() => {
className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer" className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer"
onClick={() => chaneNav(2)} onClick={() => chaneNav(2)}
> >
<div className="flex items-center justify-center" style={{width: '7vw'}}>
<svg <svg
id="empty-wallet" id="empty-wallet"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
@ -314,9 +319,10 @@ useEffect(() => {
opacity="0" opacity="0"
/> />
</svg> </svg>
</div>
<div <div
className="nav-menu-container-item-title text-sm" className="nav-menu-container-item-title px-2 "
style={2 === navId ? { color: "#fff" } : { color: "#A5A8AB" }} style={2 === navId ? { color: "#fff", fontSize: '0.7vw' } : { color: "#A5A8AB", fontSize: '0.7vw' }}
> >
انتخاب خدمات انتخاب خدمات
</div> </div>
@ -330,17 +336,19 @@ useEffect(() => {
className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer" className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer"
onClick={() => chaneNav(3)} onClick={() => chaneNav(3)}
> >
<svg id="vuesax_linear_setting-2" data-name="vuesax/linear/setting-2" xmlns="http://www.w3.org/2000/svg" width="46.091" height="46.091" viewBox="0 0 46.091 46.091"> <div className="w-20 flex items-center justify-center" style={{width: '7vw'}}>
<svg id="vuesax_linear_setting-2" data-name="vuesax/linear/setting-2" xmlns="http://www.w3.org/2000/svg" width="37.091" height="37.091" viewBox="0 0 46.091 46.091">
<g id="setting-2"> <g id="setting-2">
<path id="Vector" d="M11.523,5.761A5.761,5.761,0,1,1,5.761,0,5.761,5.761,0,0,1,11.523,5.761Z" transform="translate(17.284 17.284)" fill="none" stroke={navId === 3 ? "#fff" : "#a5a8ab"} strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" /> <path id="Vector" d="M11.523,5.761A5.761,5.761,0,1,1,5.761,0,5.761,5.761,0,0,1,11.523,5.761Z" transform="translate(17.284 17.284)" fill="none" stroke={navId === 3 ? "#fff" : "#a5a8ab"} strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" />
<path id="Vector-2" data-name="Vector" d="M0,19.817v-3.38a3.66,3.66,0,0,1,3.649-3.649c3.476,0,4.9-2.458,3.15-5.473A3.647,3.647,0,0,1,8.143,2.341L11.465.44a3.205,3.205,0,0,1,4.379,1.152l.211.365c1.728,3.015,4.571,3.015,6.318,0l.211-.365A3.205,3.205,0,0,1,26.963.44l3.322,1.9A3.647,3.647,0,0,1,31.63,7.315c-1.748,3.015-.326,5.473,3.15,5.473a3.66,3.66,0,0,1,3.649,3.649v3.38a3.66,3.66,0,0,1-3.649,3.649c-3.476,0-4.9,2.458-3.15,5.473a3.643,3.643,0,0,1-1.344,4.974l-3.322,1.9a3.205,3.205,0,0,1-4.379-1.152l-.211-.365c-1.728-3.015-4.571-3.015-6.318,0l-.211.365a3.205,3.205,0,0,1-4.379,1.152l-3.322-1.9A3.647,3.647,0,0,1,6.8,28.939c1.748-3.015.326-5.473-3.15-5.473A3.66,3.66,0,0,1,0,19.817Z" transform="translate(3.841 4.919)" fill="none" stroke={navId === 3 ? "#fff" : "#a5a8ab"} strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" /> <path id="Vector-2" data-name="Vector" d="M0,19.817v-3.38a3.66,3.66,0,0,1,3.649-3.649c3.476,0,4.9-2.458,3.15-5.473A3.647,3.647,0,0,1,8.143,2.341L11.465.44a3.205,3.205,0,0,1,4.379,1.152l.211.365c1.728,3.015,4.571,3.015,6.318,0l.211-.365A3.205,3.205,0,0,1,26.963.44l3.322,1.9A3.647,3.647,0,0,1,31.63,7.315c-1.748,3.015-.326,5.473,3.15,5.473a3.66,3.66,0,0,1,3.649,3.649v3.38a3.66,3.66,0,0,1-3.649,3.649c-3.476,0-4.9,2.458-3.15,5.473a3.643,3.643,0,0,1-1.344,4.974l-3.322,1.9a3.205,3.205,0,0,1-4.379-1.152l-.211-.365c-1.728-3.015-4.571-3.015-6.318,0l-.211.365a3.205,3.205,0,0,1-4.379,1.152l-3.322-1.9A3.647,3.647,0,0,1,6.8,28.939c1.748-3.015.326-5.473-3.15-5.473A3.66,3.66,0,0,1,0,19.817Z" transform="translate(3.841 4.919)" fill="none" stroke={navId === 3 ? "#fff" : "#a5a8ab"} strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" />
<path id="Vector-3" data-name="Vector" d="M0,0H46.091V46.091H0Z" fill="none" opacity="0" /> <path id="Vector-3" data-name="Vector" d="M0,0H46.091V46.091H0Z" fill="none" opacity="0" />
</g> </g>
</svg> </svg>
</div>
<div <div
className="nav-menu-container-item-title text-sm" className="nav-menu-container-item-title text-sm"
style={3 === navId ? { color: "#fff" } : { color: "#A5A8AB" }} style={3 === navId ? { color: "#fff", fontSize: '0.7vw' } : { color: "#A5A8AB", fontSize: '0.7vw' }}
> >
خدمات من خدمات من
</div> </div>
@ -355,7 +363,8 @@ useEffect(() => {
className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer" className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer"
onClick={() => chaneNav(4)} onClick={() => chaneNav(4)}
> >
<svg <div className="flex items-center justify-center" style={{width: '7vw'}}>
<svg
id="vuesax_linear_sms" id="vuesax_linear_sms"
data-name="vuesax/linear/sms" data-name="vuesax/linear/sms"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
@ -395,9 +404,11 @@ useEffect(() => {
/> />
</g> </g>
</svg> </svg>
</div>
<div <div
className="nav-menu-container-item-title text-sm" className="nav-menu-container-item-title text-sm"
style={4 === navId ? { color: "#fff" } : { color: "#A5A8AB" }} style={4 === navId ? { color: "#fff", fontSize: '0.7vw' } : { color: "#A5A8AB", fontSize: '0.7vw' }}
> >
چت با اساتید چت با اساتید
</div> </div>
@ -409,7 +420,7 @@ useEffect(() => {
className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer" className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer"
onClick={() => chaneNav(5)} onClick={() => chaneNav(5)}
> >
<svg id="vuesax_linear_calculator" data-name="vuesax/linear/calculator" xmlns="http://www.w3.org/2000/svg" width="46.091" height="46.091" viewBox="0 0 46.091 46.091"> <svg id="vuesax_linear_calculator" data-name="vuesax/linear/calculator" xmlns="http://www.w3.org/2000/svg" width="36.091" height="36.091" viewBox="0 0 46.091 46.091">
<g id="calculator" transform="translate(0)"> <g id="calculator" transform="translate(0)">
<path id="Vector" d="M13.443,38.409h7.682c9.6,0,13.443-3.841,13.443-13.443V13.443C34.568,3.841,30.727,0,21.125,0H13.443C3.841,0,0,3.841,0,13.443V24.966C0,34.568,3.841,38.409,13.443,38.409Z" transform="translate(5.761 3.841)" fill="none" stroke={navId === 5 ? "#fff" : "#a5a8ab"} strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" /> <path id="Vector" d="M13.443,38.409h7.682c9.6,0,13.443-3.841,13.443-13.443V13.443C34.568,3.841,30.727,0,21.125,0H13.443C3.841,0,0,3.841,0,13.443V24.966C0,34.568,3.841,38.409,13.443,38.409Z" transform="translate(5.761 3.841)" fill="none" stroke={navId === 5 ? "#fff" : "#a5a8ab"} strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" />
<path id="Vector-2" data-name="Vector" d="M17.284,2.881V4.8A2.889,2.889,0,0,1,14.4,7.682H2.881A2.889,2.889,0,0,1,0,4.8V2.881A2.889,2.889,0,0,1,2.881,0H14.4A2.877,2.877,0,0,1,17.284,2.881Z" transform="translate(14.403 11.676)" fill="none" stroke={navId === 5 ? "#fff" : "#a5a8ab"} strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" /> <path id="Vector-2" data-name="Vector" d="M17.284,2.881V4.8A2.889,2.889,0,0,1,14.4,7.682H2.881A2.889,2.889,0,0,1,0,4.8V2.881A2.889,2.889,0,0,1,2.881,0H14.4A2.877,2.877,0,0,1,17.284,2.881Z" transform="translate(14.403 11.676)" fill="none" stroke={navId === 5 ? "#fff" : "#a5a8ab"} strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" />
@ -425,7 +436,7 @@ useEffect(() => {
<div <div
className="nav-menu-container-item-title text-sm" className="nav-menu-container-item-title text-sm"
style={5 === navId ? { color: "#fff" } : { color: "#A5A8AB" }} style={5 === navId ? { color: "#fff" , fontSize: '0.7vw' } : { color: "#A5A8AB", fontSize: '0.7vw' }}
> >
پشتیبانی پشتیبانی
</div> </div>
@ -436,7 +447,7 @@ useEffect(() => {
<Link <Link
to="/" to="/"
className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer" className="nav-menu-container-item w-full h-1/6 flex flex-col items-center justify-center hover:bg-color2_5 cursor-pointer"
onClick={logOut} onClick={() => logout()}
> >
<svg <svg
id="vuesax_linear_logout" id="vuesax_linear_logout"
@ -492,7 +503,7 @@ useEffect(() => {
</svg> </svg>
<div <div
className="nav-menu-container-item-title text-sm translate-y-[-10%]" className="nav-menu-container-item-title text-sm translate-y-[-10%]"
style={6 === navId ? { color: "#fff" } : { color: "#A5A8AB" }} style={6 === navId ? { color: "#fff", fontSize: '0.7vw' } : { color: "#A5A8AB", fontSize: '0.7vw' }}
> >
خروج خروج
</div> </div>
@ -521,6 +532,7 @@ const mapStateToProps = (state) => ({
}); });
const mapDispatchToProps = { const mapDispatchToProps = {
logout: user.logout,
}; };
export default connect(mapStateToProps, mapDispatchToProps)(Nav); export default connect(mapStateToProps, mapDispatchToProps)(Nav);

@ -1,7 +1,7 @@
export const ApiConfig = { export const ApiConfig = {
// apiKey: 'AIzaSyBBksq-Asxq2M4Ot-75X19IyrEYJqNBPcg', // apiKey: 'AIzaSyBBksq-Asxq2M4Ot-75X19IyrEYJqNBPcg',
// authDomain: 'dnvn.ir', // authDomain: 'dnvn.ir',
// baseUrl: 'https://dnvn.ir/api/v1', baseUrl: 'https://new.andishmand.ir/api/v1',
//baseUrl: 'http://localhost:3030/api/v1', //baseUrl: 'http://localhost:3030/api/v1',
loginURL: 'user/login', loginURL: 'user/login',
otploginURL: 'user/otp/login', otploginURL: 'user/otp/login',

@ -3,11 +3,11 @@ const book = {
list: list:
(data = {}) => (data = {}) =>
async (dispatch) => async (dispatch) =>
await proxy.get("book/list", data, { dispatch }), await proxy.get("product/list", data, { dispatch }),
info: info:
(data = {}) => (data = {}) =>
async (dispatch) => async (dispatch) =>
await proxy.get("book/info", data, { dispatch }), await proxy.get("product/info", data, { dispatch }),
setLessonActive: (data) => async (dispatch) => setLessonActive: (data) => async (dispatch) =>
await dispatch({ type: "book/lesson/active", data: data }), await dispatch({ type: "book/lesson/active", data: data }),
gradeFilter: (data) => async (dispatch) => gradeFilter: (data) => async (dispatch) =>

@ -25,6 +25,8 @@ const product = {
async (dispatch) => { async (dispatch) => {
await dispatch({ type: "product/selectVOD", data }); await dispatch({ type: "product/selectVOD", data });
}, },
listExams: (data = {}) => async (dispatch) =>
await proxy.get('exam/list', data, {dispatch})
}; };
export default product; export default product;

@ -58,6 +58,13 @@ const user = {
await proxy.delete("user/delete", data); await proxy.delete("user/delete", data);
await proxy.get("user/list", data2, { dispatch }); await proxy.get("user/list", data2, { dispatch });
}, },
bnLogin: (data) => async (dispatch) =>
await proxy.login("user/login", data, { dispatch }),
setUserStatus: () => async (dispatch) => {
let userDataString = localStorage.getItem('userData');
let userData = JSON.parse(userDataString);
dispatch({type: 'SET_USER_STATUS', data: userData})
}
}; };
export default user; export default user;

@ -1,9 +1,10 @@
import proxy from "../proxy"; import proxy from "../proxy";
const userProduct = { const userProduct = {
list: list:
(data = {}) => (data = {}, data2 = {}) =>
async (dispatch) => { async (dispatch) => {
await proxy.get("userProduct/list", data, { dispatch }); await proxy.get("userProduct/list", data, { dispatch });
await proxy.get('userProduct/listSchool', data2, {dispatch});
}, },
info: info:
(data = {}) => (data = {}) =>
@ -28,6 +29,12 @@ const userProduct = {
await proxy.delete("userProduct/delete", data); await proxy.delete("userProduct/delete", data);
await proxy.get("userProduct/list", data2, { dispatch }); await proxy.get("userProduct/list", data2, { dispatch });
}, },
addSchool:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.post('userProduct/addSchool', data, {dispatch});
await proxy.get('userProduct/listSchool', data2, {dispatch});
}
}; };
export default userProduct; export default userProduct;

@ -9,7 +9,7 @@ const Axios = axios.create({
withCredentials: true, withCredentials: true,
validateStatus: null, validateStatus: null,
baseURL: baseUrl, baseURL: baseUrl,
//headers: access ? { Authorization: `Bearer ${access}` } : {}, headers: access ? { Authorization: `Bearer ${access}` } : {},
}); });
class Proxy { class Proxy {
get = async (url, params, opt, data) => get = async (url, params, opt, data) =>

@ -136,7 +136,7 @@ const grades = [
export default function book(state = initialState, action) { export default function book(state = initialState, action) {
let { type, data } = action; let { type, data } = action;
switch (type) { switch (type) {
case "book/list": case "product/list":
let itemsSubject = (Array.isArray(data) ? data : []).map( let itemsSubject = (Array.isArray(data) ? data : []).map(
(item, index) => item.name (item, index) => item.name
); );
@ -159,7 +159,7 @@ export default function book(state = initialState, action) {
filterResult: data, filterResult: data,
error: null, error: null,
}; };
case "book/info": case "product/info":
return { ...state, loading: false, info: data, error: null }; return { ...state, loading: false, info: data, error: null };
case "book/lesson/active": case "book/lesson/active":
return { return {

@ -6,6 +6,7 @@ const initialState = {
listVOD: [], listVOD: [],
selectedVOD: null, selectedVOD: null,
similarList : [], similarList : [],
exams: [],
}; };
export default function product(state = initialState, action) { export default function product(state = initialState, action) {
let { type, data } = action; let { type, data } = action;
@ -25,6 +26,12 @@ export default function product(state = initialState, action) {
case "product/error": case "product/error":
toast.error(data.message); toast.error(data.message);
return { ...state, loading: false, error: data.message }; return { ...state, loading: false, error: data.message };
case 'exam/list':
return {
...state,
loading:false,
exams: data
}
default: default:
return state; return state;
} }

@ -96,10 +96,44 @@ const initialState = {
back: false, back: false,
title: false, title: false,
}, },
productTypes: [
{
id: 1,
title: 'کتاب فیزیکی',
},
{
id: 2,
title: 'آزمون حضوری',
},
{
id: 3,
title: 'آزمون آنلاین',
},
{
id: 4,
title: 'کلاس حضوری',
},
{
id: 5,
title: 'کلاس آنلاین',
},
{
id: 6,
title: 'دوره مجازی',
},
{
id: 7,
title: 'پیش ثبت نام',
},
{
id: 8,
title: 'سایر',
},
],
desktopContentTransform: false, desktopContentTransform: false,
}; };
const grades = [ export const grades = [
"پیش دبستان", "پیش دبستان",
"اول", "اول",
"دوم", "دوم",

@ -1,18 +1,19 @@
import proxy from "../proxy"; import proxy from "../proxy";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
const initialState = { const initialState = {
status: { status: {
name:'کوروش', name: 'کوروش',
lastName: 'زراندوز', lastName: 'زراندوز',
roles: [], roles: [],
rolesString: [ rolesString: [
{ {
id:1, id: 1,
roleName: 'پایه ششم', roleName: 'پایه ششم',
}, },
{ {
id:2, id: 2,
roleName: 'مدیر', roleName: 'مدیر',
}, },
] ]
@ -24,10 +25,13 @@ const initialState = {
mothers: [], mothers: [],
profileStatus: false, profileStatus: false,
setDone: false, setDone: false,
setLogin : false, setLogin: false,
}; };
export default function user(state = initialState, action) { export default function user(state = initialState, action) {
let { type, data } = action; let { type, data } = action;
switch (type) { switch (type) {
// case "user/login": // case "user/login":
// case "user/register": // case "user/register":
@ -36,6 +40,9 @@ export default function user(state = initialState, action) {
return { ...state, loading: false, status: data.profile, error: null }; return { ...state, loading: false, status: data.profile, error: null };
case "user/login": case "user/login":
case "user/otp/login": case "user/otp/login":
if (data.profile.username == null) {
window.location.replace('/register')
}
return { return {
...state, ...state,
loading: false, loading: false,
@ -45,18 +52,21 @@ export default function user(state = initialState, action) {
}; };
case "user/getProfile": case "user/getProfile":
localStorage.setItem("userData", JSON.stringify(data)); localStorage.setItem("userData", JSON.stringify(data));
return { ...state, loading: false, status: data, error: null, setDone : false, }; return { ...state, loading: false, status: data, error: null, setDone: false, };
case "user/logout": case "user/logout":
window.location.reload()
return { ...state, loading: false, status: proxy.status(), error: null }; return { ...state, loading: false, status: proxy.status(), error: null };
case "user/getUserRole": case "user/getUserRole":
return { ...state, loading: false, userRoles: data, error: null }; return { ...state, loading: false, userRoles: data, error: null };
case "user/setProfile": case "user/setProfile":
toast.success("تغییرات اعمال شد."); toast.success("تغییرات اعمال شد.");
return { ...state, loading: false, error: null, setDone : true }; return { ...state, loading: false, error: null, setDone: true };
case "loading": case "loading":
return { ...state, loading: true }; return { ...state, loading: true };
case "error": case "error":
return { ...state, loading: false, error: data.message }; return { ...state, loading: false, error: data.message };
case 'SET_USER_STATUS':
return {...state, status: data};
default: default:
return state; return state;
} }

@ -4,6 +4,7 @@ const initialState = {
loading: false, loading: false,
error: null, error: null,
list: [], list: [],
schoolList: [],
info: null, info: null,
sum: null, sum: null,
checkEmpty: false, checkEmpty: false,
@ -28,6 +29,11 @@ export default function userFactor(state = initialState, action) {
error: null, error: null,
hasPhysical: hasPhysical, hasPhysical: hasPhysical,
}; };
case 'userProduct/listSchool':
return {
...state,
schoolList: data
}
case "userProduct/info": case "userProduct/info":
return { ...state, loading: false, info: data, error: null }; return { ...state, loading: false, info: data, error: null };
case "userProduct/update": case "userProduct/update":
@ -44,6 +50,7 @@ export default function userFactor(state = initialState, action) {
case "userProduct/error": case "userProduct/error":
toast.error(data.message); toast.error(data.message);
return { ...state, loading: false, error: data.message }; return { ...state, loading: false, error: data.message };
default: default:
return state; return state;
} }

@ -275,6 +275,21 @@ class onInput {
.replace(/[^\d]/, ""); .replace(/[^\d]/, "");
return formattedValue; return formattedValue;
}; };
noNumber = (value) => {
let newText = value;
newText = newText.replace(/`/g, "");
newText = newText.replace(/0/g, "");
newText = newText.replace(/1/g, "");
newText = newText.replace(/2/g, "");
newText = newText.replace(/3/g, "");
newText = newText.replace(/4/g, "");
newText = newText.replace(/5/g, "");
newText = newText.replace(/6/g, "");
newText = newText.replace(/7/g, "");
newText = newText.replace(/8/g, "");
newText = newText.replace(/9/g, "");
return newText
};
} }
const _onInput = new onInput(); const _onInput = new onInput();

@ -16,6 +16,8 @@ import LoginSignUpMobile from './mobile'
import { connect } from "react-redux"; import { connect } from "react-redux";
import { user, publicApi } from "../../redux/actions"; import { user, publicApi } from "../../redux/actions";
import axios from "axios";
import { ApiConfig } from "../../constants/defaultValues";
const LoginSignUp = ({ activeLogin, const LoginSignUp = ({ activeLogin,
sendOtp, sendOtp,
@ -25,6 +27,7 @@ const LoginSignUp = ({ activeLogin,
headerOptions, headerOptions,
setHeaderOptions, setHeaderOptions,
isMobile, isMobile,
bnLogin
}) => { }) => {
const [steps, setSteps] = useState(0); const [steps, setSteps] = useState(0);
const [index, setIndex] = useState(1); const [index, setIndex] = useState(1);
@ -178,8 +181,8 @@ const LoginSignUp = ({ activeLogin,
signUpFields?.otp2 + signUpFields?.otp2 +
signUpFields?.otp3 + signUpFields?.otp3 +
signUpFields?.otp4, signUpFields?.otp4,
userToken: "2", userToken: '1',
applicationToken: "22", applicationToken: '1',
}); });
setError(undefined); setError(undefined);
@ -200,8 +203,8 @@ const LoginSignUp = ({ activeLogin,
sendOtp({ sendOtp({
cellphone: signUpFields?.cellphone, cellphone: signUpFields?.cellphone,
otp: signUpFields?.otp, otp: signUpFields?.otp,
userToken: "2", userToken: '1',
applicationToken: "22", applicationToken: '1',
}); });
} }
}, [signUpFields]); }, [signUpFields]);
@ -287,6 +290,43 @@ const LoginSignUp = ({ activeLogin,
> >
ثبت نام ثبت نام
</Link> </Link>
{/* <Link
to=""
className="Login-box-form-btn w-full h-12 rounded-lg bg-red52 text-white flex items-center justify-center mt-6"
onClick={() => {
// setSteps(1);
bnLogin({
username: 'student',
password: 'barnameneg@r',
})
}}
>
ورود
</Link>
<Link
to=""
className="Login-box-form-btn w-full h-12 rounded-lg border border-solid border-red52 text-red52 flex items-center justify-center mt-4"
onClick={async () => {
// setSteps(1);
// setRegister(true);
bnLogin({
username: 'admin',
password: 'barnameneg@r',
})
// try {
// let res = await axios.post(ApiConfig.baseUrl + '/user/login', {
// username: 'admin',
// password: 'barnameneg@r',
// });
// console.log(res)
// } catch (error) {
// console.error(error)
// }
}}
>
ورود ادمین
</Link> */}
</> </>
} }
{ {
@ -327,7 +367,7 @@ const LoginSignUp = ({ activeLogin,
<div className="w-full flex flex-col mt-5"> <div className="w-full flex flex-col mt-5">
<div className="w-full flex flex-row-reverse justify-center"> <div className="w-full mt-5 flex flex-row-reverse justify-center">
<input <input
inputMode="numeric" inputMode="numeric"
style={{ direction: "ltr" }} style={{ direction: "ltr" }}
@ -393,7 +433,7 @@ const LoginSignUp = ({ activeLogin,
checkOtp(e) checkOtp(e)
// activeLogin() // activeLogin()
setTimeout(() => window.location.reload(), 200) // setTimeout(() => window.location.reload(), 200)
}} }}
> >
تایید تایید
@ -403,7 +443,7 @@ const LoginSignUp = ({ activeLogin,
شماره خود را اشتباه وارد کردید؟{" "} شماره خود را اشتباه وارد کردید؟{" "}
<button <button
className="bg-transparent border-none text-greenBA font-medium" className="bg-transparent border-none text-greenBA font-medium"
onClick={() => setLevel("phonenumber")} onClick={() => {setSteps(1); setLevel("phonenumber")}}
> >
اصلاح شماره تلفن اصلاح شماره تلفن
</button> </button>
@ -479,6 +519,7 @@ const mapStateToProps = (state) => ({
const mapDispatchToProps = { const mapDispatchToProps = {
sendOtp: user.otp_login, sendOtp: user.otp_login,
sendPhoneNumber: user.otp, sendPhoneNumber: user.otp,
bnLogin: user.bnLogin,
setHeaderOptions: publicApi.setHeaderOptions, setHeaderOptions: publicApi.setHeaderOptions,
}; };

@ -435,7 +435,7 @@ const LoginSignUpMobile = ({
شماره خود را اشتباه وارد کردید؟{" "} شماره خود را اشتباه وارد کردید؟{" "}
<button <button
className="bg-transparent border-none text-greenBA font-medium" className="bg-transparent border-none text-greenBA font-medium"
onClick={() => setLevel("phonenumber")} onClick={() => setSteps(1)}
> >
اصلاح شماره تلفن اصلاح شماره تلفن
</button> </button>

@ -64,8 +64,8 @@ const AddExam = () => {
] ]
return( return(
<div className='flex flex-col w-[96%] overflow-scroll overflow-x-hidden py-[6%] bg-grayFD rtl' style={{height: '100vh'}}> <div className='flex flex-col w-[96%] overflow-scroll overflow-x-hidden py-[4%] bg-grayFD rtl' style={{height: '100vh'}}>
<div className='flex w-full items-center py-4 pb-8 px-10 border-b border-gray-300'> <div className='flex w-full items-center py-2 pb-5 px-10 border-b border-gray-300'>
<h1 className="text-blue3A text-lg font-bold w-1/5 text-right px-4 border-r-4 border-blue65"> <h1 className="text-blue3A text-lg font-bold w-1/5 text-right px-4 border-r-4 border-blue65">
ساخت آزمون جدید ساخت آزمون جدید
</h1> </h1>

@ -112,7 +112,7 @@ const AddExamDescription = ({ grades, addExamState, dispatch, stepClick, backSte
</div> </div>
</div> </div>
<div className="flex w-full px-10 justify-end"> <div className="flex fixed bottom-10 left-0 w-full px-10 justify-end">
<button className=' mx-2 h-12 mt-4 text-red52 font-bold flex items-center justify-center' onClick={() => backStep()}> بازگشت به مرحله قبل </button> <button className=' mx-2 h-12 mt-4 text-red52 font-bold flex items-center justify-center' onClick={() => backStep()}> بازگشت به مرحله قبل </button>
<Button <Button
title='مرحله بعدی' title='مرحله بعدی'

@ -59,7 +59,7 @@ const AddGradeGroup = ({grades, addExamState, dispatch, stepClick}) => {
</div> </div>
</div> </div>
<div className="flex w-full px-10 justify-end"> <div className="flex fixed bottom-10 left-0 w-full px-10 justify-end">
<Button <Button
title='مرحله بعدی' title='مرحله بعدی'

@ -125,7 +125,7 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
console.log(question) console.log(question)
console.log(addExamState.courses.filter(itm => itm.id == selectedCourse.id)[0]?.selectedQuestions) console.log(addExamState.courses.filter(itm => itm.id == selectedCourse.id)[0]?.selectedQuestions)
return ( return (
<> <div className="flex flex-col h-screen">
{ {
questionarePopUp && <div className="w-full z-10 fixed h-screen backdrop-blur flex items-center -mt-10 justify-center"> questionarePopUp && <div className="w-full z-10 fixed h-screen backdrop-blur flex items-center -mt-10 justify-center">
<div className="w-1/2 bg-white rounded-xl flex flex-col shadow-lg p-6"> <div className="w-1/2 bg-white rounded-xl flex flex-col shadow-lg p-6">
@ -215,7 +215,7 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
} }
<div className="flex py-10 items-start px-10 border-b border-gray-200"> <div className="flex py-3 items-center px-10 border-b border-gray-200" >
<div className="flex flex-col w-1/6"> <div className="flex flex-col w-1/6">
<div className="text-blue3A text-lg font-bold text-right px-4 border-r-4 border-blue65"> <div className="text-blue3A text-lg font-bold text-right px-4 border-r-4 border-blue65">
تنظیمات آزمون تنظیمات آزمون
@ -322,7 +322,7 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
} }
}}> }}>
<div className="w-full flex border-b border-gray-200 px-2 pl-0"> <div className="w-full flex border-b border-gray-200 px-2 pl-0 h-full">
{/* Picked Qeustions From Bank */} {/* Picked Qeustions From Bank */}
<Droppable droppableId="Choosed_Questions_Form_Bank"> <Droppable droppableId="Choosed_Questions_Form_Bank">
{(provided) => ( {(provided) => (
@ -363,7 +363,7 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
</div> </div>
<div className="flex flex-col items-center overflow-x-hidden overflow-scroll" style={{ height: '550px' }}> <div className="flex flex-col items-center overflow-x-hidden overflow-scroll" style={{ height: '30vh' }}>
<div className="w-11/12 "> <div className="w-11/12 ">
{ {
addQuestionPopup === 'component' && addQuestionPopup === 'component' &&
@ -376,10 +376,22 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
setAsAnswer={e => { setAsAnswer={e => {
let thisOption = question.options.find(itm => itm.id == e) let thisOption = question.options.find(itm => itm.id == e)
thisOption.isAnswer = !thisOption.isAnswer thisOption.isAnswer = !thisOption.isAnswer
let otherOptions = question.options.filter(itm => itm.id !== e);
let newArr = [];
otherOptions.map((item) => newArr.push({...item, isAnswer: false}))
// console.log(newArr)
let newOptions = [...newArr, thisOption];
// console.log(newOptions);
let newNewOptions = newOptions.sort(function(a, b) {
return a.id - b.id
});
// console.log(options == newOptions)
setQuestion({ setQuestion({
...question, ...question,
options: [...options] options: [...newNewOptions]
}) })
}} }}
@ -500,7 +512,7 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
<Droppable droppableId="QUESTIONS_IN_BANK"> <Droppable droppableId="QUESTIONS_IN_BANK">
{(provided) => ( {(provided) => (
<div className="w-full py-1 flex flex-col items-center overflow-x-hidden overflow-scroll" > <div className="w-full py-1 flex flex-col items-center overflow-x-hidden overflow-scroll" style={{ height: '30vh' }}>
@ -542,7 +554,7 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
</Droppable> </Droppable>
</> </>
: :
<div className="w-full" style={{ height: '450px' }}> <div className="w-full" style={{ height: '55vh' }}>
</div> </div>
} }
@ -568,7 +580,7 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
</div> </div>
</> </div>
) )
} }

@ -60,13 +60,15 @@ const ViewExam = ({ addExamState, stepClick, backStep }) => {
</div> </div>
{addExamState.type !== 'pdf' ? <div className="w-full flex flex-col text-right"> {addExamState.type !== 'pdf' ? <div className="w-full flex flex-col text-right">
{ {
addExamState.courses.map((item) => ( addExamState.courses.map((item, index) => (
<div className="flex flex-col w-full py-6 border-b border-gray-400"> <div className={`flex flex-col w-full py-6 border-b-2 border-gray-400`}>
<h1 className="text-xl">سوالات {item.title}</h1> <h1 className="text-xl">سوالات {item.title}</h1>
<p className="text-gray-500 pt-2">ضریب {item.coefficient}</p> <p className="text-gray-500 pt-2">ضریب {item.coefficient}</p>
{ {
item.selectedQuestions.map((question) => ( item.selectedQuestions.map((question, idx) => (
<div className="flex flex-col w-full py-4 border-b border-gray-200" key={`PISHNAMAYESH__${question.questionId}`}> <div className={`flex flex-col w-full py-4 ${item.selectedQuestions.length !== idx + 1 && 'border-b border-gray-200'}`} key={`PISHNAMAYESH__${question.questionId}`}>
{console.log(item.selectedQuestions.length)}
{console.log(idx + 1)}
<div className="flex items-start pb-4"> <div className="flex items-start pb-4">
<h1 className="text-xl">{question.title}</h1> <h1 className="text-xl">{question.title}</h1>
<p className="w-1/12 pr-4">{question.score} نمره</p> <p className="w-1/12 pr-4">{question.score} نمره</p>

@ -20,7 +20,7 @@ const Metrics = () => {
<div className="w-1/2 p-2"> <div className="w-1/2 p-2">
{/* <input type="number" placeholder={item} className="bg-white border border-grayE0 h-14 w-full outline-none px-2 rounded-md" />7 {/* <input type="number" placeholder={item} className="bg-white border border-grayE0 h-14 w-full outline-none px-2 rounded-md" />7
*/} */}
<Input type="number" title={item} className="w-full" id={index} align="w-full"/> <Input type="number" title={item} className="w-full" id={index} gapSize="12" align="w-full" borderType="rounded" direction='rtl'/>
</div> </div>
) )
) )

@ -13,11 +13,11 @@ const Payment = () => {
<h1 className="text-blue3A text-lg font-bold w-full text-right px-4 mb-6 border-r-4 border-blue65"> <h1 className="text-blue3A text-lg font-bold w-full text-right px-4 mb-6 border-r-4 border-blue65">
نحوه پرداخت نحوه پرداخت
</h1> </h1>
<div className="flex flex-wrap px-4"> <div className="flex flex-wrap px-2">
{ {
inputs.map( inputs.map(
(item, index) => ( (item, index) => (
<div className="w-1/2 p-2 h-14 my-2 flex items-center font-bold" style={{color: '#707070'}}> <div className="w-1/2 p-1 h-14 my-2 flex items-center text-sm font-bold" style={{color: '#707070'}}>
<Checkbox name={'paymentCheckBox' + index}/> <Checkbox name={'paymentCheckBox' + index}/>
<p>{item}</p> <p>{item}</p>
</div> </div>

@ -3,7 +3,7 @@ import Button from "../../components/Button";
import Input from "../../components/input"; import Input from "../../components/input";
import Map from '../../components/Map' import Map from '../../components/Map'
import { connect } from "react-redux"; import { connect } from "react-redux";
const ContactUs = ({isMobile}) => { const ContactUs = ({ isMobile }) => {
const departments = [ const departments = [
@ -60,7 +60,7 @@ const ContactUs = ({isMobile}) => {
this.setState({ this.setState({
value, value,
}) })
}}/> }} />
<select className="bg-white border border-solid border-gray-200 w-full my-4 p-3 rounded-lg text-gray-400 outline-red52"> <select className="bg-white border border-solid border-gray-200 w-full my-4 p-3 rounded-lg text-gray-400 outline-red52">
{departments.map((item, index) => ( {departments.map((item, index) => (
<option key={`Grade__${index}`}>{item.title}</option> <option key={`Grade__${index}`}>{item.title}</option>
@ -69,31 +69,31 @@ const ContactUs = ({isMobile}) => {
<textarea className="w-full border-gray-200 border p-3 rounded-lg text-gray-400 outline-red52" rows='7' cols='70' placeholder="متن پیام را اینجا تایپ کنید"> <textarea className="w-full border-gray-200 border p-3 rounded-lg text-gray-400 outline-red52" rows='7' cols='70' placeholder="متن پیام را اینجا تایپ کنید">
</textarea> </textarea>
<div className="w-full flex" style={{direction: 'ltr'}}> <div className="w-full flex" style={{ direction: 'ltr' }}>
<Button title='ارسال پیام' className='w-full'/> <Button title='ارسال پیام' className='w-full' />
</div> </div>
</form> </form>
</div> </div>
: :
<div className="flex flex-col w-full rtl mr-32 mt-4"> <div className="flex flex-col w-full rtl mr-32 mt-4">
<div className="w-full rounded-xl overflow-hidden my-4 " style={{height:'215px'}}> <div className="w-full rounded-xl overflow-hidden my-4 " style={{ height: '215px' }}>
<Map /> <Map />
</div> </div>
<div className="flex w-full text-right flex-col mb-4 items-start"> <div className="flex w-full text-right flex-col mb-4 items-start">
<div className="w-full p-2 border-b border-gray-200"> <div className="w-full p-2 border-b border-gray-200">
<h1 className="text-red52 text-md p-1 pr-0 font-black">آدرس ما</h1> <h1 className="text-red52 text-md p-1 pr-0 font-black">آدرس ما</h1>
<p className="text-gray-400 text-sm">تهران خیابان انقلاب بین ابوریحان و فلسطین بن بست سروش پلاک 2</p> <p className="text-gray-400 text-sm">تهران خیابان فاطمی نبش خیابان دائمی پلاک 178 </p>
</div> </div>
<div className="w-full p-2 border-b border-gray-200"> <div className="w-full p-2 border-b border-gray-200">
<h1 className="text-red52 text-md p-1 pr-0 font-black">شماره تماس</h1> <h1 className="text-red52 text-md p-1 pr-0 font-black">شماره تماس</h1>
<p className="text-gray-400 text-sm"> 02163462405 - 02163462406 </p> <a href="tel:02188976077"><p className="text-gray-400 text-sm"> 02188976077 </p></a>
</div> </div>
<div className="w-full p-2 border-b border-gray-200"> <div className="w-full p-2 border-b border-gray-200">
<h1 className="text-red52 text-md p-1 pr-0 font-black"> ایمیل سازمانی </h1> <h1 className="text-red52 text-md p-1 pr-0 font-black"> ایمیل سازمانی </h1>
<p className="text-gray-400 text-sm">Info@Azmoonsample.ir</p> < a href="mailto:info@andishmand.ir"><p className="text-gray-400 text-sm">info@andishmand.ir</p></a>
</div> </div>
@ -130,7 +130,7 @@ const ContactUs = ({isMobile}) => {
this.setState({ this.setState({
value, value,
}) })
}} /> }} />
<select className="bg-white border border-solid border-gray-200 w-full my-4 p-3 rounded-lg text-gray-400 outline-red52"> <select className="bg-white border border-solid border-gray-200 w-full my-4 p-3 rounded-lg text-gray-400 outline-red52">
{departments.map((item, index) => ( {departments.map((item, index) => (
<option key={`Grade__${index}`}>{item.title}</option> <option key={`Grade__${index}`}>{item.title}</option>
@ -145,8 +145,8 @@ const ContactUs = ({isMobile}) => {
<textarea className="w-full border-gray-200 border p-3 rounded-lg text-gray-400 outline-red52" rows='7' cols='70' placeholder="متن پیام را اینجا تایپ کنید"> <textarea className="w-full border-gray-200 border p-3 rounded-lg text-gray-400 outline-red52" rows='7' cols='70' placeholder="متن پیام را اینجا تایپ کنید">
</textarea> </textarea>
<div className="w-full flex" style={{direction: 'ltr'}}> <div className="w-full flex" style={{ direction: 'ltr' }}>
<Button title='ارسال پیام' className='w-32'/> <Button title='ارسال پیام' className='w-32' />
</div> </div>
</form> </form>
</div> </div>
@ -155,11 +155,11 @@ const ContactUs = ({isMobile}) => {
<div className="w-1/2 p-2"> <div className="w-1/2 p-2">
<h1 className="text-red52 text-xl p-1 pr-0 font-black">آدرس ما</h1> <h1 className="text-red52 text-xl p-1 pr-0 font-black">آدرس ما</h1>
<p className="text-gray-400 text-sm">تهران خیابان انقلاب بین ابوریحان و فلسطین بن بست سروش پلاک 2</p> <p className="text-gray-400 text-sm">تهران خیابان فاطمی نبش خیابان دائمی پلاک 178</p>
</div> </div>
<div className="w-1/2 p-2"> <div className="w-1/2 p-2">
<h1 className="text-red52 text-xl p-1 pr-0 font-black">شماره تماس</h1> <h1 className="text-red52 text-xl p-1 pr-0 font-black">شماره تماس</h1>
<p className="text-gray-400 text-sm"> 02163462405 - 02163462406 </p> <a href="tel:02188976077"><p className="text-gray-400 text-sm"> 02188976077 </p></a>
</div> </div>
@ -173,13 +173,13 @@ const ContactUs = ({isMobile}) => {
</div> </div>
<div className="w-1/2 p-2"> <div className="w-1/2 p-2">
<h1 className="text-red52 text-xl p-1 pr-0 font-black"> ایمیل سازمانی </h1> <h1 className="text-red52 text-xl p-1 pr-0 font-black"> ایمیل سازمانی </h1>
<p className="text-gray-400 text-sm">Info@Azmoonsample.ir</p> < a href="mailto:info@andishmand.ir"><p className="text-gray-400 text-sm">info@andishmand.ir</p></a>
</div> </div>
</div> </div>
<div className="w-full border-t border-gray-300"></div> <div className="w-full border-t border-gray-300"></div>
<div className="w-full rounded-xl overflow-hidden my-4 " style={{height:'215px'}}> <div className="w-full rounded-xl overflow-hidden my-4 " style={{ height: '215px' }}>
<Map /> <Map />
</div> </div>
</div> </div>
@ -191,9 +191,9 @@ const ContactUs = ({isMobile}) => {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
isDark: state.publicApi.isDark, isDark: state.publicApi.isDark,
isMobile: state.publicApi.isMobile, isMobile: state.publicApi.isMobile,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {
}; };
export default connect(mapStateToProps, mapDispatchToProps)(ContactUs); export default connect(mapStateToProps, mapDispatchToProps)(ContactUs);

@ -10,64 +10,70 @@ import { connect } from "react-redux";
import ScrollContainer from 'react-indiana-drag-scroll' import ScrollContainer from 'react-indiana-drag-scroll'
const Games = ({ gameId, chooseGame, selectedGames, isMobile }) => { const Games = ({ gameId, chooseGame, selectedGames, isMobile, setTypes }) => {
const [data, setData] = useState([ const [data, setData] = useState([
{ {
id: 1, id: 1,
img: img1, img: img4,
title: 'کلاس های آموزشی', title: 'کتاب های آموزشی',
includedProductTypes: [1]
}, },
{ {
id: 2, id: 2,
img: img2, img: img3,
title: 'پیش ثبت نام مدارس', title: 'بسته های آزمون',
includedProductTypes: [2, 3]
}, },
{ {
id: 3, id: 3,
img: img3, img: img1,
title: 'بسته های آزمون', title: 'کلاس های آموزشی',
includedProductTypes: [4, 5]
}, },
{ {
id: 4, id: 4,
img: img4, img: img5,
title: 'کتاب های آموزشی', title: 'دوره های مجازی',
includedProductTypes: [6]
}, },
{ {
id: 5, id: 5,
img: img5, img: img2,
title: 'دوره های مجازی', title: 'پیش ثبت نام مدارس',
includedProductTypes: [7]
}, },
{ {
id: 6, id: 6,
img: img6, img: img6,
title: 'سایر خدمات', title: 'سایر خدمات',
includedProductTypes: [8]
}, },
]); ]);
return ( return (
<> <>
{ {
!isMobile ? <div className="Games w-full h-full pb-3 px-4 flex items-center justify-between border-b border-color1 flex-row-reverse"> !isMobile ? <div className="Games w-full h-full pb-3 flex items-center justify-between border-b border-color1 flex-row-reverse">
{data.map((item, index) => ( {data.map((item, index) => (
<div <div
key={item.id} key={item.id}
className="Games-item h-full rounded-lg bg-white relative flex items-center justify-center flex-col hover:bg-red82OP hover:text-red52 cursor-pointer hover:border hover:border-red52" className="Games-item h-full max-w-40 w-40 mx-1 border border-white rounded-lg bg-white relative flex items-center justify-center flex-col hover:bg-red82OP hover:text-red52 cursor-pointer hover:border hover:border-red52"
style={ style={
gameId === item.id gameId === item.id
? { ? {
backgroundColor: "rgba(223, 20, 82, 0.02)", backgroundColor: "rgba(223, 20, 82, 0.02)",
aspectRatio: "0.95/1", // aspectRatio: "0.85/1",
border: "1px solid #df1452", border: "1px solid #df1452",
} }
: { aspectRatio: "0.95/1" } :null
} }
onClick={() => chooseGame(item.id)} onClick={() => {chooseGame(item.id); setTypes(item.includedProductTypes); console.log(item)}}
> >
{selectedGames.includes(item.id) &&<div className="Games-item-active-circle w-4 h-4 rounded-full bg-color2 flex items-center justify-center absolute top-2 left-2"> {selectedGames.includes(item.id) &&<div className="Games-item-active-circle w-4 h-4 rounded-full bg-color2 flex items-center justify-center absolute top-2 left-2">
<HiCheck className="text-white h-3/4" /> <HiCheck className="text-white h-3/4" />
</div>} </div>}
<img src={item.img} alt="game-img" className="h-2/5" /> <img src={item.img} alt="game-img" className="h-2/5" />
<div <div
className="Games-title mt-2" className="text-sm mt-2"
style={gameId === item.id ? { color: "#df1452" } : null} style={gameId === item.id ? { color: "#df1452" } : null}
> >
{item.title} {item.title}
@ -89,7 +95,7 @@ const Games = ({ gameId, chooseGame, selectedGames, isMobile }) => {
} }
: { aspectRatio: "0.95/1" } : { aspectRatio: "0.95/1" }
} }
onClick={() => chooseGame(item.id)} onClick={() => {chooseGame(item.id); setTypes(item.includedProductTypes); console.log(item)}}
> >
{selectedGames.includes(item.id) &&<div className="Games-item-active-circle w-4 h-4 rounded-full bg-color2 flex items-center justify-center absolute top-2 left-2"> {selectedGames.includes(item.id) &&<div className="Games-item-active-circle w-4 h-4 rounded-full bg-color2 flex items-center justify-center absolute top-2 left-2">
<HiCheck className="text-white h-3/4" /> <HiCheck className="text-white h-3/4" />

@ -16,67 +16,150 @@ import { connect } from "react-redux";
import MobileRegister from './mobile' import MobileRegister from './mobile'
import persian from "react-date-object/calendars/persian" import persian from "react-date-object/calendars/persian"
import persian_fa from "react-date-object/locales/persian_fa" import persian_fa from "react-date-object/locales/persian_fa"
import DatePicker from "react-multi-date-picker"; import DatePicker, { DateObject } from "react-multi-date-picker";
import "react-multi-date-picker/styles/colors/red.css"
import Checkbox from "../../components/Checkbox"; import Checkbox from "../../components/Checkbox";
import { ostan } from "../../constants/states"; import { ostan } from "../../constants/states";
import { cities } from "../../constants/cities"; import { cities } from "../../constants/cities";
import _onInput from "../../utils/onInput";
import { publicApi, user } from "../../redux/actions";
import { VscDebugBreakpointUnsupported } from "react-icons/vsc";
const Register = ({ activeLogin, isMobile }) => { const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, province, city, user }) => {
const [steps, setSteps] = useState(0); const [steps, setSteps] = useState(0);
const [index, setIndex] = useState(1); const [index, setIndex] = useState(1);
const [register, setRegister] = useState(false); const [register, setRegister] = useState(false);
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(() => {
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
})
}
}, [user])
useEffect(() => {
window.scrollTo(0,0);
}, [steps])
const madraks = [
{
id: 0,
title: 'مدرک تحصیلی'
},
{
id: 1,
title: 'ابتدایی'
},
{
id: 2,
title: 'راهنمایی'
},
{
id: 3,
title: 'دیپلم'
},
{
id: 4,
title: 'فوق دیپلم'
},
{
id: 5,
title: 'کارشناسی'
},
{
id: 6,
title: 'کارشناسی ارشد'
},
{
id: 7,
title: 'دکتری عمومی'
},
{
id: 8,
title: 'دکترای حرفهای'
},
{
id: 9,
title: 'دکترای تخصصی'
},
{
id: 10,
title: 'فوق تخصص'
},
]
const [userInfo, setUserInfo] = useState({ const [userInfo, setUserInfo] = useState({
name: null, firstName: null,
familyName: null, lastName: null,
nationalId: null, nationalId: null,
birthDate: null, birthDate: null,
sex: null, gender: null,
grade: null, gradeIds: null,
schoolName: null, previousSchoolName: null,
city: null, previousSchoolType: null,
state: null, cityId: null,
fatherName: null, provinceId: null,
fatherNationalId: null, zone: null,
fatherFamilyName: null, fatherInfo: {
fatherJob: null, firstName: null,
fatherMajor: null, nationalId: null,
fatherPhoneNumber: null, lastName: null,
fatherJobAddress: null, job: null,
fatherJobPhoneNumber: null, education: null,
motherName: null, cellphone: null,
motherNationalId: null, workPlace: null,
motherFamilyName: null, workPhone: null,
motherJob: null, },
motherMajor: null, motherInfo: {
motherPhoneNumber: null, firstName: null,
motherJobAddress: null, nationalId: null,
motherJobPhoneNumber: null, lastName: null,
job: null,
familyNumber: null, education: null,
cellphone: null,
workPlace: null,
workPhone: null,
},
familyMemberCount: null,
address: null, address: null,
homePhoneNumber: null, phone: null,
rulesAccepted: false,
}); });
const finalViewInfo = [ const finalViewInfo = [
{ {
title: 'نام', title: 'نام',
value: userInfo.name value: userInfo.firstName
}, },
{ {
title: 'نام خانوادگی', title: 'نام خانوادگی',
value: userInfo.familyName value: userInfo.lastName
}, },
{ {
title: 'جنسیت', title: 'جنسیت',
value: userInfo.sex value: userInfo.gender
}, },
{ {
title: 'کد ملی', title: 'کد ملی',
@ -84,87 +167,87 @@ const Register = ({ activeLogin, isMobile }) => {
}, },
{ {
title: 'تاریخ تولد', title: 'تاریخ تولد',
value: userInfo.birthDate value: userInfo.birthDate?.toLocaleDateString('fa-IR')
}, },
{ {
title: 'نام مدرسه ', title: 'نام مدرسه ',
value: userInfo.schoolName value: userInfo.previousSchoolName
}, },
{ {
title: 'شهر', title: 'شهر',
value: userInfo.city value: userInfo.cityId
}, },
{ {
title: 'منطقه', title: 'منطقه',
value: userInfo.state value: userInfo.zone
}, },
{ {
title: 'نام', title: 'نام',
value: userInfo.fatherName value: userInfo.fatherInfo.firstName
}, },
{ {
title: 'نام خانوادگی', title: 'نام خانوادگی',
value: userInfo.fatherFamilyName value: userInfo.fatherInfo.lastName
}, },
{ {
title: 'کدملی', title: 'کدملی',
value: userInfo.fatherNationalId value: userInfo.fatherInfo.nationalId
}, },
{ {
title: 'مدرک تحصیلی', title: 'مدرک تحصیلی',
value: userInfo.fatherMajor value:madraks.find(itm => itm.id == userInfo.fatherInfo.education)?.title
}, },
{ {
title: 'تلفن همراه', title: 'تلفن همراه',
value: userInfo.fatherPhoneNumber value: userInfo.fatherInfo.cellphone
}, },
{ {
title: 'شغل', title: 'شغل',
value: userInfo.fatherJob value: userInfo.fatherInfo.job
}, },
{ {
title: 'محل کار', title: 'محل کار',
value: userInfo.fatherJobAddress value: userInfo.fatherInfo.workPlace
}, },
{ {
title: 'تلفن محل کار', title: 'تلفن محل کار',
value: userInfo.fatherJobPhoneNumber value: userInfo.fatherInfo.workPhone
}, },
{ {
title: 'نام', title: 'نام',
value: userInfo.motherName value: userInfo.motherInfo.firstName
}, },
{ {
title: 'نام خانوادگی', title: 'نام خانوادگی',
value: userInfo.motherFamilyName value: userInfo.motherInfo.lastName
}, },
{ {
title: 'کدملی', title: 'کدملی',
value: userInfo.motherNationalId value: userInfo.motherInfo.nationalId
}, },
{ {
title: 'مدرک تحصیلی', title: 'مدرک تحصیلی',
value: userInfo.motherMajor value: madraks.find(itm => itm.id == userInfo.motherInfo.education)?.title
}, },
{ {
title: 'تلفن همراه', title: 'تلفن همراه',
value: userInfo.motherPhoneNumber value: userInfo.motherInfo.cellphone
}, },
{ {
title: 'شغل', title: 'شغل',
value: userInfo.motherJob value: userInfo.motherInfo.job
}, },
{ {
title: 'محل کار', title: 'محل کار',
value: userInfo.motherJobAddress value: userInfo.motherInfo.workPlace
}, },
{ {
title: 'تلفن محل کار', title: 'تلفن محل کار',
value: userInfo.motherJobPhoneNumber value: userInfo.motherInfo.workPhone
}, },
{ {
title: 'تعداد افراد خانواده', title: 'تعداد افراد خانواده',
value: userInfo.familyNumber value: userInfo.familyMemberCount
}, },
{ {
title: 'نشانی محل سکونت', title: 'نشانی محل سکونت',
@ -172,7 +255,7 @@ const Register = ({ activeLogin, isMobile }) => {
}, },
{ {
title: 'تلفن ثابت', title: 'تلفن ثابت',
value: userInfo.homePhoneNumber value: userInfo.phone
}, },
]; ];
@ -279,11 +362,11 @@ const Register = ({ activeLogin, isMobile }) => {
}, },
{ {
id: 1, id: 1,
title: 'مذکر', title: 'آقا',
}, },
{ {
id: 2, id: 2,
title: 'مونث', title: 'خانم',
} }
] ]
const CostumeDatePickerInput = ({ openCalendar, value, handleValueChange, title }) => { const CostumeDatePickerInput = ({ openCalendar, value, handleValueChange, title }) => {
@ -293,42 +376,13 @@ const Register = ({ activeLogin, isMobile }) => {
value={value} value={value}
onChange={handleValueChange} onChange={handleValueChange}
title={title} title={title}
className="w-52" className="w-52 mx-1"
// type='date'
id={3} id={3}
/> />
) )
} }
const madraks = [
{
id: 0,
title: 'مدرک تحصیلی'
},
{
id: 1,
title: 'ابتدایی'
},
{
id: 2,
title: 'دیپلم'
},
{
id: 3,
title: 'فوق دیپلم'
},
{
id: 4,
title: 'کارشناسی'
},
{
id: 5,
title: 'کارشناسی ارشد'
},
{
id: 6,
title: 'دکتری'
},
]
const [selectedState, setSelectedState] = useState(null); const [selectedState, setSelectedState] = useState(null);
const [selectedCity, setSelectedCity] = useState(null); const [selectedCity, setSelectedCity] = useState(null);
@ -340,7 +394,7 @@ const Register = ({ activeLogin, isMobile }) => {
{/* form */} {/* form */}
{console.log(userInfo)} {console.log(userInfo)}
<div className="flex w-1/5 border-0 border-l border-solid border flex-col items-center p-6"> <div className="flex w-1/5 border-0 border-l border-solid flex-col items-center p-6">
{/* <img src={logo} className="w-1/2 m-4 mt-0" /> */} {/* <img src={logo} className="w-1/2 m-4 mt-0" /> */}
<div className="flex flex-col items-center justify-start leading-normal"> <div className="flex flex-col items-center justify-start leading-normal">
@ -382,6 +436,7 @@ const Register = ({ activeLogin, isMobile }) => {
</div> </div>
</div> </div>
{/* Content */} {/* Content */}
<div className="w-4/5 mx-10 flex flex-col items-start text-right b"> <div className="w-4/5 mx-10 flex flex-col items-start text-right b">
@ -393,31 +448,50 @@ const Register = ({ activeLogin, isMobile }) => {
<h1 className="font-black">مشخصات هویتی دانش آموز</h1> <h1 className="font-black">مشخصات هویتی دانش آموز</h1>
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">اطلاعات هویتی دانش آموز را با دقت تکمیل و عکس مدارک را بارگزاری نمایید</p> <p className="font-bold text-gray-400 mt-2 leading-normal text-sm">اطلاعات هویتی دانش آموز را با دقت تکمیل و عکس مدارک را بارگزاری نمایید</p>
</div> </div>
<div className="flex"> <div className="flex justify-between">
<div className="flex w-2/5 flex-wrap justify-between"> <div className="flex w-3/5 flex-wrap justify-start">
<Input className={'w-52'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={0} value={userInfo.name} onChange={(e) => setUserInfo({ ...userInfo, name: 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'} title="نام خانوادگی" borderType="rounded" id={1} direction='rtl' value={userInfo.familyName} onChange={(e) => setUserInfo({ ...userInfo, familyName: 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'} title="کدملی" borderType="rounded" gapSize="12" id={2} type='textNumber' max={10} value={userInfo.nationalId} onChange={e => setUserInfo({ ...userInfo, nationalId: 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' /> */} {/* <Input className={'w-52'} title="تاریخ تولد" borderType="rounded" gapSize="16" id={3} type='number' /> */}
<DatePicker <DatePicker
format="YYYY/MM/DD" format="YYYY/MM/DD"
onChange={(e) => setUserInfo({ ...userInfo, birthDate: e.day})} onChange={(e) =>{
// console.log(e)
var s = new Date(e.unix * 1000)
// console.log(date)
setUserInfo({ ...userInfo, birthDate: s })
}}
calendar={persian} calendar={persian}
className="red"
locale={persian_fa} locale={persian_fa}
renderButton={(direction, handleClick) => ( maxDate="1396/01/01"
<button className="text-blue-500 font-bold mx-2" onClick={handleClick}> currentDate={
new DateObject({
year: 2017,
month: 1,
day: 1
})
}
renderButton={(direction, handleClick) =>
{
return <p className="text-red-500 cursor-pointer font-bold mx-2"
onClick={() => handleClick()}
>
{direction === "right" ? ">" : "<"} {direction === "right" ? ">" : "<"}
</button> </p>
)} }
}
render={<CostumeDatePickerInput title='تاریخ تولد' />} render={<CostumeDatePickerInput title='تاریخ تولد' />}
/> />
<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"> <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">
{genders.map((item) => ( {genders.map((item) => (
<option key={`gender${item.id}`}>{item.title}</option> <option key={`gender${item.id}`} value={item.id}>{item.title}</option>
))} ))}
</select> </select>
@ -427,13 +501,14 @@ const Register = ({ activeLogin, isMobile }) => {
</div> </div>
<div className="w-3/5 flex flex-wrap justify-between"> <div className=" flex justify-between">
<div className="w-2/5 mx-4">
<div className="mx-1 ml-2">
<FileInput title="بارگزاری صفحه اول شناسنامه" id={1} /> <FileInput title="بارگزاری صفحه اول شناسنامه" id={1} />
</div> </div>
<div className="w-2/5 mx-4">
<FileInput title="بارگزاری عکس پرسنلی" id={2} /> <FileInput title="بارگزاری عکس پرسنلی" id={2} />
</div>
</div> </div>
@ -444,44 +519,54 @@ const Register = ({ activeLogin, isMobile }) => {
<h1 className="font-black">پایه تحصیلی</h1> <h1 className="font-black">پایه تحصیلی</h1>
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا پایه تحصیلی دانش آموز را وارد کنید</p> <p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا پایه تحصیلی دانش آموز را وارد کنید</p>
</div> </div>
<select 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-gray-400 outline-red52 mx-6">
{grades.map((item) => ( {grades.map((item) => (
<option key={`Grade__${item.id}`}>{item.title}</option> <option key={`Grade__${item.id}`} value={item.id}>{item.title}</option>
))} ))}
</select> </select>
</div> </div>
<div className="w-full px-10 py-8 flex flex-col "> <div className="w-full px-10 py-8 flex flex-col ">
<div className="mb-4"> <div className="mb-4">
<h1 className="font-black">مشخصات هویتی دانش آموز</h1> <h1 className="font-black">اطلاعات محل تحصیل</h1>
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">اطلاعات هویتی دانش آموز را با دقت تکمیل و عکس مدارک را بارگزاری نمایید</p> <p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا اطلاعات مربوط به محل تحصیل دانش آموز را وارد کنید</p>
</div> </div>
<div className="flex justify-start flex-wrap items-center"> <div className="flex justify-start flex-wrap items-center">
<Input className={'w-64'} title="نام مدرسه" borderType="rounded" gapSize="20" direction='rtl' id={4} value={userInfo.schoolName} onChange={e => setUserInfo({ ...userInfo, schoolName: e.target.value })} /> <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 <select
className="bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-gray-400 outline-red52 mx-6 ml-3 mt-6" className="bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-gray-400 outline-red52 mx-3 mt-6"
onChange={e => {setSelectedState(e.target.value); setUserInfo({...userInfo, state: e.target.value})}}> onChange={e => { setSelectedState(e.target.value); setUserInfo({ ...userInfo, previousSchoolType: e.target.value }) }}>
<option value={null}>نوع مدرسه</option>
<option value={1}>دولتی</option>
<option value={2}>نیمه دولتی</option>
<option value={3}>غیر انتفاعی</option>
<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"
onChange={e => { setSelectedState(e.target.value); setUserInfo({ ...userInfo, provinceId: e.target.value }) }}>
<option value={null}>استان</option> <option value={null}>استان</option>
{ {
ostan.map((item) => <option value={item.id}>{item.name}</option>) province?.map((item) => <option value={item.id}>{item.name}</option>)
} }
</select> </select>
{
selectedState !== null &&
<select <select
className="bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-gray-400 outline-red52 mx-6 mr-3 mt-6" 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"
onChange={(e) => {setSelectedCity(e.target.value); setUserInfo({...userInfo, city: e.target.value})}}> onChange={(e) => { setSelectedCity(e.target.value); setUserInfo({ ...userInfo, cityId: e.target.value }) }}>
<option value={null}> <option value={null}>
شهر شهر
</option> </option>
{ {
cities.filter(itm => itm.ostan == selectedState).map((city) => <option value={city.id}>{city.name}</option>) city?.filter(itm => itm.provinceId == selectedState).map((city) => <option value={city.id}>{city.name}</option>)
} }
</select> </select>
}
{
selectedCity !== null && <Input className={'w-64'} title="منطقه" borderType="rounded" gapSize="12" id={5} type='number' /> <Input className={'w-20'} title="منطقه" borderType="rounded" gapSize="12" id={5} type='number' value={userInfo.zone} onChange={(e) => setUserInfo({ ...userInfo, zone: e.target.value })} />
}
</div> </div>
<div className="flex pt-10 justify-end"> <div className="flex pt-10 justify-end">
<div className="w-40"> <div className="w-40">
@ -514,14 +599,28 @@ const Register = ({ activeLogin, isMobile }) => {
<div className="flex flex-wrap justify-between"> <div className="flex flex-wrap justify-between">
<Input className={'w-52'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={0} value={userInfo.fatherName} onChange={e => setUserInfo({ ...userInfo, fatherName: e.target.value })}/> <Input className={'w-52'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={0}
<Input className={'w-52'} title="کدملی" borderType="rounded" gapSize="12" id={1} type='number' value={userInfo.fatherNationalId} onChange={e => setUserInfo({ ...userInfo, fatherNationalId: e.target.value })}/> value={userInfo.fatherInfo.firstName}
onChange={e => setUserInfo({
...userInfo, fatherInfo: {
<Input className={'w-52'} title="نام خانوادگی" borderType="rounded" id={2} direction='rtl' value={userInfo.fatherFamilyName} onChange={e => setUserInfo({ ...userInfo, fatherFamilyName: e.target.value })}/> ...userInfo.fatherInfo,
<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"> firstName: _onInput.noNumber(e.target.value)
}
})} />
<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) }})} />
<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
}})}>
{madraks.map((item) => ( {madraks.map((item) => (
<option key={`madraks${item.id}`}>{item.title}</option> <option key={`madraks${item.id}`} value={item.id}>{item.title}</option>
))} ))}
</select> </select>
@ -532,12 +631,19 @@ const Register = ({ activeLogin, isMobile }) => {
<div className="flex flex-wrap justify-between"> <div className="flex flex-wrap justify-between">
<Input className={'w-52'} title="تلفن همراه" borderType="rounded" type='number' id={3} value={userInfo.fatherPhoneNumber} onChange={e => setUserInfo({ ...userInfo, fatherPhoneNumber: e.target.value })}/> <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" direction='rtl' gapSize="8" id={4} value={userInfo.fatherJob} onChange={e => setUserInfo({ ...userInfo, fatherJob: e.target.value })}/> ...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.fatherJobAddress} onChange={e => setUserInfo({ ...userInfo, fatherJobAddress: 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" gapSize="28" id={6} type='number' value={userInfo.fatherJobPhoneNumber} onChange={e => setUserInfo({ ...userInfo, fatherJobPhoneNumber: 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) }})} />
@ -555,14 +661,23 @@ const Register = ({ activeLogin, isMobile }) => {
<div className="flex flex-wrap justify-between"> <div className="flex flex-wrap justify-between">
<Input className={'w-52'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={7} value={userInfo.motherName} onChange={e => setUserInfo({ ...userInfo, motherName: e.target.value })}/> <Input className={'w-52'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={7} value={userInfo.motherInfo.firstName}
<Input className={'w-52'} title="کدملی" borderType="rounded" gapSize="12" id={8} type='number' value={userInfo.motherNationalId} onChange={e => setUserInfo({ ...userInfo, motherNationalId: 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) }})} />
<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={9} direction='rtl' value={userInfo.motherFamilyName} onChange={e => setUserInfo({ ...userInfo, motherFamilyName: 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"> <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
}})}>
{madraks.map((item) => ( {madraks.map((item) => (
<option key={`madraks${item.id}`}>{item.title}</option> <option key={`madraks${item.id}`} value={item.id}>{item.title}</option>
))} ))}
</select> </select>
@ -573,12 +688,30 @@ const Register = ({ activeLogin, isMobile }) => {
<div className="flex flex-wrap justify-between"> <div className="flex flex-wrap justify-between">
<Input className={'w-52'} title="تلفن همراه" borderType="rounded" type='number' id={10} value={userInfo.motherPhoneNumber} onChange={e => setUserInfo({ ...userInfo, motherPhoneNumber: e.target.value })}/> <Input className={'w-52'} title="تلفن همراه" borderType="rounded" type='text' id={10} max={11} value={userInfo.motherInfo.cellphone}
<Input className={'w-52'} title="شغل" borderType="rounded" direction='rtl' gapSize="8" id={11} value={userInfo.motherJob} onChange={e => setUserInfo({ ...userInfo, motherJob: e.target.value })}/> 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.motherJobAddress} onChange={e => setUserInfo({ ...userInfo, motherJobAddress: e.target.value })} /> <Input className={'w-52'} title="محل کار" borderType="rounded" id={12} direction='rtl'
<Input className={'w-52'} title="تلفن محل کار" borderType="rounded" gapSize="28" id={13} type='number' value={userInfo.motherJobPhoneNumber} onChange={e => setUserInfo({ ...userInfo, motherJobPhoneNumber: 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)
} })} />
@ -595,10 +728,10 @@ const Register = ({ activeLogin, isMobile }) => {
<div className="flex flex-wrap justify-start items-center"> <div className="flex flex-wrap justify-start items-center">
<Input className={'w-64 ml-2'} title="تعداد افراد خانواده" borderType="rounded" type='number' gapSize="40" direction='rtl' id={14} value={userInfo.familyNumber} onChange={e => setUserInfo({ ...userInfo, familyNumber: e.target.value })} /> <Input className={'w-64 ml-2'} title="تعداد افراد خانواده" borderType="rounded" type='number' gapSize="40" direction='rtl' id={14} value={userInfo.familyMemberCount} onChange={e => setUserInfo({ ...userInfo, familyMemberCount: e.target.value })} />
<Input className={'w-64'} title="تلفن ثابت" borderType="rounded" type='number' gapSize="40" direction='rtl' id={15} value={userInfo.homePhoneNumber} onChange={e => setUserInfo({ ...userInfo, homePhoneNumber: e.target.value })}/> <Input className={'w-64'} title="تلفن ثابت" borderType="rounded" gapSize="40" direction='rtl' id={15} max={11} value={userInfo.phone} onChange={e => setUserInfo({ ...userInfo, phone: _onInput.numberOnly(e.target.value) })} />
<Input title="نشانی محل سکونت" borderType="rounded" gapSize="40" id={16} value={userInfo.address} onChange={e => setUserInfo({ ...userInfo, address: e.target.value })}/> <Input title="نشانی محل سکونت" borderType="rounded" gapSize="40" id={16} direction='rtl' value={userInfo.address} onChange={e => setUserInfo({ ...userInfo, address: e.target.value })} />
@ -648,7 +781,7 @@ const Register = ({ activeLogin, isMobile }) => {
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا قوانین و مقررات را مطالعه فرمایید</p> <p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا قوانین و مقررات را مطالعه فرمایید</p>
</div> </div>
<p className="text-gray-500"> <p className="text-gray-500 text-justify">
بند اول: موارد مربوط به آموزش مخاطبین بند اول: موارد مربوط به آموزش مخاطبین
پیر مردی هر روز تو محله می دید پسر کی با کفش های پاره و پای برهنه با توپ پلاستیکی فوتبال بازی می کند، روزی رفت ی کتانی نو خرید و اومد و به پسرک گفت بیا این کفشا رو بپوشپسرک کفشا رو پوشید و خوشحال رو به پیر مرد کرد و گفت: شما خدایید؟! پیر مرد لبش را گزید و گفت نه! پسرک گفت پس دوست خدایی، چون من دیشب فقط به خدا گفتم كه کفش ندارم پیر مردی هر روز تو محله می دید پسر کی با کفش های پاره و پای برهنه با توپ پلاستیکی فوتبال بازی می کند، روزی رفت ی کتانی نو خرید و اومد و به پسرک گفت بیا این کفشا رو بپوشپسرک کفشا رو پوشید و خوشحال رو به پیر مرد کرد و گفت: شما خدایید؟! پیر مرد لبش را گزید و گفت نه! پسرک گفت پس دوست خدایی، چون من دیشب فقط به خدا گفتم كه کفش ندارم
هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس میزند... در نهایت این مرگ است که باید پیروز شود، زیرا از هنگام تولد بخشی از سرنوشت ما شده و فقط مدت کوتاهی پیش از بلعیدن طعمه اش، با آن بازی می کند. با این همه، ما تا آنجا که ممکن است، با علاقه فراوان و دلواپسی زیاد به زندگی ادامه می دهیم، همان طور که تا آنجا که ممکن است طولانی تر در یک حباب صابون می دمیم تا بزرگتر شود، گر چه با قطعیتی تمام می دانیم که خواهد ترکید. هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس میزند... در نهایت این مرگ است که باید پیروز شود، زیرا از هنگام تولد بخشی از سرنوشت ما شده و فقط مدت کوتاهی پیش از بلعیدن طعمه اش، با آن بازی می کند. با این همه، ما تا آنجا که ممکن است، با علاقه فراوان و دلواپسی زیاد به زندگی ادامه می دهیم، همان طور که تا آنجا که ممکن است طولانی تر در یک حباب صابون می دمیم تا بزرگتر شود، گر چه با قطعیتی تمام می دانیم که خواهد ترکید.
@ -666,14 +799,19 @@ const Register = ({ activeLogin, isMobile }) => {
</div> </div>
<div className="flex items-center px-10 py-6"> <div className="flex items-center px-10 py-6">
{/* <input type="checkbox" className="w-6 h-6" />*/} {/* <input type="checkbox" className="w-6 h-6" />*/}
<Checkbox name={'PARENTS_CHECKED'} /> <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"> <label className="mr-4 font-bold text-gray-500">
اینجانبان اینجانبان
<span className="text-red52 font-bold"> {userInfo.fatherName} {userInfo.fatherFamilyName} </span> <span className="text-red52 font-bold"> {userInfo.fatherInfo.firstName} {userInfo.fatherInfo.lastName} </span>
و و
<span className="text-red52 font-bold"> {userInfo.motherName} {userInfo.motherFamilyName} </span> <span className="text-red52 font-bold"> {userInfo.motherInfo.firstName} {userInfo.motherInfo.lastName} </span>
سرپرست های دانش آموز سرپرست های دانش آموز
<span className="text-red52 font-bold"> {userInfo.name} {userInfo.familyName} </span> <span className="text-red52 font-bold"> {userInfo.firstName} {userInfo.lastName} </span>
با قوانین و مقررات موافقت نموده و تمامی موارد به عهده اینجانب میباشد با قوانین و مقررات موافقت نموده و تمامی موارد به عهده اینجانب میباشد
</label> </label>
</div> </div>
@ -706,8 +844,8 @@ const Register = ({ activeLogin, isMobile }) => {
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا اطلاعاتی که وارد کرده اید را چک کنید</p> <p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا اطلاعاتی که وارد کرده اید را چک کنید</p>
</div> </div>
<div className="w-full flex flex-wrap">
<div className="flex flex-col border-b border-solid border-gray-300 leading-7 pb-6"> <div className="flex flex-col w-1/2 border-b border-solid border-gray-300 leading-7 py-6">
<h1 className="font-bold mb-2 text-lg">مشخصات دانش آموز</h1> <h1 className="font-bold mb-2 text-lg">مشخصات دانش آموز</h1>
{ {
finalViewInfo.slice(0, 8).map(item => ( finalViewInfo.slice(0, 8).map(item => (
@ -717,7 +855,7 @@ const Register = ({ activeLogin, isMobile }) => {
)) ))
} }
</div> </div>
<div className="flex flex-col border-b border-solid border-gray-300 leading-7 py-6"> <div className="flex w-1/2 flex-col border-b border-solid border-gray-300 leading-7 py-6">
<h1 className="font-bold mb-2 text-lg">مشخصات پدر دانش آموز</h1> <h1 className="font-bold mb-2 text-lg">مشخصات پدر دانش آموز</h1>
{ {
finalViewInfo.slice(8, 16).map(item => ( finalViewInfo.slice(8, 16).map(item => (
@ -727,7 +865,7 @@ const Register = ({ activeLogin, isMobile }) => {
)) ))
} }
</div> </div>
<div className="flex flex-col border-b border-solid border-gray-300 leading-7 py-6"> <div className="flex w-1/2 flex-col border-b border-solid border-gray-300 leading-7 py-6">
<h1 className="font-bold mb-2 text-lg">مشخصات مادر دانش آموز</h1> <h1 className="font-bold mb-2 text-lg">مشخصات مادر دانش آموز</h1>
{ {
finalViewInfo.slice(16, 24).map(item => ( finalViewInfo.slice(16, 24).map(item => (
@ -737,7 +875,7 @@ const Register = ({ activeLogin, isMobile }) => {
)) ))
} }
</div> </div>
<div className="flex flex-col border-b border-solid border-gray-300 leading-7 py-6"> <div className="flex w-1/2 flex-col border-b border-solid border-gray-300 leading-7 py-6">
<h1 className="font-bold mb-2 text-lg">مشخصات خانواده دانش آموز</h1> <h1 className="font-bold mb-2 text-lg">مشخصات خانواده دانش آموز</h1>
{ {
finalViewInfo.slice(24, 27).map(item => ( finalViewInfo.slice(24, 27).map(item => (
@ -748,6 +886,7 @@ const Register = ({ activeLogin, isMobile }) => {
} }
</div> </div>
</div> </div>
</div>
<div className="w-full flex pt-10 justify-end"> <div className="w-full flex pt-10 justify-end">
<div className="w-40 mx-4"> <div className="w-40 mx-4">
@ -758,8 +897,9 @@ const Register = ({ activeLogin, isMobile }) => {
</div> </div>
<div className="w-40"> <div className="w-40">
<Button borderType='rounded' title='ورود' to='/dashboard' onClick={() => <Button borderType='rounded' title='تایید' to='/' onClick={() =>
activeLogin() // activeLogin()
setProfile(userInfo)
} /> } />
</div> </div>
</div> </div>
@ -780,7 +920,15 @@ const Register = ({ activeLogin, isMobile }) => {
}; };
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
isMobile: state.publicApi.isMobile, isMobile: state.publicApi.isMobile,
province: state.publicApi.province,
city: state.publicApi.city,
user: state.user.status,
}) })
const mapDispatchToProps = {
setProfile: user.setProfile,
getProvince: publicApi.getProvince,
getCity: publicApi.getCity,
}
export default connect(mapStateToProps)(Register); export default connect(mapStateToProps, mapDispatchToProps)(Register);

@ -11,65 +11,176 @@ import Stepper from "../../../components/Stepper";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
import Checkbox from "../../../components/Checkbox"; import Checkbox from "../../../components/Checkbox";
import { user, publicApi } from "../../../redux/actions";
import _onInput from "../../../utils/onInput";
const MobileRegister = ({ activeLogin, isMobile }) => { import persian from "react-date-object/calendars/persian"
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"
const MobileRegister = ({
activeLogin,
isMobile,
getProvince,
getCity,
province,
city,
user,
setProfile
}) => {
const [steps, setSteps] = useState(0); const [steps, setSteps] = useState(0);
const [index, setIndex] = useState(1); const [index, setIndex] = useState(1);
const [register, setRegister] = useState(false); const [register, setRegister] = useState(false);
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('');
const [selectedState, setSelectedState] = useState(null);
const [selectedCity, setSelectedCity] = useState(null);
useEffect(() => { useEffect(() => {
window.scrollTo(0,0) window.scrollTo(0, 0)
}, [steps]) }, [steps])
useEffect(() => {
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
})
}
}, [user])
const madraks = [
{
id: 0,
title: 'مدرک تحصیلی'
},
{
id: 1,
title: 'ابتدایی'
},
{
id: 2,
title: 'راهنمایی'
},
{
id: 3,
title: 'دیپلم'
},
{
id: 4,
title: 'فوق دیپلم'
},
{
id: 5,
title: 'کارشناسی'
},
{
id: 6,
title: 'کارشناسی ارشد'
},
{
id: 7,
title: 'دکتری عمومی'
},
{
id: 8,
title: 'دکترای حرفهای'
},
{
id: 9,
title: 'دکترای تخصصی'
},
{
id: 10,
title: 'فوق تخصص'
},
]
const genders = [
{
id: 0,
title: 'جنسیت'
},
{
id: 1,
title: 'آقا',
},
{
id: 2,
title: 'خانم',
}
]
const [userInfo, setUserInfo] = useState({ const [userInfo, setUserInfo] = useState({
name: null, firstName: null,
familyName: null, lastName: null,
nationalId: null, nationalId: null,
birthDate: null, birthDate: null,
sex: null, gender: null,
grade: null, gradeIds: null,
schoolName: null, previousSchoolName: null,
city: null, previousSchoolType: null,
state: null, cityId: null,
fatherName: null, provinceId: null,
fatherNationalId: null, zone: null,
fatherFamilyName: null, fatherInfo: {
fatherJob: null, firstName: null,
fatherMajor: null, nationalId: null,
fatherPhoneNumber: null, lastName: null,
fatherJobAddress: null, job: null,
fatherJobPhoneNumber: null, education: null,
motherName: null, cellphone: null,
motherNationalId: null, workPlace: null,
motherFamilyName: null, workPhone: null,
motherJob: null, },
motherMajor: null, motherInfo: {
motherPhoneNumber: null, firstName: null,
motherJobAddress: null, nationalId: null,
motherJobPhoneNumber: null, lastName: null,
job: null,
familyNumber: null, education: null,
cellphone: null,
workPlace: null,
workPhone: null,
},
familyMemberCount: null,
address: null, address: null,
homePhoneNumber: null, phone: null,
rulesAccepted: false,
}); });
const finalViewInfo = [ const finalViewInfo = [
{ {
title: 'نام', title: 'نام',
value: userInfo.name value: userInfo.firstName
}, },
{ {
title: 'نام خانوادگی', title: 'نام خانوادگی',
value: userInfo.familyName value: userInfo.lastName
}, },
{ {
title: 'جنسیت', title: 'جنسیت',
value: userInfo.sex value: userInfo.gender
}, },
{ {
title: 'کد ملی', title: 'کد ملی',
@ -77,87 +188,87 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
}, },
{ {
title: 'تاریخ تولد', title: 'تاریخ تولد',
value: userInfo.birthDate value: userInfo.birthDate?.toLocaleDateString('fa-IR')
}, },
{ {
title: 'نام مدرسه ', title: 'نام مدرسه ',
value: userInfo.schoolName value: userInfo.previousSchoolName
}, },
{ {
title: 'شهر', title: 'شهر',
value: userInfo.city value: userInfo.cityId
}, },
{ {
title: 'منطقه', title: 'منطقه',
value: userInfo.state value: userInfo.zone
}, },
{ {
title: 'نام', title: 'نام',
value: userInfo.fatherName value: userInfo.fatherInfo.firstName
}, },
{ {
title: 'نام خانوادگی', title: 'نام خانوادگی',
value: userInfo.fatherFamilyName value: userInfo.fatherInfo.lastName
}, },
{ {
title: 'کدملی', title: 'کدملی',
value: userInfo.fatherNationalId value: userInfo.fatherInfo.nationalId
}, },
{ {
title: 'مدرک تحصیلی', title: 'مدرک تحصیلی',
value: userInfo.fatherMajor value: madraks.find(itm => itm.id == userInfo.fatherInfo.education)?.title
}, },
{ {
title: 'تلفن همراه', title: 'تلفن همراه',
value: userInfo.fatherPhoneNumber value: userInfo.fatherInfo.cellphone
}, },
{ {
title: 'شغل', title: 'شغل',
value: userInfo.fatherJob value: userInfo.fatherInfo.job
}, },
{ {
title: 'محل کار', title: 'محل کار',
value: userInfo.fatherJobAddress value: userInfo.fatherInfo.workPlace
}, },
{ {
title: 'تلفن محل کار', title: 'تلفن محل کار',
value: userInfo.fatherJobPhoneNumber value: userInfo.fatherInfo.workPhone
}, },
{ {
title: 'نام', title: 'نام',
value: userInfo.motherName value: userInfo.motherInfo.firstName
}, },
{ {
title: 'نام خانوادگی', title: 'نام خانوادگی',
value: userInfo.motherFamilyName value: userInfo.motherInfo.lastName
}, },
{ {
title: 'کدملی', title: 'کدملی',
value: userInfo.motherNationalId value: userInfo.motherInfo.nationalId
}, },
{ {
title: 'مدرک تحصیلی', title: 'مدرک تحصیلی',
value: userInfo.motherMajor value: madraks.find(itm => itm.id == userInfo.motherInfo.education)?.title
}, },
{ {
title: 'تلفن همراه', title: 'تلفن همراه',
value: userInfo.motherPhoneNumber value: userInfo.motherInfo.cellphone
}, },
{ {
title: 'شغل', title: 'شغل',
value: userInfo.motherJob value: userInfo.motherInfo.job
}, },
{ {
title: 'محل کار', title: 'محل کار',
value: userInfo.motherJobAddress value: userInfo.motherInfo.workPlace
}, },
{ {
title: 'تلفن محل کار', title: 'تلفن محل کار',
value: userInfo.motherJobPhoneNumber value: userInfo.motherInfo.workPhone
}, },
{ {
title: 'تعداد افراد خانواده', title: 'تعداد افراد خانواده',
value: userInfo.familyNumber value: userInfo.familyMemberCount
}, },
{ {
title: 'نشانی محل سکونت', title: 'نشانی محل سکونت',
@ -165,7 +276,7 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
}, },
{ {
title: 'تلفن ثابت', title: 'تلفن ثابت',
value: userInfo.homePhoneNumber value: userInfo.phone
}, },
]; ];
@ -212,10 +323,7 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
}, },
] ]
const grades = [ const grades = [
{
id: 0,
title: ''
},
{ {
id: 1, id: 1,
title: 'پایه اول' title: 'پایه اول'
@ -268,9 +376,24 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
] ]
const CostumeDatePickerInput = ({ openCalendar, value, handleValueChange, title }) => {
return (
<Input
onFocus={openCalendar}
value={value}
onChange={handleValueChange}
title={title}
className={'w-full'}
// type='date'
id={3}
/>
)
}
return ( return (
<div className="flex w-full px-4 justify-center py-20" style={{ direction: 'rtl'}}> <div className="flex w-full px-4 justify-center py-20" style={{ direction: 'rtl' }}>
<div className="w-full flex flex-col "> <div className="w-full flex flex-col ">
@ -291,34 +414,70 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
</div> </div>
<div className="flex w-full flex-col"> <div className="flex w-full flex-col">
<Input className={'w-full'} 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-full'} title="نام خانوادگی" borderType="rounded" id={1} direction='rtl' value={userInfo.lastName} onChange={(e) => setUserInfo({ ...userInfo, lastName: _onInput.noNumber(e.target.value) })} />
<Input className={'w-full'} title="کدملی" borderType="rounded" gapSize="12" id={2} type='textNumber' max={10} value={userInfo.nationalId} onChange={e => setUserInfo({ ...userInfo, nationalId: _onInput.numberOnly(e.target.value) })} />
<DatePicker
format="YYYY/MM/DD"
onChange={(e) => {
// console.log(e)
var s = new Date(e.unix * 1000)
// console.log(date)
setUserInfo({ ...userInfo, birthDate: s })
}}
calendar={persian}
className="red rmdp-mobile"
locale={persian_fa}
maxDate="1396/01/01"
currentDate={
new DateObject({
year: 2017,
month: 1,
day: 1
})
}
renderButton={(direction, handleClick) => {
return <p className="text-red-500 cursor-pointer font-bold mx-2"
onClick={() => handleClick()}
>
{direction === "right" ? ">" : "<"}
</p>
}
}
<Input title="نام" borderType="rounded" gapSize="8" direction='rtl' id={0} /> render={<CostumeDatePickerInput title='تاریخ تولد' />}
<Input title="کدملی" borderType="rounded" gapSize="12" id={1} type='number' />
<Input title="جنسیت" borderType="rounded" gapSize="16" id={2} />
<Input title="نام خانوادگی" borderType="rounded" id={3} direction='rtl' />
<Input title="تاریخ تولد" borderType="rounded" gapSize="16" id={4} type='number' />
/>
<select
onChange={e => setUserInfo({ ...userInfo, gender: e.target.value })}
className="bg-white border border-solid border-gray-200 w-full px-3 rounded text-gray-400 outline-red52 py-1 h-12 mt-6">
{genders.map((item) => (
<option key={`gender${item.id}`} value={item.id}>{item.title}</option>
))}
</select>
<br></br> <br></br>
<FileInput title="بارگزاری صفحه اول شناسنامه" id={1} /> <FileInput title="بارگزاری صفحه اول شناسنامه" id={1} mobile />
<br></br> <br></br>
<FileInput title="بارگزاری عکس پرسنلی" id={2} /> <FileInput title="بارگزاری عکس پرسنلی" id={2} mobile />
<br></br>
</div> </div>
</div> </div>
<div className="w-full py-10 leading-normal border-b flex flex-col items-center border-solid border-gray-200"> <div className="w-full py-10 pb-5 leading-normal border-b flex flex-col items-center border-solid border-gray-200">
<div className="w-full pb-2"> <div className="w-full pb-2">
<h1 className="font-black">پایه تحصیلی</h1> <h1 className="font-black">پایه تحصیلی</h1>
<p className="font-bold text-gray-300 text-sm">لطفا پایه تحصیلی دانش آموز را وارد کنید</p> <p className="font-bold text-gray-300 text-sm">لطفا پایه تحصیلی دانش آموز را وارد کنید</p>
</div> </div>
<select className="bg-white border border-solid border-gray-300 w-full 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-full p-3 rounded-md text-gray-400 outline-red52">
{grades.map((item) => ( {grades.map((item) => (
<option key={`Grade__${item.id}`}>{item.title}</option> <option key={`Grade__${item.id}`} value={item.id}>{item.title}</option>
))} ))}
</select> </select>
</div> </div>
@ -328,15 +487,39 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<p className="font-bold text-gray-300 text-sm">اطلاعات هویتی دانش آموز را با دقت تکمیل و عکس مدارک را بارگزاری نمایید</p> <p className="font-bold text-gray-300 text-sm">اطلاعات هویتی دانش آموز را با دقت تکمیل و عکس مدارک را بارگزاری نمایید</p>
</div> </div>
<div className="flex flex-col items-center"> <div className="flex flex-col items-center">
<Input title="نام مدرسه" borderType="rounded" gapSize="20" direction='rtl' id={5} /> <Input className={'w-full'} 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-full px-3 rounded text-gray-400 outline-red52 mx-2 h-12 mt-6">
{grades.map((item) => ( <select
<option key={`Grade__${item.id}`}>{item.title}</option> className="bg-white border border-solid border-gray-200 w-full p-3 rounded-md text-gray-400 outline-red52 mt-6"
))} onChange={e => { setSelectedState(e.target.value); setUserInfo({ ...userInfo, previousSchoolType: e.target.value }) }}>
<option value={null}>نوع مدرسه</option>
<option value={1}>دولتی</option>
<option value={2}>نیمه دولتی</option>
<option value={3}>غیر انتفاعی</option>
<option value={4}>تیزهوشان</option>
</select>
<select
className="bg-white border border-solid border-gray-200 w-full p-3 rounded-md text-gray-400 outline-red52 mr-0 mt-6"
onChange={e => { setSelectedState(e.target.value); setUserInfo({ ...userInfo, provinceId: e.target.value }) }}>
<option value={null}>استان</option>
{
province?.map((item) => <option value={item.id}>{item.name}</option>)
}
</select>
<select
className="bg-white border border-solid border-gray-200 w-full p-3 rounded-md text-gray-400 outline-red52 mr-0 mt-6"
onChange={(e) => { setSelectedCity(e.target.value); setUserInfo({ ...userInfo, cityId: e.target.value }) }}>
<option value={null}>
شهر
</option>
{
city?.filter(itm => itm.provinceId == selectedState).map((city) => <option value={city.id}>{city.name}</option>)
}
</select> </select>
<Input title="شهر" borderType="rounded" gapSize="8" direction='rtl' id={6} />
<Input title="منطقه" borderType="rounded" gapSize="12" id={7} type='number' />
<Input title="استان" borderType="rounded" gapSize="12" id={8} type='number' /> <Input className={'w-full'} title="منطقه" borderType="rounded" gapSize="12" id={5} type='number' value={userInfo.zone} onChange={(e) => setUserInfo({ ...userInfo, zone: e.target.value })} />
</div> </div>
<div className="flex pt-10 justify-end"> <div className="flex pt-10 justify-end">
@ -350,22 +533,7 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
// } else { // } else {
// toast.warn('لطفا تمامی فیلد ها را پر کنید') // toast.warn('لطفا تمامی فیلد ها را پر کنید')
// } // }
setUserInfo(prevState => {
return {
...prevState,
name: document.getElementById('Login-box-form-item-input-name0').value,
nationalId: document.getElementById('Login-box-form-item-input-name1').value,
sex: document.getElementById('Login-box-form-item-input-name2').value,
familyName: document.getElementById('Login-box-form-item-input-name3').value,
birthDate: document.getElementById('Login-box-form-item-input-name4').value,
schoolName: document.getElementById('Login-box-form-item-input-name5').value,
city: document.getElementById('Login-box-form-item-input-name6').value,
state: document.getElementById('Login-box-form-item-input-name7').value,
}
})
}} /> }} />
</div> </div>
</div> </div>
@ -389,26 +557,51 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<div className="flex flex-col"> <div className="flex flex-col">
<Input title="نام" borderType="rounded" gapSize="8" direction='rtl' id={0} />
<Input title="کدملی" borderType="rounded" gapSize="12" id={1} type='number' />
<Input title="نام خانوادگی" borderType="rounded" id={2} direction='rtl' />
<Input title="مدرک نحصیلی" borderType="rounded" gapSize="20" id={3} />
<Input className={'w-full'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={0}
value={userInfo.fatherInfo.firstName}
onChange={e => setUserInfo({
...userInfo, fatherInfo: {
...userInfo.fatherInfo,
firstName: _onInput.noNumber(e.target.value)
}
})} />
<Input className={'w-full'} title="نام خانوادگی" borderType="rounded" id={1} direction='rtl' value={userInfo.fatherInfo.lastName}
onChange={e => setUserInfo({ ...userInfo, fatherInfo: { ...userInfo.fatherInfo, lastName: _onInput.noNumber(e.target.value) } })} />
<Input className={'w-full'} 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-full 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
}
})}>
{madraks.map((item) => (
<option key={`madraks${item.id}`} value={item.id}>{item.title}</option>
))}
</select>
<Input title="تلفن همراه" borderType="rounded" type='number' id={4} /> <Input className={'w-full'} title="تلفن همراه" borderType="rounded" max={11} id={3} value={userInfo.fatherInfo.cellphone} onChange={e => setUserInfo({
<Input title="شغل" borderType="rounded" direction='rtl' gapSize="8" id={5} /> ...userInfo, fatherInfo: {
...userInfo.fatherInfo,
cellphone: _onInput.phonenumber(e.target.value)
}
})} />
<Input className={'w-full'} 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 title="محل کار" borderType="rounded" id={6} direction='rtl' /> <Input className={'w-full'} title="محل کار" borderType="rounded" id={5} direction='rtl' value={userInfo.fatherInfo.workPlace}
<Input title="تلفن محل کار" borderType="rounded" gapSize="28" id={7} type='number' />
onChange={e => setUserInfo({ ...userInfo, fatherInfo: { ...userInfo.fatherInfo, workPlace: e.target.value } })} />
<Input className={'w-full'} 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) } })} />
@ -425,25 +618,60 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<div className="flex w-full flex-col"> <div className="flex w-full flex-col">
<Input title="نام" borderType="rounded" gapSize="8" direction='rtl' id={8} /> <Input className={'w-full'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={7} value={userInfo.motherInfo.firstName}
<Input title="کدملی" borderType="rounded" gapSize="12" id={9} type='number' /> onChange={e => setUserInfo({ ...userInfo, motherInfo: { ...userInfo.motherInfo, firstName: _onInput.noNumber(e.target.value) } })} />
<Input title="نام خانوادگی" borderType="rounded" id={10} direction='rtl' />
<Input title="مدرک نحصیلی" borderType="rounded" gapSize="20" id={11} />
<Input className={'w-full'} 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-full'} 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-full 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
}
})}>
{madraks.map((item) => (
<option key={`madraks${item.id}`} value={item.id}>{item.title}</option>
))}
</select>
<Input title="تلفن همراه" borderType="rounded" type='number' id={12} /> <Input className={'w-full'} title="تلفن همراه" borderType="rounded" type='text' id={10} max={11} value={userInfo.motherInfo.cellphone}
<Input title="شغل" borderType="rounded" direction='rtl' gapSize="8" id={13} /> onChange={e => setUserInfo({
...userInfo, motherInfo: {
...userInfo.motherInfo,
cellphone: _onInput.phonenumber(e.target.value)
}
})} />
<Input className={'w-full'} 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 title="محل کار" borderType="rounded" id={14} direction='rtl' /> <Input className={'w-full'} title="محل کار" borderType="rounded" id={12} direction='rtl'
<Input title="تلفن محل کار" borderType="rounded" gapSize="28" id={15} type='number' /> value={userInfo.motherInfo.workPlace}
onChange={e => setUserInfo({
...userInfo, motherInfo: {
...userInfo.motherInfo,
workPlace: e.target.value
}
})} />
<Input className={'w-full'} 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)
}
})} />
@ -459,19 +687,14 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
</div> </div>
<div className="flex flex-col items-center"> <div className="flex flex-col items-center">
<select className="bg-white border border-solid border-gray-200 w-full px-3 rounded text-gray-400 outline-red52 mx-2 h-12 mt-6">
{grades.map((item) => (
<option key={`Grade__${item.id}`}>{item.title}</option>
))}
</select>
<Input title="تعداد افراد خانواده" borderType="rounded" type='number' gapSize="40" direction='rtl' id={16} />
<Input title="نشانی محل سکونت" borderType="rounded" gapSize="40" id={17} /> <Input className={'w-full'} title="تعداد افراد خانواده" borderType="rounded" type='number' gapSize="40" direction='rtl' id={14} value={userInfo.familyMemberCount} onChange={e => setUserInfo({ ...userInfo, familyMemberCount: e.target.value })} />
<Input className={'w-full'} title="تلفن ثابت" borderType="rounded" gapSize="40" direction='rtl' id={15} max={11} value={userInfo.phone} onChange={e => setUserInfo({ ...userInfo, phone: _onInput.numberOnly(e.target.value) })} />
<Input title="نشانی محل سکونت" borderType="rounded" gapSize="40" id={16} direction='rtl' value={userInfo.address} onChange={e => setUserInfo({ ...userInfo, address: e.target.value })} />
<Input title="تلفن ثابت" borderType="rounded" type='number' gapSize="40" direction='rtl' id={18} />
<Input title="تعداد افراد خانواده" borderType="rounded" type='number' gapSize="40" direction='rtl' id={19} />
@ -487,46 +710,13 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<div className="w-1/2 mr-2"> <div className="w-1/2 mr-2">
<Button borderType='rounded' title='مرحله بعد' onClick={() => { <Button borderType='rounded' title='مرحله بعد' onClick={() => {
const inputs = document.querySelectorAll('.Login-box-form-item-input') const inputs = document.querySelectorAll('.Login-box-form-item-input')
// if (inputs[0].value) {
setSteps(2); setSteps(2);
setActiveStep([true, true, true, false]) setActiveStep([true, true, true, false])
// } else {
// alert('لطفا تمامی فیلد ها را پر کنید')
// }
setUserInfo(prevState => {
return {
...prevState,
fatherName: document.getElementById('Login-box-form-item-input-name0').value,
fatherNationalId: document.getElementById('Login-box-form-item-input-name1').value,
fatherFamilyName: document.getElementById('Login-box-form-item-input-name2').value,
fatherMajor: document.getElementById('Login-box-form-item-input-name3').value,
fatherPhoneNumber: document.getElementById('Login-box-form-item-input-name4').value,
fatherJob: document.getElementById('Login-box-form-item-input-name5').value,
fatherJobAddress: document.getElementById('Login-box-form-item-input-name6').value,
fatherJobPhoneNumber: document.getElementById('Login-box-form-item-input-name7').value,
motherName: document.getElementById('Login-box-form-item-input-name8').value,
motherNationalId: document.getElementById('Login-box-form-item-input-name9').value,
motherFamilyName: document.getElementById('Login-box-form-item-input-name10').value,
motherMajor: document.getElementById('Login-box-form-item-input-name11').value,
motherPhoneNumber: document.getElementById('Login-box-form-item-input-name12').value,
motherJob: document.getElementById('Login-box-form-item-input-name13').value,
motherJobAddress: document.getElementById('Login-box-form-item-input-name14').value,
motherJobPhoneNumber: document.getElementById('Login-box-form-item-input-name15').value,
familyNumber: document.getElementById('Login-box-form-item-input-name16').value,
address: document.getElementById('Login-box-form-item-input-name17').value,
homePhoneNumber: document.getElementById('Login-box-form-item-input-name18').value,
}
})
}} /> }} />
</div> </div>
</div> </div>
@ -546,7 +736,7 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
</div> </div>
<p className="text-gray-500 text-sm overflow-x-hidden overflow-scroll w-full" style={{height:'60vh'}}> <p className="text-gray-500 text-sm text-justify pl-2 overflow-x-hidden overflow-scroll w-full" style={{ height: '60vh' }}>
بند اول: موارد مربوط به آموزش مخاطبین بند اول: موارد مربوط به آموزش مخاطبین
پیر مردی هر روز تو محله می دید پسر کی با کفش های پاره و پای برهنه با توپ پلاستیکی فوتبال بازی می کند، روزی رفت ی کتانی نو خرید و اومد و به پسرک گفت بیا این کفشا رو بپوشپسرک کفشا رو پوشید و خوشحال رو به پیر مرد کرد و گفت: شما خدایید؟! پیر مرد لبش را گزید و گفت نه! پسرک گفت پس دوست خدایی، چون من دیشب فقط به خدا گفتم كه کفش ندارم پیر مردی هر روز تو محله می دید پسر کی با کفش های پاره و پای برهنه با توپ پلاستیکی فوتبال بازی می کند، روزی رفت ی کتانی نو خرید و اومد و به پسرک گفت بیا این کفشا رو بپوشپسرک کفشا رو پوشید و خوشحال رو به پیر مرد کرد و گفت: شما خدایید؟! پیر مرد لبش را گزید و گفت نه! پسرک گفت پس دوست خدایی، چون من دیشب فقط به خدا گفتم كه کفش ندارم
هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس میزند... در نهایت این مرگ است که باید پیروز شود، زیرا از هنگام تولد بخشی از سرنوشت ما شده و فقط مدت کوتاهی پیش از بلعیدن طعمه اش، با آن بازی می کند. با این همه، ما تا آنجا که ممکن است، با علاقه فراوان و دلواپسی زیاد به زندگی ادامه می دهیم، همان طور که تا آنجا که ممکن است طولانی تر در یک حباب صابون می دمیم تا بزرگتر شود، گر چه با قطعیتی تمام می دانیم که خواهد ترکید. هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس میزند... در نهایت این مرگ است که باید پیروز شود، زیرا از هنگام تولد بخشی از سرنوشت ما شده و فقط مدت کوتاهی پیش از بلعیدن طعمه اش، با آن بازی می کند. با این همه، ما تا آنجا که ممکن است، با علاقه فراوان و دلواپسی زیاد به زندگی ادامه می دهیم، همان طور که تا آنجا که ممکن است طولانی تر در یک حباب صابون می دمیم تا بزرگتر شود، گر چه با قطعیتی تمام می دانیم که خواهد ترکید.
@ -563,14 +753,19 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
</div> </div>
<div className="flex items-start text-xs py-6"> <div className="flex items-start text-xs py-6">
<Checkbox name="TAEED_REGISTER_MOBILE" /> <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"> <label className="mr-4 font-bold text-gray-500">
اینجانبان اینجانبان
<span className="text-red52 font-bold"> {userInfo.fatherName} {userInfo.fatherFamilyName} </span> <span className="text-red52 font-bold"> {userInfo.fatherInfo.firstName} {userInfo.fatherInfo.lastName} </span>
و و
<span className="text-red52 font-bold"> {userInfo.motherName} {userInfo.motherFamilyName} </span> <span className="text-red52 font-bold"> {userInfo.motherInfo.firstName} {userInfo.motherInfo.lastName} </span>
سرپرست های دانش آموز سرپرست های دانش آموز
<span className="text-red52 font-bold"> {userInfo.name} {userInfo.familyName} </span> <span className="text-red52 font-bold"> {userInfo.firstName} {userInfo.lastName} </span>
با قوانین و مقررات موافقت نموده و تمامی موارد به عهده اینجانب میباشد با قوانین و مقررات موافقت نموده و تمامی موارد به عهده اینجانب میباشد
</label> </label>
</div> </div>
@ -606,7 +801,7 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<div className="flex flex-col border-b border-solid border-gray-300 leading-7 pb-6"> <div className="flex flex-col border-b border-solid border-gray-300 leading-7 pb-6">
<h1 className="font-bold mb-2 text-lg">مشخصات دانش آموز</h1> <h1 className="font-bold mb-2 text-lg">مشخصات دانش آموز</h1>
{ {
finalViewInfo.slice(0,8).map(item => ( finalViewInfo.slice(0, 8).map(item => (
<div className="flex items-center"> <div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p> <h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div> </div>
@ -616,7 +811,7 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<div className="flex flex-col border-b border-solid border-gray-300 leading-7 py-6"> <div className="flex flex-col border-b border-solid border-gray-300 leading-7 py-6">
<h1 className="font-bold mb-2 text-lg">مشخصات پدر دانش آموز</h1> <h1 className="font-bold mb-2 text-lg">مشخصات پدر دانش آموز</h1>
{ {
finalViewInfo.slice(8,16).map(item => ( finalViewInfo.slice(8, 16).map(item => (
<div className="flex items-center"> <div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p> <h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div> </div>
@ -626,7 +821,7 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<div className="flex flex-col border-b border-solid border-gray-300 leading-7 py-6"> <div className="flex flex-col border-b border-solid border-gray-300 leading-7 py-6">
<h1 className="font-bold mb-2 text-lg">مشخصات مادر دانش آموز</h1> <h1 className="font-bold mb-2 text-lg">مشخصات مادر دانش آموز</h1>
{ {
finalViewInfo.slice(16,24).map(item => ( finalViewInfo.slice(16, 24).map(item => (
<div className="flex items-center"> <div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p> <h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div> </div>
@ -636,7 +831,7 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<div className="flex flex-col border-b border-solid border-gray-300 leading-7 py-6"> <div className="flex flex-col border-b border-solid border-gray-300 leading-7 py-6">
<h1 className="font-bold mb-2 text-lg">مشخصات خانواده دانش آموز</h1> <h1 className="font-bold mb-2 text-lg">مشخصات خانواده دانش آموز</h1>
{ {
finalViewInfo.slice(24,27).map(item => ( finalViewInfo.slice(24, 27).map(item => (
<div className="flex items-center"> <div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p> <h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div> </div>
@ -654,8 +849,8 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
</div> </div>
<div className="w-1/2 mr-2"> <div className="w-1/2 mr-2">
<Button borderType='rounded' title='ورود' to='/' onClick={() => <Button borderType='rounded' title='تایید' to='/' onClick={() =>
activeLogin() setProfile(userInfo)
} /> } />
</div> </div>
</div> </div>
@ -676,7 +871,16 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
}; };
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
isMobile: state.publicApi.isMobile, isMobile: state.publicApi.isMobile,
province: state.publicApi.province,
city: state.publicApi.city,
user: state.user.status,
}) })
const mapDispatchToProps = {
setProfile: user.setProfile,
getProvince: publicApi.getProvince,
getCity: publicApi.getCity,
}
export default connect(mapStateToProps)(MobileRegister); export default connect(mapStateToProps, mapDispatchToProps)(MobileRegister);

@ -34,9 +34,20 @@ const Services = ({
headerOptions, headerOptions,
videos, videos,
pushToCart, pushToCart,
pushSchoolToCart
}) => { }) => {
const [filterCheck, setFilterCheck] = useState(null); const [filterCheck, setFilterCheck] = useState([
{
id:1,
title: 'حضوری',
},
{
id:2,
title: 'آنلاین',
},
]);
const [selectedFilters, setSelectedFilters] = useState([])
const [filter, setFilter] = useState({ const [filter, setFilter] = useState({
search: "", search: "",
grade: "", grade: "",
@ -55,6 +66,7 @@ const Services = ({
classMinute: "", classMinute: "",
}); });
const [sharzhVal, setSharzhVal] = useState(''); const [sharzhVal, setSharzhVal] = useState('');
const [selectedProductTypes, setSelectedProductTypes] = useState([1]);
// const onChange = (name, value) => { // const onChange = (name, value) => {
// setFilter({ ...filter, [name]: value }); // setFilter({ ...filter, [name]: value });
// }; // };
@ -105,7 +117,9 @@ const Services = ({
const [gameId, setGameId] = useState(1); const [gameId, setGameId] = useState(1);
const chooseGame = (id) => { const chooseGame = (id) => {
setGameId(id); setGameId(id);
console.log(selectedProductTypes)
}; };
console.log(gameId)
if (!isMobile) { if (!isMobile) {
return ( return (
<div <div
@ -160,6 +174,7 @@ const Services = ({
selectedGames={selectedGames} selectedGames={selectedGames}
gameId={gameId} gameId={gameId}
chooseGame={chooseGame} chooseGame={chooseGame}
setTypes={val => setSelectedProductTypes(val)}
/> />
</div> </div>
{/* filters */} {/* filters */}
@ -223,19 +238,26 @@ const Services = ({
</svg> </svg>
</div> </div>
<div className="flex items-center mx-6 pl-6 border-l-2 border-gray-300"> <div className="flex items-center mx-6 pl-6 border-l-2 border-gray-300">
{
filterCheck.map((filter) => (
<div <div
key={`FILTER_${filter.id}`}
className={`flex w-32 border-2 p-2 px-4 mx-2 justify-center items-center rounded-md cursor-pointer className={`flex w-32 border-2 p-2 px-4 mx-2 justify-center items-center rounded-md cursor-pointer
hover:border-red52 hover:text-red52 hover:bg-pinkF5 hover:border-red52 hover:text-red52 hover:bg-pinkF5
${filterCheck == 'Online' ${selectedFilters.includes(filter.id)
? "border-red52 text-red52 bg-pinkF5" ? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400" : "border-gray200 text-gray-400"
}`} }`}
onClick={(prevState) => onClick={(prevState) =>{
setFilterCheck('Online') if(selectedFilters.includes(filter.id)){
setSelectedFilters(selectedFilters.filter(itm => itm !== filter.id))
}else{
setSelectedFilters([...selectedFilters, filter.id])
} }
}}
> >
<h3>آنلاین</h3> <h3>{filter.title}</h3>
{filterCheck == 'Online' && ( {selectedFilters.includes(filter.id) && (
<div className="flex w-full" style={{ direction: "ltr" }}> <div className="flex w-full" style={{ direction: "ltr" }}>
<div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52"> <div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52">
<svg <svg
@ -259,7 +281,9 @@ const Services = ({
)} )}
</div> </div>
<div ))
}
{/* <div
className={`flex w-32 border-2 p-2 mx-2 px-4 justify-center items-center rounded-md cursor-pointer className={`flex w-32 border-2 p-2 mx-2 px-4 justify-center items-center rounded-md cursor-pointer
hover:border-red52 hover:text-red52 hover:bg-pinkF5 hover:border-red52 hover:text-red52 hover:bg-pinkF5
${filterCheck == 'Physical' ${filterCheck == 'Physical'
@ -294,12 +318,12 @@ const Services = ({
)} )}
</div> </div> */}
</div> </div>
<div className="flex items-center mx-4 pl-6"> <div className="flex items-center mx-4 pl-6">
<select className="bg-white border border-solid border-gray-300 w-72 p-3 rounded-lg text-gray-400 outline-red52"> <select className="bg-white border-2 border-solid border-gray-300 w-72 p-3 rounded-lg text-gray-400 outline-red52">
{services.map((item, index) => ( {services.map((item, index) => (
<option key={`Grade__${index}`}>{item.title}</option> <option key={`Grade__${index}`}>{item.title}</option>
))} ))}
@ -309,9 +333,9 @@ const Services = ({
<div <div
className={`flex className={`flex
} items-center w-full justify-center overflow-x-hidden overflow-scroll flex-wrap h-full `} } w-full justify-center overflow-x-hidden overflow-scroll flex-wrap h-full `}
> >
{books?.map((product, index) => ( { books?.filter(itm => selectedProductTypes.includes(itm.productType)).map((product, index) => (
<div <div
// to={"/class/" + product?.id} // to={"/class/" + product?.id}
@ -327,7 +351,7 @@ const Services = ({
index={Number(index)} index={Number(index)}
productName={`${product?.name}`} productName={`${product?.name}`}
productCat={`پایه ${grades[product?.gradeId]}`} productCat={`پایه ${grades[product?.gradeId]}`}
productPrice={separate(product?.product[0]?.price)} productPrice={separate(product?.price)}
// productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds} // productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
numberOfRegards={160} numberOfRegards={160}
productHolderBorder="" productHolderBorder=""
@ -342,7 +366,7 @@ const Services = ({
teacher: product?.vodTeacher, teacher: product?.vodTeacher,
description: description:
"در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت", "در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت",
price: gameId == 3 ? 0 : product?.product[0]?.price, price: gameId == 2 ? 0 : product?.price,
classHour: 21, classHour: 21,
classMinute: 56, classMinute: 56,
image: 'https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg', image: 'https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg',
@ -370,20 +394,31 @@ const Services = ({
}, },
] ]
}); });
if (gameId !== 2) { if (gameId !== 5) {
setPopUp(true) setPopUp(true)
} }
console.log(gameId) console.log(gameId)
}} }}
btnOnClick={() => { btnOnClick={() => {
if(selectedProductTypes.includes(7)){
pushSchoolToCart({
productId: product?.id,
count: 1,
})
}
else{
pushToCart({ pushToCart({
productId: product?.id, productId: product?.id,
count: 1, count: 1,
}); });
}
// console.log(gameId)
setTimeout(() => setPopUp(false), 0) setTimeout(() => setPopUp(false), 0)
console.log(popup) // console.log(popup)
console.log(product.id) // console.log(product.id)
} }
} }
/> />
@ -391,13 +426,13 @@ const Services = ({
))} ))}
{ {
gameId == 6 && gameId == 6 &&
<div className="w-3/4 p-8 py-10 flex mt-10 justify-between text-right items-center border-2 rounded-xl border-red52 " > <div className="w-4/5 px-8 h-48 flex justify-between text-right items-center border-2 rounded-xl border-red52 " >
<div className="w-1/5"> <div className="w-1/5 mx-1">
<h1 className="text-red26 font-bold">افزایش مبلغ دلخواه</h1> <h1 className="text-red26 font-bold">افزایش مبلغ دلخواه</h1>
<p className="text-red26 text-sm">لطفا مبلغ دلخواه خود را در کادر روبرو وارد کنید</p> <p className="text-red26 text-sm">لطفا مبلغ دلخواه خود را در کادر روبرو وارد کنید</p>
</div> </div>
<div className="flex"> <div className="flex mx-1">
<input <input
placeholder="12,000,000" placeholder="12,000,000"
className="border border-red52 rounded-lg h-12 w-36 text-center rounded-l-none border-l-0 px-4 outline-none" className="border border-red52 rounded-lg h-12 w-36 text-center rounded-l-none border-l-0 px-4 outline-none"
@ -405,7 +440,7 @@ const Services = ({
onChange={e => setSharzhVal(e.target.value)} onChange={e => setSharzhVal(e.target.value)}
/><p className="border flex justify-center items-center border-red52 rounded-lg h-12 w-12 text-center rounded-r-none border-r-0 px-4">ریال</p> /><p className="border flex justify-center items-center border-red52 rounded-lg h-12 w-12 text-center rounded-r-none border-r-0 px-4">ریال</p>
</div> </div>
<div className="flex"> <div className="flex mx-1">
<p className="border flex justify-center items-center border-red52 rounded-lg h-12 w-12 text-center rounded-l-none border-l-0 px-6 pl-2 ">بابت</p> <p className="border flex justify-center items-center border-red52 rounded-lg h-12 w-12 text-center rounded-l-none border-l-0 px-6 pl-2 ">بابت</p>
<input <input
placeholder="شارژ حساب" placeholder="شارژ حساب"
@ -413,7 +448,7 @@ const Services = ({
/> />
</div> </div>
<button className="cursor-pointer text-red26 border border-red52 rounded-lg bg-red82OP font-bold text-sm px-6 h-12">افزودن به اعتبار</button> <button className="cursor-pointer text-red26 border border-red52 rounded-lg bg-red82OP font-bold text-sm px-6 h-12 mx-2">افزودن به اعتبار</button>
</div> </div>
} }
@ -434,6 +469,7 @@ const Services = ({
selectedGames={selectedGames} selectedGames={selectedGames}
gameId={gameId} gameId={gameId}
chooseGame={chooseGame} chooseGame={chooseGame}
setTypes={val => setSelectedProductTypes(val)}
/> />
<div className="w-11/12 border-b border-gray-200"></div> <div className="w-11/12 border-b border-gray-200"></div>
@ -495,19 +531,26 @@ const Services = ({
</g> </g>
</g> </g>
</svg> </svg>
{
filterCheck.map((filter) => (
<div <div
className={`flex w-32 border-2 p-2 mx-2 justify-center items-center rounded-md cursor-pointer key={`FILTER_${filter.id}`}
className={`flex w-32 border-2 p-2 px-4 mx-2 justify-center items-center rounded-md cursor-pointer
hover:border-red52 hover:text-red52 hover:bg-pinkF5 hover:border-red52 hover:text-red52 hover:bg-pinkF5
${filterCheck == 'Online' ${selectedFilters.includes(filter.id)
? "border-red52 text-red52 bg-pinkF5" ? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400" : "border-gray200 text-gray-400"
}`} }`}
onClick={(prevState) => onClick={(prevState) =>{
setFilterCheck('Online') if(selectedFilters.includes(filter.id)){
setSelectedFilters(selectedFilters.filter(itm => itm !== filter.id))
}else{
setSelectedFilters([...selectedFilters, filter.id])
} }
}}
> >
<h3>آنلاین</h3> <h3>{filter.title}</h3>
{filterCheck == 'Online' && ( {selectedFilters.includes(filter.id) && (
<div className="flex w-full" style={{ direction: "ltr" }}> <div className="flex w-full" style={{ direction: "ltr" }}>
<div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52"> <div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52">
<svg <svg
@ -531,42 +574,8 @@ const Services = ({
)} )}
</div> </div>
<div ))
className={`flex w-32 border-2 p-2 mx-2 justify-center items-center rounded-md cursor-pointer
hover:border-red52 hover:text-red52 hover:bg-pinkF5
${filterCheck == 'offLine'
? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400"
}`}
onClick={(prevState) =>
setFilterCheck('offLine')
} }
>
<h3>حضوری</h3>
{filterCheck == 'offLine' && (
<div className="flex w-full" style={{ direction: "ltr" }}>
<div className="w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52">
<svg
width="37"
height="37"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.75 12L10.58 14.83L16.25 9.17004"
stroke="#fff"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
</div>
</div>
)}
</div>
</div> </div>
} }
<div className="w-11/12 border-b border-gray-200"></div> <div className="w-11/12 border-b border-gray-200"></div>
@ -574,20 +583,38 @@ const Services = ({
<div <div
className={`flex items-center w-full justify-center flex-col `} className={`flex items-center w-full justify-center flex-col `}
> >
{books?.map((product, index) => ( { books?.filter(itm => selectedProductTypes.includes(itm.productType)).map((product, index) => (
<Link <div
// to={"/class/" + product?.id} // to={"/class/" + product?.id}
to="#"
key={`PRODUCT__${gameId}__${index}`} key={`PRODUCT__${gameId}__${index}`}
>
{/* {console.log(product)} */}
<Product
key={index}
productsType={filter.productsType}
product={product}
index={Number(index)}
productName={`${product?.name}`}
productCat={`پایه ${grades[product?.gradeId]}`}
productPrice={separate(product?.price)}
// productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
numberOfRegards={160}
productHolderBorder=""
productHolderHoverBorder="shadow-md"
teacher={product.vodTeacher}
catId={gameId}
onClick={() => { onClick={() => {
setPopUpContent({ setPopUpContent({
id: gameId, id: gameId,
title: product?.name, title: product?.name,
video: "", video: "",
teacher: product.vodTeacher, teacher: product?.vodTeacher,
description: description:
"در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت", "در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت",
price: product.product[0].price, price: gameId == 2 ? 0 : product?.price,
classHour: 21, classHour: 21,
classMinute: 56, classMinute: 56,
image: 'https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg', image: 'https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg',
@ -615,36 +642,35 @@ const Services = ({
}, },
] ]
}); });
setPopUp(true); if (gameId !== 5) {
// console.log(gameId) setPopUp(true)
}
console.log(gameId)
}} }}
> btnOnClick={() => {
{console.log(product)}
<Product if(selectedProductTypes.includes(7)){
key={index} pushSchoolToCart({
productsType={filter.productsType}
product={product}
index={Number(index)}
productName={`${product?.name}`}
productCat={`پایه ${grades[product?.gradeId]}`}
productPrice={separate(product?.product[0]?.price)}
// productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
numberOfRegards={160}
productHolderBorder=""
productHolderHoverBorder="shadow-md"
teacher={product.vodTeacher}
catId={gameId}
btnOnClick={() =>
pushToCart({
productId: product?.id, productId: product?.id,
// userId: product?.userId,
count: 1, count: 1,
}) })
}
else{
pushToCart({
productId: product?.id,
count: 1,
});
}
// console.log(gameId)
setTimeout(() => setPopUp(false), 0)
// console.log(popup)
// console.log(product.id)
}
} }
/> />
</Link> </div>
))} ))}
{ {
gameId == 6 && gameId == 6 &&
@ -699,6 +725,7 @@ const mapDispatchToProps = {
gradeFilter: book.gradeFilter, gradeFilter: book.gradeFilter,
setHeaderOptions: publicApi.setHeaderOptions, setHeaderOptions: publicApi.setHeaderOptions,
pushToCart: userProduct.add, pushToCart: userProduct.add,
pushSchoolToCart: userProduct.addSchool,
}; };
export default connect(mapStateToProps, mapDispatchToProps)(Services); export default connect(mapStateToProps, mapDispatchToProps)(Services);

@ -24,10 +24,10 @@ const servicePopUp = ({
</div> </div>
</div> </div>
<div className={`flex justify-${content.id === 3 ? 'center' : 'between'} mb-20`} style={{direction: content.id === 1 ? 'rtl' : 'ltr'}} > <div className={`flex justify-${content.id === 3 ? 'center' : 'between'} mb-20`} style={{direction: content.id === 1 ? 'rtl' : 'ltr'}} >
{ content.id !== 3 && <div className={`${content.id === 1 ? 'w-1/2' : content.id === 4 ? 'w-2/3' : 'w-full'} my-4 mx-2 p-2`}> { content.id !== 2 && <div className={`${content.id === 4 ? 'w-1/2' : content.id === 1 ? 'w-2/3' : 'w-full'} my-4 mx-2 p-2`}>
<h1 className="text-red25 font-black text-md"> <h1 className="text-red25 font-black text-md">
{content.id === 1 ? 'کلاس آنلاین ' : content.id === 4 ? 'کتاب ' : null} {content.id === 4 ? 'کلاس آنلاین ' : content.id === 1 ? 'کتاب ' : null}
{content.title}</h1> {content.title}</h1>
<p className="text-red26 text-sm my-2"> <p className="text-red26 text-sm my-2">
@ -54,7 +54,7 @@ const servicePopUp = ({
</div>} </div>}
{ {
content.id === 3 && content.id === 2 &&
<div className="flex w-11/12 flex-col rounded-xl border border-red82OP"> <div className="flex w-11/12 flex-col rounded-xl border border-red82OP">
<h1 className="px-2 py-6 border-b border-red82OP bg-blueFF rounded-t-xl pr-10 text-blueE3 text-xl font-bold">آزمون {content.title}</h1> <h1 className="px-2 py-6 border-b border-red82OP bg-blueFF rounded-t-xl pr-10 text-blueE3 text-xl font-bold">آزمون {content.title}</h1>
<div className="flex w-full border-b border-red82OP text-red26 text-sm font-bold" style={{direction : 'rtl'}}> <div className="flex w-full border-b border-red82OP text-red26 text-sm font-bold" style={{direction : 'rtl'}}>
@ -89,7 +89,7 @@ const servicePopUp = ({
</div> </div>
} }
{content.id === 1 && <video className="w-1/2 rounded-md" controls> {content.id === 3 && <video className="w-1/2 rounded-md" controls>
<source <source
src={`https://dnvn.ir/api/v1/file/20540`} src={`https://dnvn.ir/api/v1/file/20540`}
type="video/mp4" type="video/mp4"
@ -97,7 +97,7 @@ const servicePopUp = ({
</video>} </video>}
{ {
content.id === 4 && <img src={content.image} className="w-1/3 rounded-md mt-4" alt="Content"/> content.id === 1 && <img src={content.image} className="w-1/3 rounded-md mt-4" alt="Content"/>
} }
</div> </div>
<div className="flex w-full items-center justify-start mb-8" style={{direction: 'ltr'}}> <div className="flex w-full items-center justify-start mb-8" style={{direction: 'ltr'}}>

@ -1412,6 +1412,11 @@
"schema-utils" "^3.0.0" "schema-utils" "^3.0.0"
"source-map" "^0.7.3" "source-map" "^0.7.3"
"@react-leaflet/core@^1.1.1":
"integrity" "sha512-7PGLWa9MZ5x/cWy8EH2VzI4T8q5WpuHbixzCDXqixP/WyqwIrg5NDUPgYuFnB4IEIZF+6nA265mYzswFo/h1Pw=="
"resolved" "https://registry.npmjs.org/@react-leaflet/core/-/core-1.1.1.tgz"
"version" "1.1.1"
"@react-pdf-viewer/core@^3.1.2": "@react-pdf-viewer/core@^3.1.2":
"integrity" "sha512-tctjW98NjIN/BaZO42r0ZPx63H41EubU/n+E9nS1zS/3K/xrILQU5s+UP0WqEYoBFNs/mMI7pTJWsxV4WUhdDg==" "integrity" "sha512-tctjW98NjIN/BaZO42r0ZPx63H41EubU/n+E9nS1zS/3K/xrILQU5s+UP0WqEYoBFNs/mMI7pTJWsxV4WUhdDg=="
"resolved" "https://registry.npmjs.org/@react-pdf-viewer/core/-/core-3.1.2.tgz" "resolved" "https://registry.npmjs.org/@react-pdf-viewer/core/-/core-3.1.2.tgz"
@ -6106,6 +6111,11 @@
dependencies: dependencies:
"language-subtag-registry" "~0.3.2" "language-subtag-registry" "~0.3.2"
"leaflet@^1.7.1":
"integrity" "sha512-/xwPEBidtg69Q3HlqPdU3DnrXQOvQU/CCHA1tcDQVzOwm91YMYaILjNp7L4Eaw5Z4sOYdbBz6koWyibppd8Zqw=="
"resolved" "https://registry.npmjs.org/leaflet/-/leaflet-1.7.1.tgz"
"version" "1.7.1"
"leven@^3.1.0": "leven@^3.1.0":
"integrity" "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==" "integrity" "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A=="
"resolved" "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz" "resolved" "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz"
@ -7732,7 +7742,7 @@
"strip-ansi" "^6.0.1" "strip-ansi" "^6.0.1"
"text-table" "^0.2.0" "text-table" "^0.2.0"
"react-dom@*", "react-dom@^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0", "react-dom@^15.0.0 || ^16.0.0 || ^17.0.0", "react-dom@^16.11.0", "react-dom@^16.8.0 || ^17.0.0", "react-dom@^16.8.5 || ^17.0.0", "react-dom@^17.0.2", "react-dom@>=0.14.0", "react-dom@>=16", "react-dom@>=16.8", "react-dom@>=16.8.0", "react-dom@0.13.x || 0.14.x || ^15.0.0-0 || 15.x.x || ^16.0.0-0 || ^16.x.x || ^17.x.x": "react-dom@*", "react-dom@^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0", "react-dom@^15.0.0 || ^16.0.0 || ^17.0.0", "react-dom@^16.11.0", "react-dom@^16.8.0 || ^17.0.0", "react-dom@^16.8.5 || ^17.0.0", "react-dom@^17.0.1", "react-dom@^17.0.2", "react-dom@>=0.14.0", "react-dom@>=16", "react-dom@>=16.8", "react-dom@>=16.8.0", "react-dom@0.13.x || 0.14.x || ^15.0.0-0 || 15.x.x || ^16.0.0-0 || ^16.x.x || ^17.x.x":
"integrity" "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==" "integrity" "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA=="
"resolved" "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz" "resolved" "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz"
"version" "17.0.2" "version" "17.0.2"
@ -7800,6 +7810,13 @@
"resolved" "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz" "resolved" "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz"
"version" "17.0.2" "version" "17.0.2"
"react-leaflet@^3.2.5":
"integrity" "sha512-Z3KZ+4SijsRbbrt2I1a3ZDY6+V6Pm91eYTdxTN18G6IOkFRsJo1BuSPLFnyFrlF3WDjQFPEcTPkEgD1VEeAoBg=="
"resolved" "https://registry.npmjs.org/react-leaflet/-/react-leaflet-3.2.5.tgz"
"version" "3.2.5"
dependencies:
"@react-leaflet/core" "^1.1.1"
"react-mapbox-gl-draw@^2.0.4": "react-mapbox-gl-draw@^2.0.4":
"integrity" "sha512-oaBdIlyu+g7PhLUvwnCsl/wvu+5tGB9I3RLjcrYLt6U1sUMzQJqplKtVxXRv9TZqRdNaAU5qNOP+dRs55QKjsA==" "integrity" "sha512-oaBdIlyu+g7PhLUvwnCsl/wvu+5tGB9I3RLjcrYLt6U1sUMzQJqplKtVxXRv9TZqRdNaAU5qNOP+dRs55QKjsA=="
"resolved" "https://registry.npmjs.org/react-mapbox-gl-draw/-/react-mapbox-gl-draw-2.0.4.tgz" "resolved" "https://registry.npmjs.org/react-mapbox-gl-draw/-/react-mapbox-gl-draw-2.0.4.tgz"
@ -7937,7 +7954,7 @@
dependencies: dependencies:
"clsx" "^1.1.1" "clsx" "^1.1.1"
"react@*", "react@^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0", "react@^15.0.0 || ^16.0.0 || ^17.0.0", "react@^16.11.0", "react@^16.8.0 || ^17.0.0", "react@^16.8.3 || ^17", "react@^16.8.5 || ^17.0.0", "react@^17.0.2", "react@>= 16", "react@>= 16.8", "react@>=0.14.0", "react@>=16", "react@>=16.8", "react@>=16.8.0", "react@0.13.x || 0.14.x || ^15.0.0-0 || 15.x.x || ^16.0.0-0 || ^16.x.x || ^17.x.x", "react@17.0.2": "react@*", "react@^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0", "react@^15.0.0 || ^16.0.0 || ^17.0.0", "react@^16.11.0", "react@^16.8.0 || ^17.0.0", "react@^16.8.3 || ^17", "react@^16.8.5 || ^17.0.0", "react@^17.0.1", "react@^17.0.2", "react@>= 16", "react@>= 16.8", "react@>=0.14.0", "react@>=16", "react@>=16.8", "react@>=16.8.0", "react@0.13.x || 0.14.x || ^15.0.0-0 || 15.x.x || ^16.0.0-0 || ^16.x.x || ^17.x.x", "react@17.0.2":
"integrity" "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==" "integrity" "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA=="
"resolved" "https://registry.npmjs.org/react/-/react-17.0.2.tgz" "resolved" "https://registry.npmjs.org/react/-/react-17.0.2.tgz"
"version" "17.0.2" "version" "17.0.2"

Loading…
Cancel
Save