Faze 1 Final Changes

main
Pedram Keshavarzi 3 years ago
parent 19f0edea4e
commit af611f97a8
  1. 49
      package-lock.json
  2. 2
      package.json
  3. 36
      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. 324
      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. 42
      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. 30
      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. 278
      src/view/contact/index.js
  40. 42
      src/view/dashboard2/Games.js
  41. 574
      src/view/register/index.js
  42. 730
      src/view/register/mobile/index.js
  43. 369
      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",
"jalaali-js": "^1.2.3",
"jalali-moment": "^3.3.10",
"leaflet": "^1.7.1",
"lord-icon-element": "^3.3.3",
"lottie-web": "^5.8.1",
"mapir-react-component": "^2.0.1",
@ -28,6 +29,7 @@
"react-dropzone": "^11.4.2",
"react-icons": "^4.3.1",
"react-indiana-drag-scroll": "^2.1.0",
"react-leaflet": "^3.2.5",
"react-multi-date-picker": "^3.3.0",
"react-redux": "^7.2.6",
"react-router-dom": "^6.2.1",
@ -2833,6 +2835,16 @@
"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": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@react-pdf-viewer/core/-/core-3.1.2.tgz",
@ -11403,6 +11415,11 @@
"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": {
"version": "3.1.0",
"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",
"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": {
"version": "4.8.6",
"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": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@react-pdf-viewer/core/-/core-3.1.2.tgz",
@ -25844,6 +25880,11 @@
"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": {
"version": "3.1.0",
"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",
"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": {
"version": "4.8.6",
"resolved": "https://registry.npmjs.org/react-mapbox-gl/-/react-mapbox-gl-4.8.6.tgz",

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

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

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -75,7 +75,7 @@ const ProductDesign = ({
]
if (catId == 1) {
if (catId == 3) {
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'}`}
style={{ width: !isMobile && '375px' , direction: 'rtl' }}
@ -119,7 +119,7 @@ const ProductDesign = ({
)
}
if (catId == 2) {
if (catId == 5) {
return (
<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%' }}>
@ -188,7 +188,7 @@ const ProductDesign = ({
</div>
)
}
if(catId == 3){
if(catId == 2){
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'}`}
style={{ width: !isMobile && '375px', direction: 'rtl' }}
@ -247,7 +247,7 @@ const ProductDesign = ({
)
}
if(catId == 4){
if(catId == 1){
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'}`}
style={{ width: !isMobile && '375px', direction: 'rtl' }}

@ -1,23 +1,26 @@
import React, {useState} from "react";
import { connect } from "react-redux";
import { userFactor } from "../../../redux/actions";
import _onInput from "../../../utils/onInput";
function Code({ codeId, setCodeId, userId, factorId }) {
const [value, setValue] = React.useState(codeId || "");
const [value, setValue] = useState(codeId || "");
const setOff = () => {
setCodeId({ offCodeValue: value, userId: userId, id: factorId });
}
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
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={"کد تخفیف دارید ؟"}
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>
</form>
<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>
</div>
);
}

@ -6,8 +6,9 @@ import { userProduct } from "../../../redux/actions";
// import bookImage from "../../../assets/images/zist-11.svg";
import exitIcon from "../../../assets/img/exit.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 ? (
// <div className="flex flex-row justify-between py-5 border-b border-solid border-grayDB dark:border-gray45">
// <div className="flex flex-row">
@ -146,10 +147,10 @@ function Product({ product, grades, pushToCart, isMobile }) {
// </div>
// </div>
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="text-sm h-10 flex items-center p-2 border-l-2 border-gray-300 text-gray-400"> {product?.product?.book?.category} </div>
<h1 className="text-lg font-black px-2 text-black40"> {product?.product?.book?.name}</h1>
<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-sm font-black px-2 text-black40"> {product?.product?.name}</h1>
</div>
<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>
}
<p>{product?.product?.price} تومان</p>
<p>{separate(product?.product?.price)} تومان</p>
</div>
<div
@ -168,7 +169,7 @@ function Product({ product, grades, pushToCart, isMobile }) {
{
productId: product?.productId,
userId: product?.userId,
count: -product?.count,
count: product?.count == 1 ? -product?.count : -1,
},
{},
{ id: product?.factorId }
@ -205,6 +206,7 @@ function Product({ product, grades, pushToCart, isMobile }) {
const mapStateToProps = (state) => ({
grades: state.publicApi.grades,
isMobile: state.publicApi.isMobile,
productTypes: state.publicApi.productTypes
});
const mapDispatchToProps = {

@ -10,6 +10,7 @@ import Button from "../../components/Button";
import alertIcon from "../../assets/img/alert.svg";
import { connect } from "react-redux";
import separate from "../../utils/separate";
function ShoppingCart({
isDark,
@ -25,206 +26,81 @@ function ShoppingCart({
payFactor,
headerOptions,
setHeaderOptions,
schoolList,
desktopContentTransform,
pushToCart,
pushSchoolToCart
}) {
const [phase, setPhase] = useState("products");
useEffect(() => {
getList();
getFactorInfo({ userId });
getFactorInfo({userId});
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 ?
<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%'}}>
{
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) => (
<Product key={index} product={product} />
))}
@ -248,7 +124,7 @@ function ShoppingCart({
</div>
</div>
<Button
title={`پرداخت هزینه : ${factorInfo?.payPrice} تومان`}
title={`پرداخت هزینه : ${factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0} تومان`}
borderType='rounded-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={`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) => (
<Product key={index} product={product} />
))}
@ -284,9 +223,9 @@ function ShoppingCart({
</div>
</div>
<Button
title={`پرداخت هزینه : ${factorInfo?.payPrice} تومان`}
title={`پرداخت هزینه : ${factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0} تومان`}
borderType='rounded-xl'
className='h-16 text-xl'
className='h-16 text-xl xl:text-sm'
/>
</div>
@ -298,6 +237,7 @@ const mapStateToProps = (state) => ({
isDark: state.publicApi.isDark,
isMobile: state.publicApi.isMobile,
list: state.userProduct.list,
schoolList: state.userProduct.schoolList,
payPrice: state.userProduct.sum,
factorInfo: state.userFactor.info,
userId: state.user.status.id,
@ -311,6 +251,8 @@ const mapDispatchToProps = {
getFactorInfo: userFactor.info,
payFactor: userFactor.payment,
setHeaderOptions: publicApi.setHeaderOptions,
pushToCart: userProduct.add,
pushSchoolToCart: userProduct.addSchool,
};
export default connect(mapStateToProps, mapDispatchToProps)(ShoppingCart);

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

@ -10,10 +10,10 @@ import moment from "jalali-moment";
import { state } from "./state";
import ScrollContainer from "react-indiana-drag-scroll";
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----------------------------------------------------
let d = new Date();
@ -126,6 +126,7 @@ const MyExamList = ({isMobile}) => {
useEffect(() => {
// console.log("render---------------");
listExams();
if(!isMobile){
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">
{data.map((item, i) => (
<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}
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)}
@ -493,7 +494,7 @@ const mapStateToProps = (state) => ({
});
const mapDispatchToProps = {
listExams: product.listExams,
setHeaderOptions: publicApi.setHeaderOptions,
};

@ -4,7 +4,8 @@ import { useState, useEffect } from "react";
const FileInput = ({
title,
id
id,
mobile
}) => {
const [focus, setFocus] = useState('border-gray-300 border-dotted');
@ -34,8 +35,13 @@ const FileInput = ({
setSelectedImage(files[0]);
}
};
useEffect(() => {
if(mobile){
setDelete(true)
}
}, [mobile])
return (
<div onDrop={overrideEventDefaults}
<div className={mobile ? "w-full" : `max-w-48 min-w-40 w-52`} onDrop={overrideEventDefaults}
onDragEnter={overrideEventDefaults}
onDragLeave={overrideEventDefaults}
onDragOver={overrideEventDefaults}>
@ -47,7 +53,8 @@ const FileInput = ({
onDragLeave={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 ?
<>
<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" />
</svg>
</div>
<h1 className="text-xl font-bold text-gray-400">{title}</h1>
<p className="text-sm leading-7 text-gray-400">فایل خود را بکشید و اینجا رها کنید</p>
<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" style={{fontSize: '70%'}}>فایل خود را بکشید و اینجا رها کنید</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)}>
<img src={imageUrl} className="rounded-lg h-full" />
{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)}>
<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 max-w-full max-h-32" />
{del && <div className=" top-0 mt-2 relative bg-red-500 w-full h-12 flex items-center justify-center text-white rounded-lg" onClick={() => setSelectedImage(null)}>
<button>حذف</button>
</div>}
</div>

@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import './Header.scss';
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 backIcon from './arrow-left-1.svg';
import profileIcon from './MobileSideMenu/profile-active.svg'
import { user } from '../../redux/actions';
import { grades } from '../../redux/reducers/public';
const Header = ({
isMobile, cart,
logOut
logOut,
setUserStatus,
user
}) => {
let today = moment().locale("fa").format("YYYY/M/D");
console.log("today:");
console.log(today);
let weekday = new Date().getDay();
let weekdayList = ["یکشنبه", "دوشنبه", "سهشنبه", "چهارشنبه", 'پنجشنبه', 'جمعه', "شنبه"];
console.log("weekday:");
console.log(weekday);
// console.log("weekday:");
// console.log(weekday);
const [menuPopup, setMenuPopup] = useState(false);
const [subMenu, setSubMenu] = useState(false);
const location = useLocation();
const navigate = useNavigate();
useEffect(() => {
setUserStatus()
}, [])
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'}`}
@ -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>
</div>
}
@ -97,10 +104,10 @@ const Header = ({
</div>
<div className="header-profile-text-container w-fit text-right ml-4">
<div className="header-profile-text-container-name text-sm">
کوروش زراندوز
{user.displayName ? user.displayName : user?.firstName + ' ' + user?.lastName}
</div>
<div className="header-profile-text-container-role text-xs">
پایه ششم
{grades[user.gradeIds]}
</div>
</div>
@ -121,7 +128,7 @@ const Header = ({
{today}
</span>
<span className="header-date-and-date-text3 text-color4 text-xs">
روز ملی صنعت نفت
{/* روز ملی صنعت نفت */}
</span>
</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='w-full flex'>
<MobileSideMenu logOut={logOut} profilePic={avatar1} users={[
<MobileSideMenu profilePic={avatar1} users={[
{
name: 'کوروش زراندوز',
title: 'پایه ششم'
name: user?.displayName,
title: grades[user.gradeIds]
},
{
name: 'کوروش زراندوز',
@ -175,9 +182,11 @@ const Header = ({
const mapStateToProps = (state) => ({
isMobile: state.publicApi.isMobile,
cart: state.userProduct.list
cart: state.userProduct.list,
user: state.user.status,
});
const mapDispatchToProps = {
setUserStatus: user.setUserStatus
};
export default connect(mapStateToProps, mapDispatchToProps)(Header);

@ -20,6 +20,8 @@ import bookIconActive from './book-1-active.svg';
import smsIconActive from './sms-active.svg';
import mapIconActive from './map-active.svg';
import radarIconActive from './radar-1-active.svg';
import { connect } from "react-redux";
import { user } from "../../../redux/actions";
const MobileSideMenu = ({
profilePic,
@ -89,7 +91,7 @@ const MobileSideMenu = ({
},
]
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">
<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">
@ -129,4 +131,13 @@ const MobileSideMenu = ({
</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 = ({
@ -16,6 +17,13 @@ const Input = ({
max,
onFocus
}) => {
useEffect(() => {
if(value !== null && value !== '' && value !== undefined){
blurHandler(id ? id : 0)
}
}, [value])
const focusHandler = (id) => {
let inputs = document.querySelectorAll(".Login-box-form-item");
@ -36,12 +44,14 @@ const Input = ({
let inputs = document.querySelectorAll(".Login-box-form-item-input");
let label = document.querySelectorAll(".Login-box-form-item-label");
let line = document.querySelectorAll(".Login-box-form-item-line");
if (inputs[id].value === "") {
if (inputs[id]) {
inputsBox[id].style.borderColor = "#EBEBEB";
label[id].style.transform = "translate(0px,0px)";
label[id].style.transform = "translate(-10px,-27px)";
label[id].style.color = "#959595";
line[id].style.backgroundColor = "#EBEBEB";
inputs[id].style.backgroundColor = "#fff";
line[id].style.backgroundColor = "#fff";
}
};
return (
<div style={style} className={`${className} Login-box-form-item w-full h-12 ${borderType ? borderType : 'rounded-lg'} border border-color7 mt-6 relative flex items-center flex-row-reverse`}>
@ -51,11 +61,13 @@ const Input = ({
</div>
<input
type={type ? type : 'text'}
name="Login-box-form-item-input-name"
id={`Login-box-form-item-input-name${id}`}
className={`Login-box-form-item-input w-full h-full px-4 outline-0 rounded-lg text-gray-700 focus:text-red52`}
style={{ direction: direction ? direction : "ltr", backgroundColor: bg }}
onFocus={() => {if(onFocus){onFocus();} focusHandler(id ? id : 0)}}
onBlur={() => blurHandler(id ? id : 0)}
onChange={onChange}

@ -111,7 +111,7 @@ const blurHandler = (id) => {
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(
value,
focusToggle,

@ -8,18 +8,20 @@ import logo from "../../assets/img/logo.png";
import img1 from "../../assets/img/Group 1440.svg";
import { Link, useLocation } from "react-router-dom";
import MinimalNav from "./minimalNav";
import { user } from "../../redux/actions";
// defineLordIconElement(loadAnimation);
// let oldNavItemId = 1;
let location = window.location.pathname;
const Nav = ({
logOut,
isMobile,
isLogin,
logout
}) => {
let locationL = useLocation();
let location = locationL.pathname;
const [type, setType] = useState('default');
const location2 = useLocation();
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"
onClick={() => chaneNav(1)}
>
<div className="w-full flex items-center justify-center" style={{width: '7vw'}}>
<svg
id="vuesax_bold_element-4"
data-name="vuesax/bold/element-4"
@ -240,9 +243,10 @@ useEffect(() => {
/>
</g>
</svg>
</div>
<div
className="nav-menu-container-item-title text-sm"
style={1 === navId ? { color: "#fff" } : { color: "#A5A8AB" }}
className="nav-menu-container-item-title px-2"
style={1 === navId ? { color: "#fff", fontSize: '0.7vw' } : { color: "#A5A8AB", fontSize: '0.7vw' }}
>
منوی اصلی
</div>
@ -253,7 +257,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"
onClick={() => chaneNav(2)}
>
<svg
<div className="flex items-center justify-center" style={{width: '7vw'}}>
<svg
id="empty-wallet"
xmlns="http://www.w3.org/2000/svg"
width="46.091"
@ -314,9 +319,10 @@ useEffect(() => {
opacity="0"
/>
</svg>
</div>
<div
className="nav-menu-container-item-title text-sm"
style={2 === navId ? { color: "#fff" } : { color: "#A5A8AB" }}
className="nav-menu-container-item-title px-2 "
style={2 === navId ? { color: "#fff", fontSize: '0.7vw' } : { color: "#A5A8AB", fontSize: '0.7vw' }}
>
انتخاب خدمات
</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"
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">
<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-3" data-name="Vector" d="M0,0H46.091V46.091H0Z" fill="none" opacity="0" />
</g>
</svg>
</div>
<div
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>
@ -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"
onClick={() => chaneNav(4)}
>
<svg
<div className="flex items-center justify-center" style={{width: '7vw'}}>
<svg
id="vuesax_linear_sms"
data-name="vuesax/linear/sms"
xmlns="http://www.w3.org/2000/svg"
@ -395,9 +404,11 @@ useEffect(() => {
/>
</g>
</svg>
</div>
<div
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>
@ -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"
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)">
<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" />
@ -425,7 +436,7 @@ useEffect(() => {
<div
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>
@ -436,7 +447,7 @@ useEffect(() => {
<Link
to="/"
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
id="vuesax_linear_logout"
@ -492,7 +503,7 @@ useEffect(() => {
</svg>
<div
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>
@ -521,6 +532,7 @@ const mapStateToProps = (state) => ({
});
const mapDispatchToProps = {
logout: user.logout,
};
export default connect(mapStateToProps, mapDispatchToProps)(Nav);

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

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

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

@ -58,6 +58,13 @@ const user = {
await proxy.delete("user/delete", data);
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;

@ -1,9 +1,10 @@
import proxy from "../proxy";
const userProduct = {
list:
(data = {}) =>
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.get("userProduct/list", data, { dispatch });
await proxy.get('userProduct/listSchool', data2, {dispatch});
},
info:
(data = {}) =>
@ -28,6 +29,12 @@ const userProduct = {
await proxy.delete("userProduct/delete", data);
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;

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

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

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

@ -96,10 +96,44 @@ const initialState = {
back: 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,
};
const grades = [
export const grades = [
"پیش دبستان",
"اول",
"دوم",

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

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

@ -275,6 +275,21 @@ class onInput {
.replace(/[^\d]/, "");
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();

@ -16,6 +16,8 @@ import LoginSignUpMobile from './mobile'
import { connect } from "react-redux";
import { user, publicApi } from "../../redux/actions";
import axios from "axios";
import { ApiConfig } from "../../constants/defaultValues";
const LoginSignUp = ({ activeLogin,
sendOtp,
@ -25,6 +27,7 @@ const LoginSignUp = ({ activeLogin,
headerOptions,
setHeaderOptions,
isMobile,
bnLogin
}) => {
const [steps, setSteps] = useState(0);
const [index, setIndex] = useState(1);
@ -178,8 +181,8 @@ const LoginSignUp = ({ activeLogin,
signUpFields?.otp2 +
signUpFields?.otp3 +
signUpFields?.otp4,
userToken: "2",
applicationToken: "22",
userToken: '1',
applicationToken: '1',
});
setError(undefined);
@ -200,8 +203,8 @@ const LoginSignUp = ({ activeLogin,
sendOtp({
cellphone: signUpFields?.cellphone,
otp: signUpFields?.otp,
userToken: "2",
applicationToken: "22",
userToken: '1',
applicationToken: '1',
});
}
}, [signUpFields]);
@ -287,6 +290,43 @@ const LoginSignUp = ({ activeLogin,
>
ثبت نام
</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-row-reverse justify-center">
<div className="w-full mt-5 flex flex-row-reverse justify-center">
<input
inputMode="numeric"
style={{ direction: "ltr" }}
@ -393,7 +433,7 @@ const LoginSignUp = ({ activeLogin,
checkOtp(e)
// activeLogin()
setTimeout(() => window.location.reload(), 200)
// setTimeout(() => window.location.reload(), 200)
}}
>
تایید
@ -403,7 +443,7 @@ const LoginSignUp = ({ activeLogin,
شماره خود را اشتباه وارد کردید؟{" "}
<button
className="bg-transparent border-none text-greenBA font-medium"
onClick={() => setLevel("phonenumber")}
onClick={() => {setSteps(1); setLevel("phonenumber")}}
>
اصلاح شماره تلفن
</button>
@ -479,6 +519,7 @@ const mapStateToProps = (state) => ({
const mapDispatchToProps = {
sendOtp: user.otp_login,
sendPhoneNumber: user.otp,
bnLogin: user.bnLogin,
setHeaderOptions: publicApi.setHeaderOptions,
};

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

@ -64,8 +64,8 @@ const AddExam = () => {
]
return(
<div className='flex flex-col w-[96%] overflow-scroll overflow-x-hidden py-[6%] 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 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-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>

@ -112,7 +112,7 @@ const AddExamDescription = ({ grades, addExamState, dispatch, stepClick, backSte
</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
title='مرحله بعدی'

@ -59,7 +59,7 @@ const AddGradeGroup = ({grades, addExamState, dispatch, stepClick}) => {
</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
title='مرحله بعدی'

@ -125,7 +125,7 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
console.log(question)
console.log(addExamState.courses.filter(itm => itm.id == selectedCourse.id)[0]?.selectedQuestions)
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">
<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="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 */}
<Droppable droppableId="Choosed_Questions_Form_Bank">
{(provided) => (
@ -363,7 +363,7 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
</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 ">
{
addQuestionPopup === 'component' &&
@ -376,10 +376,22 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
setAsAnswer={e => {
let thisOption = question.options.find(itm => itm.id == e)
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({
...question,
options: [...options]
options: [...newNewOptions]
})
}}
@ -500,7 +512,7 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
<Droppable droppableId="QUESTIONS_IN_BANK">
{(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>
</>
:
<div className="w-full" style={{ height: '450px' }}>
<div className="w-full" style={{ height: '55vh' }}>
</div>
}
@ -568,7 +580,7 @@ const AddQuestionsFromBank = ({ grades, addExamState, dispatch, stepClick, backS
</div>
</>
</div>
)
}

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

@ -20,7 +20,7 @@ const Metrics = () => {
<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" 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>
)
)

@ -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>
<div className="flex flex-wrap px-4">
<div className="flex flex-wrap px-2">
{
inputs.map(
(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}/>
<p>{item}</p>
</div>

@ -3,7 +3,7 @@ import Button from "../../components/Button";
import Input from "../../components/input";
import Map from '../../components/Map'
import { connect } from "react-redux";
const ContactUs = ({isMobile}) => {
const ContactUs = ({ isMobile }) => {
const departments = [
@ -31,169 +31,169 @@ const ContactUs = ({isMobile}) => {
const [phase, setPhase] = useState(1);
return (
isMobile ?
<div className="w-full flex flex-col py-20 px-4 pb-40">
<h1 className="w-full text-right text-red52 font-bold">تماس با ما</h1>
<div className="flex w-full rtl mt-4 justify-between py-1 bg-gray-100 border border-gray-300 rounded-xl">
<button className={`w-1/2 rounded-xl mx-1 h-12 ${phase == 1 ? 'bg-red5B font-bold text-white' : 'text-red5B'}`}
onClick={() => setPhase(1)}
>
فرم تماس با ما
</button>
<button className={`w-1/2 rounded-xl mx-1 font-bold h-12 ${phase == 2 ? 'bg-red5B text-white' : 'text-red5B'}`}
onClick={() => setPhase(2)}
>
اطلاعات تماس
</button>
</div>
{
phase == 1 ?
<div className="w-full rtl">
<form className="flex flex-col w-full">
<Input title='نام' gapSize='8' id={0} style={{ width: '100%' }} />
<Input title='ایمیل' gapSize='8' id={1} style={{ width: '100%', background: 'rgba(249, 249, 249, 0.75)' }} type="email" onChange={(e) => {
let value = e.target.value
value = value.replace(/[^A-Za-z]/ig, '')
this.setState({
value,
})
}}/>
<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) => (
<option key={`Grade__${index}`}>{item.title}</option>
))}
</select>
<textarea className="w-full border-gray-200 border p-3 rounded-lg text-gray-400 outline-red52" rows='7' cols='70' placeholder="متن پیام را اینجا تایپ کنید">
</textarea>
<div className="w-full flex" style={{direction: 'ltr'}}>
<Button title='ارسال پیام' className='w-full'/>
</div>
</form>
</div>
:
isMobile ?
<div className="w-full flex flex-col py-20 px-4 pb-40">
<h1 className="w-full text-right text-red52 font-bold">تماس با ما</h1>
<div className="flex w-full rtl mt-4 justify-between py-1 bg-gray-100 border border-gray-300 rounded-xl">
<button className={`w-1/2 rounded-xl mx-1 h-12 ${phase == 1 ? 'bg-red5B font-bold text-white' : 'text-red5B'}`}
onClick={() => setPhase(1)}
>
فرم تماس با ما
</button>
<button className={`w-1/2 rounded-xl mx-1 font-bold h-12 ${phase == 2 ? 'bg-red5B text-white' : 'text-red5B'}`}
onClick={() => setPhase(2)}
>
اطلاعات تماس
</button>
</div>
{
phase == 1 ?
<div className="w-full rtl">
<form className="flex flex-col w-full">
<Input title='نام' gapSize='8' id={0} style={{ width: '100%' }} />
<Input title='ایمیل' gapSize='8' id={1} style={{ width: '100%', background: 'rgba(249, 249, 249, 0.75)' }} type="email" onChange={(e) => {
let value = e.target.value
value = value.replace(/[^A-Za-z]/ig, '')
this.setState({
value,
})
}} />
<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) => (
<option key={`Grade__${index}`}>{item.title}</option>
))}
</select>
<textarea className="w-full border-gray-200 border p-3 rounded-lg text-gray-400 outline-red52" rows='7' cols='70' placeholder="متن پیام را اینجا تایپ کنید">
</textarea>
<div className="w-full flex" style={{ direction: 'ltr' }}>
<Button title='ارسال پیام' className='w-full' />
</div>
</form>
</div>
:
<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'}}>
<Map />
</div>
<div className="flex w-full text-right flex-col mb-4 items-start">
<div className="w-full p-2 border-b border-gray-200">
<h1 className="text-red52 text-md p-1 pr-0 font-black">آدرس ما</h1>
<p className="text-gray-400 text-sm">تهران خیابان انقلاب بین ابوریحان و فلسطین بن بست سروش پلاک 2</p>
<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' }}>
<Map />
</div>
<div className="w-full p-2 border-b border-gray-200">
<h1 className="text-red52 text-md p-1 pr-0 font-black">شماره تماس</h1>
<p className="text-gray-400 text-sm"> 02163462405 - 02163462406 </p>
</div>
<div className="w-full p-2 border-b border-gray-200">
<h1 className="text-red52 text-md p-1 pr-0 font-black"> ایمیل سازمانی </h1>
<p className="text-gray-400 text-sm">Info@Azmoonsample.ir</p>
</div>
<div className="w-full p-2 ">
<h1 className="text-red52 text-md p-1 pr-0 font-black"> شماره پیامک </h1>
<p className="text-gray-400 text-sm">300000000008762144</p>
<p className="text-gray-400 text-sm">توجه داشته باشید تمامی پیامک ها از سامانه آزمون از طریق همین سرشماره برای شما ارسال خواهد شد</p>
<div className="flex w-full text-right flex-col mb-4 items-start">
<div className="w-full p-2 border-b border-gray-200">
<h1 className="text-red52 text-md p-1 pr-0 font-black">آدرس ما</h1>
<p className="text-gray-400 text-sm">تهران خیابان فاطمی نبش خیابان دائمی پلاک 178 </p>
</div>
<div className="w-full p-2 border-b border-gray-200">
<h1 className="text-red52 text-md p-1 pr-0 font-black">شماره تماس</h1>
<a href="tel:02188976077"><p className="text-gray-400 text-sm"> 02188976077 </p></a>
</div>
<div className="w-full p-2 border-b border-gray-200">
<h1 className="text-red52 text-md p-1 pr-0 font-black"> ایمیل سازمانی </h1>
< a href="mailto:info@andishmand.ir"><p className="text-gray-400 text-sm">info@andishmand.ir</p></a>
</div>
<div className="w-full p-2 ">
<h1 className="text-red52 text-md p-1 pr-0 font-black"> شماره پیامک </h1>
<p className="text-gray-400 text-sm">300000000008762144</p>
<p className="text-gray-400 text-sm">توجه داشته باشید تمامی پیامک ها از سامانه آزمون از طریق همین سرشماره برای شما ارسال خواهد شد</p>
</div>
</div>
</div>
</div>
}
</div>
:
<div className=" w-full text-right" style={{ direction: 'rtl', marginTop: '6.5%', paddingRight: '8.5%' }}>
<h1 className="w-2/3 border-b border-gray-300 text-3xl font-bold text-red52 py-4">تماس با ما</h1>
<div className="flex ">
<div className="w-1/3">
<form className="flex flex-col w-full">
<Input title='نام' gapSize='8' id={0} style={{ width: '100%' }} />
<Input title='ایمیل' type={'email'} gapSize='8' id={1} style={{ width: '100%' }} onChange={(e) => {
let value = e.target.value
value = value.replace(/[^A-Za-z]/ig, '')
this.setState({
value,
})
}} />
<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) => (
<option key={`Grade__${index}`}>{item.title}</option>
))}
</select>
<select className="bg-white border border-solid border-gray-200 w-full my-4 mt-0 p-3 rounded-lg text-gray-400 outline-red52">
<option>انتخاب محصول / خدمات</option>
{departments.map((item, index) => (
<option key={`Grade__${index}`}>{item.title}</option>
))}
</select>
<textarea className="w-full border-gray-200 border p-3 rounded-lg text-gray-400 outline-red52" rows='7' cols='70' placeholder="متن پیام را اینجا تایپ کنید">
</textarea>
<div className="w-full flex" style={{direction: 'ltr'}}>
<Button title='ارسال پیام' className='w-32'/>
</div>
</form>
</div>
<div className="flex flex-col w-1/3 mr-32 mt-4">
<div className="flex w-full justify-between mb-4 items-start">
}
</div>
:
<div className=" w-full text-right" style={{ direction: 'rtl', marginTop: '6.5%', paddingRight: '8.5%' }}>
<h1 className="w-2/3 border-b border-gray-300 text-3xl font-bold text-red52 py-4">تماس با ما</h1>
<div className="flex ">
<div className="w-1/3">
<form className="flex flex-col w-full">
<Input title='نام' gapSize='8' id={0} style={{ width: '100%' }} />
<Input title='ایمیل' type={'email'} gapSize='8' id={1} style={{ width: '100%' }} onChange={(e) => {
let value = e.target.value
value = value.replace(/[^A-Za-z]/ig, '')
this.setState({
value,
})
}} />
<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) => (
<option key={`Grade__${index}`}>{item.title}</option>
))}
</select>
<select className="bg-white border border-solid border-gray-200 w-full my-4 mt-0 p-3 rounded-lg text-gray-400 outline-red52">
<option>انتخاب محصول / خدمات</option>
{departments.map((item, index) => (
<option key={`Grade__${index}`}>{item.title}</option>
))}
</select>
<textarea className="w-full border-gray-200 border p-3 rounded-lg text-gray-400 outline-red52" rows='7' cols='70' placeholder="متن پیام را اینجا تایپ کنید">
</textarea>
<div className="w-full flex" style={{ direction: 'ltr' }}>
<Button title='ارسال پیام' className='w-32' />
</div>
</form>
</div>
<div className="flex flex-col w-1/3 mr-32 mt-4">
<div className="flex w-full justify-between mb-4 items-start">
<div className="w-1/2 p-2">
<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 className="w-1/2 p-2">
<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>
<div className="w-full flex justify-between mb-4 items-start">
<div className="w-1/2 p-2">
</div>
<div className="w-full flex justify-between mb-4 items-start">
<div className="w-1/2 p-2">
<h1 className="text-red52 text-xl p-1 pr-0 font-black"> شماره پیامک </h1>
<p className="text-gray-400 text-sm">300000000008762144</p>
<p className="text-gray-400 text-sm">توجه داشته باشید تمامی پیامک ها از سامانه آزمون از طریق همین سرشماره برای شما ارسال خواهد شد</p>
</div>
<div className="w-1/2 p-2">
<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 className="w-full border-t border-gray-300"></div>
<div className="w-full rounded-xl overflow-hidden my-4 " style={{height:'215px'}}>
<Map />
</div>
<div className="w-full border-t border-gray-300"></div>
<div className="w-full rounded-xl overflow-hidden my-4 " style={{ height: '215px' }}>
<Map />
</div>
</div>
</div>
</div>
</div>
);
};
const mapStateToProps = (state) => ({
isDark: state.publicApi.isDark,
isMobile: state.publicApi.isMobile,
});
const mapDispatchToProps = {
};
export default connect(mapStateToProps, mapDispatchToProps)(ContactUs);
});
const mapDispatchToProps = {
};
export default connect(mapStateToProps, mapDispatchToProps)(ContactUs);

@ -10,64 +10,70 @@ import { connect } from "react-redux";
import ScrollContainer from 'react-indiana-drag-scroll'
const Games = ({ gameId, chooseGame, selectedGames, isMobile }) => {
const Games = ({ gameId, chooseGame, selectedGames, isMobile, setTypes }) => {
const [data, setData] = useState([
{
id: 1,
img: img1,
title: 'کلاس های آموزشی',
img: img4,
title: 'کتاب های آموزشی',
includedProductTypes: [1]
},
{
id: 2,
img: img2,
title: 'پیش ثبت نام مدارس',
img: img3,
title: 'بسته های آزمون',
includedProductTypes: [2, 3]
},
{
id: 3,
img: img3,
title: 'بسته های آزمون',
img: img1,
title: 'کلاس های آموزشی',
includedProductTypes: [4, 5]
},
{
id: 4,
img: img4,
title: 'کتاب های آموزشی',
img: img5,
title: 'دوره های مجازی',
includedProductTypes: [6]
},
{
id: 5,
img: img5,
title: 'دوره های مجازی',
img: img2,
title: 'پیش ثبت نام مدارس',
includedProductTypes: [7]
},
{
id: 6,
img: img6,
title: 'سایر خدمات',
includedProductTypes: [8]
},
]);
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) => (
<div
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={
gameId === item.id
? {
backgroundColor: "rgba(223, 20, 82, 0.02)",
aspectRatio: "0.95/1",
// aspectRatio: "0.85/1",
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">
<HiCheck className="text-white h-3/4" />
</div>}
<img src={item.img} alt="game-img" className="h-2/5" />
<div
className="Games-title mt-2"
className="text-sm mt-2"
style={gameId === item.id ? { color: "#df1452" } : null}
>
{item.title}
@ -89,7 +95,7 @@ const Games = ({ gameId, chooseGame, selectedGames, isMobile }) => {
}
: { 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">
<HiCheck className="text-white h-3/4" />

@ -16,67 +16,150 @@ import { connect } from "react-redux";
import MobileRegister from './mobile'
import persian from "react-date-object/calendars/persian"
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 { ostan } from "../../constants/states";
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 [index, setIndex] = useState(1);
const [register, setRegister] = useState(false);
const timeoutRef = useRef(null);
const [activeStep, setActiveStep] = useState([true, false, false, false]);
const [error, setError] = useState('');
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({
name: null,
familyName: null,
firstName: null,
lastName: null,
nationalId: null,
birthDate: null,
sex: null,
grade: null,
schoolName: null,
city: null,
state: null,
fatherName: null,
fatherNationalId: null,
fatherFamilyName: null,
fatherJob: null,
fatherMajor: null,
fatherPhoneNumber: null,
fatherJobAddress: null,
fatherJobPhoneNumber: null,
motherName: null,
motherNationalId: null,
motherFamilyName: null,
motherJob: null,
motherMajor: null,
motherPhoneNumber: null,
motherJobAddress: null,
motherJobPhoneNumber: null,
familyNumber: null,
gender: null,
gradeIds: null,
previousSchoolName: null,
previousSchoolType: null,
cityId: null,
provinceId: null,
zone: null,
fatherInfo: {
firstName: null,
nationalId: null,
lastName: null,
job: null,
education: null,
cellphone: null,
workPlace: null,
workPhone: null,
},
motherInfo: {
firstName: null,
nationalId: null,
lastName: null,
job: null,
education: null,
cellphone: null,
workPlace: null,
workPhone: null,
},
familyMemberCount: null,
address: null,
homePhoneNumber: null,
phone: null,
rulesAccepted: false,
});
const finalViewInfo = [
{
title: 'نام',
value: userInfo.name
value: userInfo.firstName
},
{
title: 'نام خانوادگی',
value: userInfo.familyName
value: userInfo.lastName
},
{
title: 'جنسیت',
value: userInfo.sex
value: userInfo.gender
},
{
title: 'کد ملی',
@ -84,87 +167,87 @@ const Register = ({ activeLogin, isMobile }) => {
},
{
title: 'تاریخ تولد',
value: userInfo.birthDate
value: userInfo.birthDate?.toLocaleDateString('fa-IR')
},
{
title: 'نام مدرسه ',
value: userInfo.schoolName
value: userInfo.previousSchoolName
},
{
title: 'شهر',
value: userInfo.city
value: userInfo.cityId
},
{
title: 'منطقه',
value: userInfo.state
value: userInfo.zone
},
{
title: 'نام',
value: userInfo.fatherName
value: userInfo.fatherInfo.firstName
},
{
title: 'نام خانوادگی',
value: userInfo.fatherFamilyName
value: userInfo.fatherInfo.lastName
},
{
title: 'کدملی',
value: userInfo.fatherNationalId
value: userInfo.fatherInfo.nationalId
},
{
title: 'مدرک تحصیلی',
value: userInfo.fatherMajor
value:madraks.find(itm => itm.id == userInfo.fatherInfo.education)?.title
},
{
title: 'تلفن همراه',
value: userInfo.fatherPhoneNumber
value: userInfo.fatherInfo.cellphone
},
{
title: 'شغل',
value: userInfo.fatherJob
value: userInfo.fatherInfo.job
},
{
title: 'محل کار',
value: userInfo.fatherJobAddress
value: userInfo.fatherInfo.workPlace
},
{
title: 'تلفن محل کار',
value: userInfo.fatherJobPhoneNumber
value: userInfo.fatherInfo.workPhone
},
{
title: 'نام',
value: userInfo.motherName
value: userInfo.motherInfo.firstName
},
{
title: 'نام خانوادگی',
value: userInfo.motherFamilyName
value: userInfo.motherInfo.lastName
},
{
title: 'کدملی',
value: userInfo.motherNationalId
value: userInfo.motherInfo.nationalId
},
{
title: 'مدرک تحصیلی',
value: userInfo.motherMajor
value: madraks.find(itm => itm.id == userInfo.motherInfo.education)?.title
},
{
title: 'تلفن همراه',
value: userInfo.motherPhoneNumber
value: userInfo.motherInfo.cellphone
},
{
title: 'شغل',
value: userInfo.motherJob
value: userInfo.motherInfo.job
},
{
title: 'محل کار',
value: userInfo.motherJobAddress
value: userInfo.motherInfo.workPlace
},
{
title: 'تلفن محل کار',
value: userInfo.motherJobPhoneNumber
value: userInfo.motherInfo.workPhone
},
{
title: 'تعداد افراد خانواده',
value: userInfo.familyNumber
value: userInfo.familyMemberCount
},
{
title: 'نشانی محل سکونت',
@ -172,7 +255,7 @@ const Register = ({ activeLogin, isMobile }) => {
},
{
title: 'تلفن ثابت',
value: userInfo.homePhoneNumber
value: userInfo.phone
},
];
@ -279,11 +362,11 @@ const Register = ({ activeLogin, isMobile }) => {
},
{
id: 1,
title: 'مذکر',
title: 'آقا',
},
{
id: 2,
title: 'مونث',
title: 'خانم',
}
]
const CostumeDatePickerInput = ({ openCalendar, value, handleValueChange, title }) => {
@ -293,43 +376,14 @@ const Register = ({ activeLogin, isMobile }) => {
value={value}
onChange={handleValueChange}
title={title}
className="w-52"
className="w-52 mx-1"
// type='date'
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 [selectedCity, setSelectedCity] = useState(null);
return (
@ -340,7 +394,7 @@ const Register = ({ activeLogin, isMobile }) => {
{/* form */}
{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" /> */}
<div className="flex flex-col items-center justify-start leading-normal">
@ -381,6 +435,7 @@ const Register = ({ activeLogin, isMobile }) => {
</div>
</div>
{/* Content */}
@ -393,31 +448,50 @@ const Register = ({ activeLogin, isMobile }) => {
<h1 className="font-black">مشخصات هویتی دانش آموز</h1>
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">اطلاعات هویتی دانش آموز را با دقت تکمیل و عکس مدارک را بارگزاری نمایید</p>
</div>
<div className="flex">
<div className="flex w-2/5 flex-wrap justify-between">
<div className="flex 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'} title="نام خانوادگی" borderType="rounded" id={1} direction='rtl' value={userInfo.familyName} onChange={(e) => setUserInfo({ ...userInfo, familyName: 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="8" direction='rtl' id={0} value={userInfo.firstName} onChange={(e) => setUserInfo({ ...userInfo, firstName: _onInput.noNumber(e.target.value)})} />
<Input className={'w-52 mx-1'} title="نام خانوادگی" borderType="rounded" id={1} direction='rtl' value={userInfo.lastName} onChange={(e) => setUserInfo({ ...userInfo, lastName: _onInput.noNumber(e.target.value) })} />
<Input className={'w-52 mx-1'} title="کدملی" borderType="rounded" gapSize="12" id={2} type='textNumber' max={10} value={userInfo.nationalId} onChange={e => setUserInfo({ ...userInfo, nationalId: _onInput.numberOnly(e.target.value) })} />
{/* <Input className={'w-52'} title="تاریخ تولد" borderType="rounded" gapSize="16" id={3} type='number' /> */}
<DatePicker
format="YYYY/MM/DD"
onChange={(e) => 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}
className="red"
locale={persian_fa}
renderButton={(direction, handleClick) => (
<button className="text-blue-500 font-bold mx-2" onClick={handleClick}>
{direction === "right" ? ">" : "<"}
</button>
)}
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>
}
}
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) => (
<option key={`gender${item.id}`}>{item.title}</option>
<option key={`gender${item.id}`} value={item.id}>{item.title}</option>
))}
</select>
@ -427,13 +501,14 @@ const Register = ({ activeLogin, isMobile }) => {
</div>
<div className="w-3/5 flex flex-wrap justify-between">
<div className="w-2/5 mx-4">
<div className=" flex justify-between">
<div className="mx-1 ml-2">
<FileInput title="بارگزاری صفحه اول شناسنامه" id={1} />
</div>
<div className="w-2/5 mx-4">
<FileInput title="بارگزاری عکس پرسنلی" id={2} />
</div>
<FileInput title="بارگزاری عکس پرسنلی" id={2} />
</div>
@ -444,44 +519,54 @@ const Register = ({ activeLogin, isMobile }) => {
<h1 className="font-black">پایه تحصیلی</h1>
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا پایه تحصیلی دانش آموز را وارد کنید</p>
</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) => (
<option key={`Grade__${item.id}`}>{item.title}</option>
<option key={`Grade__${item.id}`} value={item.id}>{item.title}</option>
))}
</select>
</div>
<div className="w-full px-10 py-8 flex flex-col ">
<div className="mb-4">
<h1 className="font-black">مشخصات هویتی دانش آموز</h1>
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">اطلاعات هویتی دانش آموز را با دقت تکمیل و عکس مدارک را بارگزاری نمایید</p>
<h1 className="font-black">اطلاعات محل تحصیل</h1>
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا اطلاعات مربوط به محل تحصیل دانش آموز را وارد کنید</p>
</div>
<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
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"
onChange={e => {setSelectedState(e.target.value); setUserInfo({...userInfo, state: e.target.value})}}>
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, 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>
{
ostan.map((item) => <option value={item.id}>{item.name}</option>)
province?.map((item) => <option value={item.id}>{item.name}</option>)
}
</select>
{
selectedState !== null &&
<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"
onChange={(e) => {setSelectedCity(e.target.value); setUserInfo({...userInfo, city: e.target.value})}}>
<option value={null}>
شهر
</option>
{
cities.filter(itm => itm.ostan == selectedState).map((city) => <option value={city.id}>{city.name}</option>)
}
</select>
}
{
selectedCity !== null && <Input className={'w-64'} title="منطقه" borderType="rounded" gapSize="12" id={5} type='number' />
}
<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) => { 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>
<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 className="flex pt-10 justify-end">
<div className="w-40">
@ -494,7 +579,7 @@ const Register = ({ activeLogin, isMobile }) => {
} else {
alert('لطفا تمامی فیلد ها را پر کنید')
}
}} />
</div>
</div>
@ -514,14 +599,28 @@ const Register = ({ activeLogin, isMobile }) => {
<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="12" id={1} type='number' value={userInfo.fatherNationalId} onChange={e => setUserInfo({ ...userInfo, fatherNationalId: e.target.value })}/>
<Input className={'w-52'} title="نام خانوادگی" borderType="rounded" id={2} direction='rtl' value={userInfo.fatherFamilyName} onChange={e => setUserInfo({ ...userInfo, fatherFamilyName: 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">
<Input className={'w-52'} 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-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) => (
<option key={`madraks${item.id}`}>{item.title}</option>
<option key={`madraks${item.id}`} value={item.id}>{item.title}</option>
))}
</select>
@ -532,12 +631,19 @@ const Register = ({ activeLogin, isMobile }) => {
<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" direction='rtl' gapSize="8" id={4} value={userInfo.fatherJob} onChange={e => setUserInfo({ ...userInfo, fatherJob: e.target.value })}/>
<Input className={'w-52'} title="تلفن همراه" borderType="rounded" max={11} id={3} value={userInfo.fatherInfo.cellphone} onChange={e => setUserInfo({ ...userInfo, fatherInfo:{
...userInfo.fatherInfo,
cellphone: _onInput.phonenumber(e.target.value)
}})} />
<Input className={'w-52'} title="شغل" borderType="rounded" direction='rtl' gapSize="8" id={4} value={userInfo.fatherInfo.job}
onChange={e => setUserInfo({ ...userInfo, fatherInfo: { ...userInfo.fatherInfo, job:e.target.value }})} />
<Input className={'w-52'} title="محل کار" borderType="rounded" id={5} direction='rtl' value={userInfo.fatherJobAddress} onChange={e => setUserInfo({ ...userInfo, fatherJobAddress: e.target.value })}/>
<Input className={'w-52'} title="تلفن محل کار" borderType="rounded" gapSize="28" id={6} type='number' value={userInfo.fatherJobPhoneNumber} onChange={e => setUserInfo({ ...userInfo, fatherJobPhoneNumber: e.target.value })} />
<Input className={'w-52'} title="محل کار" borderType="rounded" id={5} direction='rtl' value={userInfo.fatherInfo.workPlace}
onChange={e => setUserInfo({ ...userInfo, fatherInfo:{...userInfo.fatherInfo, workPlace: e.target.value }})} />
<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">
<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="12" id={8} type='number' value={userInfo.motherNationalId} onChange={e => setUserInfo({ ...userInfo, motherNationalId: e.target.value })} />
<Input className={'w-52'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={7} value={userInfo.motherInfo.firstName}
onChange={e => setUserInfo({ ...userInfo, motherInfo:{...userInfo.motherInfo, firstName: _onInput.noNumber(e.target.value) }})} />
<Input className={'w-52'} title="نام خانوادگی" borderType="rounded" id={8} direction='rtl' value={userInfo.motherInfo.lastName}
onChange={e => setUserInfo({ ...userInfo, motherInfo:{...userInfo.motherInfo, lastName: _onInput.noNumber(e.target.value) }})} />
<Input className={'w-52'} title="کدملی" borderType="rounded" gapSize="12" id={9} type='text' max={10} value={userInfo.motherInfo.nationalId}
onChange={e => setUserInfo({ ...userInfo, motherInfo:{...userInfo.motherInfo, nationalId: _onInput.numberOnly(e.target.value) }})} />
<Input className={'w-52'} title="نام خانوادگی" borderType="rounded" id={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) => (
<option key={`madraks${item.id}`}>{item.title}</option>
<option key={`madraks${item.id}`} value={item.id}>{item.title}</option>
))}
</select>
@ -573,12 +688,30 @@ const Register = ({ activeLogin, isMobile }) => {
<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" direction='rtl' gapSize="8" id={11} value={userInfo.motherJob} onChange={e => setUserInfo({ ...userInfo, motherJob: e.target.value })}/>
<Input className={'w-52'} title="تلفن همراه" borderType="rounded" type='text' id={10} max={11} value={userInfo.motherInfo.cellphone}
onChange={e => setUserInfo({ ...userInfo, motherInfo: {
...userInfo.motherInfo,
cellphone: _onInput.phonenumber(e.target.value)
}})} />
<Input className={'w-52'} title="شغل" borderType="rounded" direction='rtl' gapSize="8" id={11} value={userInfo.motherInfo.job}
onChange={e => setUserInfo({ ...userInfo, motherInfo:{
...userInfo.motherInfo,
job: e.target.value
} })} />
<Input className={'w-52'} title="محل کار" borderType="rounded" id={12} direction='rtl' value={userInfo.motherJobAddress} onChange={e => setUserInfo({ ...userInfo, motherJobAddress: e.target.value })} />
<Input className={'w-52'} title="تلفن محل کار" borderType="rounded" gapSize="28" id={13} type='number' value={userInfo.motherJobPhoneNumber} onChange={e => setUserInfo({ ...userInfo, motherJobPhoneNumber: e.target.value })}/>
<Input className={'w-52'} title="محل کار" borderType="rounded" id={12} direction='rtl'
value={userInfo.motherInfo.workPlace}
onChange={e => setUserInfo({ ...userInfo, motherInfo: {
...userInfo.motherInfo,
workPlace: e.target.value
} })} />
<Input className={'w-52'} title="تلفن محل کار" borderType="rounded" gapSize="28" id={13} type='text' max={11}
value={userInfo.motherInfo.workPhone}
onChange={e => setUserInfo({ ...userInfo, motherInfo: {
...userInfo.motherInfo,
workPhone: _onInput.numberOnly(e.target.value)
} })} />
@ -593,18 +726,18 @@ const Register = ({ activeLogin, isMobile }) => {
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">در این قسمت مشخص کنید دانشس آموز به همراه چه کسانی زندگی میکند </p>
</div>
<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'} title="تلفن ثابت" borderType="rounded" type='number' gapSize="40" direction='rtl' id={15} value={userInfo.homePhoneNumber} onChange={e => setUserInfo({ ...userInfo, homePhoneNumber: e.target.value })}/>
<Input title="نشانی محل سکونت" borderType="rounded" gapSize="40" id={16} value={userInfo.address} onChange={e => setUserInfo({ ...userInfo, address: 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" 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 })} />
</div>
@ -627,8 +760,8 @@ const Register = ({ activeLogin, isMobile }) => {
} else {
alert('لطفا تمامی فیلد ها را پر کنید')
}
}} />
</div>
@ -648,7 +781,7 @@ const Register = ({ activeLogin, isMobile }) => {
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا قوانین و مقررات را مطالعه فرمایید</p>
</div>
<p className="text-gray-500">
<p className="text-gray-500 text-justify">
بند اول: موارد مربوط به آموزش مخاطبین
پیر مردی هر روز تو محله می دید پسر کی با کفش های پاره و پای برهنه با توپ پلاستیکی فوتبال بازی می کند، روزی رفت ی کتانی نو خرید و اومد و به پسرک گفت بیا این کفشا رو بپوشپسرک کفشا رو پوشید و خوشحال رو به پیر مرد کرد و گفت: شما خدایید؟! پیر مرد لبش را گزید و گفت نه! پسرک گفت پس دوست خدایی، چون من دیشب فقط به خدا گفتم كه کفش ندارم
هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس میزند... در نهایت این مرگ است که باید پیروز شود، زیرا از هنگام تولد بخشی از سرنوشت ما شده و فقط مدت کوتاهی پیش از بلعیدن طعمه اش، با آن بازی می کند. با این همه، ما تا آنجا که ممکن است، با علاقه فراوان و دلواپسی زیاد به زندگی ادامه می دهیم، همان طور که تا آنجا که ممکن است طولانی تر در یک حباب صابون می دمیم تا بزرگتر شود، گر چه با قطعیتی تمام می دانیم که خواهد ترکید.
@ -666,14 +799,19 @@ const Register = ({ activeLogin, isMobile }) => {
</div>
<div className="flex items-center px-10 py-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">
اینجانبان
<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>
</div>
@ -706,46 +844,47 @@ const Register = ({ activeLogin, isMobile }) => {
<p className="font-bold text-gray-400 mt-2 leading-normal text-sm">لطفا اطلاعاتی که وارد کرده اید را چک کنید</p>
</div>
<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>
{
finalViewInfo.slice(0, 8).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
<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>
{
finalViewInfo.slice(8, 16).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
<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>
{
finalViewInfo.slice(16, 24).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
<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>
{
finalViewInfo.slice(24, 27).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
<div className="w-full flex flex-wrap">
<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>
{
finalViewInfo.slice(0, 8).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
<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>
{
finalViewInfo.slice(8, 16).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
<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>
{
finalViewInfo.slice(16, 24).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
<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>
{
finalViewInfo.slice(24, 27).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
</div>
</div>
@ -758,8 +897,9 @@ const Register = ({ activeLogin, isMobile }) => {
</div>
<div className="w-40">
<Button borderType='rounded' title='ورود' to='/dashboard' onClick={() =>
activeLogin()
<Button borderType='rounded' title='تایید' to='/' onClick={() =>
// activeLogin()
setProfile(userInfo)
} />
</div>
</div>
@ -780,7 +920,15 @@ const Register = ({ activeLogin, isMobile }) => {
};
const mapStateToProps = (state) => ({
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 { toast } from "react-toastify";
import Checkbox from "../../../components/Checkbox";
const MobileRegister = ({ activeLogin, isMobile }) => {
import { user, publicApi } from "../../../redux/actions";
import _onInput from "../../../utils/onInput";
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 [index, setIndex] = useState(1);
const [register, setRegister] = useState(false);
const timeoutRef = useRef(null);
const [activeStep, setActiveStep] = useState([true, false, false, false]);
const [error, setError] = useState('');
const [selectedState, setSelectedState] = useState(null);
const [selectedCity, setSelectedCity] = useState(null);
useEffect(() => {
window.scrollTo(0,0)
window.scrollTo(0, 0)
}, [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({
name: null,
familyName: null,
firstName: null,
lastName: null,
nationalId: null,
birthDate: null,
sex: null,
grade: null,
schoolName: null,
city: null,
state: null,
fatherName: null,
fatherNationalId: null,
fatherFamilyName: null,
fatherJob: null,
fatherMajor: null,
fatherPhoneNumber: null,
fatherJobAddress: null,
fatherJobPhoneNumber: null,
motherName: null,
motherNationalId: null,
motherFamilyName: null,
motherJob: null,
motherMajor: null,
motherPhoneNumber: null,
motherJobAddress: null,
motherJobPhoneNumber: null,
familyNumber: null,
gender: null,
gradeIds: null,
previousSchoolName: null,
previousSchoolType: null,
cityId: null,
provinceId: null,
zone: null,
fatherInfo: {
firstName: null,
nationalId: null,
lastName: null,
job: null,
education: null,
cellphone: null,
workPlace: null,
workPhone: null,
},
motherInfo: {
firstName: null,
nationalId: null,
lastName: null,
job: null,
education: null,
cellphone: null,
workPlace: null,
workPhone: null,
},
familyMemberCount: null,
address: null,
homePhoneNumber: null,
phone: null,
rulesAccepted: false,
});
const finalViewInfo = [
{
title: 'نام',
value: userInfo.name
value: userInfo.firstName
},
{
title: 'نام خانوادگی',
value: userInfo.familyName
value: userInfo.lastName
},
{
title: 'جنسیت',
value: userInfo.sex
value: userInfo.gender
},
{
title: 'کد ملی',
@ -77,87 +188,87 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
},
{
title: 'تاریخ تولد',
value: userInfo.birthDate
value: userInfo.birthDate?.toLocaleDateString('fa-IR')
},
{
title: 'نام مدرسه ',
value: userInfo.schoolName
value: userInfo.previousSchoolName
},
{
title: 'شهر',
value: userInfo.city
value: userInfo.cityId
},
{
title: 'منطقه',
value: userInfo.state
value: userInfo.zone
},
{
title: 'نام',
value: userInfo.fatherName
value: userInfo.fatherInfo.firstName
},
{
title: 'نام خانوادگی',
value: userInfo.fatherFamilyName
value: userInfo.fatherInfo.lastName
},
{
title: 'کدملی',
value: userInfo.fatherNationalId
value: userInfo.fatherInfo.nationalId
},
{
title: 'مدرک تحصیلی',
value: userInfo.fatherMajor
value: madraks.find(itm => itm.id == userInfo.fatherInfo.education)?.title
},
{
title: 'تلفن همراه',
value: userInfo.fatherPhoneNumber
value: userInfo.fatherInfo.cellphone
},
{
title: 'شغل',
value: userInfo.fatherJob
value: userInfo.fatherInfo.job
},
{
title: 'محل کار',
value: userInfo.fatherJobAddress
value: userInfo.fatherInfo.workPlace
},
{
title: 'تلفن محل کار',
value: userInfo.fatherJobPhoneNumber
value: userInfo.fatherInfo.workPhone
},
{
title: 'نام',
value: userInfo.motherName
value: userInfo.motherInfo.firstName
},
{
title: 'نام خانوادگی',
value: userInfo.motherFamilyName
value: userInfo.motherInfo.lastName
},
{
title: 'کدملی',
value: userInfo.motherNationalId
value: userInfo.motherInfo.nationalId
},
{
title: 'مدرک تحصیلی',
value: userInfo.motherMajor
value: madraks.find(itm => itm.id == userInfo.motherInfo.education)?.title
},
{
title: 'تلفن همراه',
value: userInfo.motherPhoneNumber
value: userInfo.motherInfo.cellphone
},
{
title: 'شغل',
value: userInfo.motherJob
value: userInfo.motherInfo.job
},
{
title: 'محل کار',
value: userInfo.motherJobAddress
value: userInfo.motherInfo.workPlace
},
{
title: 'تلفن محل کار',
value: userInfo.motherJobPhoneNumber
value: userInfo.motherInfo.workPhone
},
{
title: 'تعداد افراد خانواده',
value: userInfo.familyNumber
value: userInfo.familyMemberCount
},
{
title: 'نشانی محل سکونت',
@ -165,7 +276,7 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
},
{
title: 'تلفن ثابت',
value: userInfo.homePhoneNumber
value: userInfo.phone
},
];
@ -212,10 +323,7 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
},
]
const grades = [
{
id: 0,
title: ''
},
{
id: 1,
title: 'پایه اول'
@ -268,15 +376,30 @@ 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 (
<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 ">
{/* form */}
{console.log(userInfo)}
{/* Content */}
@ -287,38 +410,74 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<div className="w-full border-b border-solid border-gray-200">
<div className="mb-4 flex w-full justify-between font-black text-red52">
<h1 className="">مشخصات هویتی دانش آموز</h1>
<p>مرحله ۱ از ۴</p>
<p>مرحله ۱ از ۴</p>
</div>
<div className="flex w-full 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" gapSize="16" id={2} />
<Input title="نام خانوادگی" borderType="rounded" id={3} direction='rtl' />
<Input title="تاریخ تولد" borderType="rounded" gapSize="16" id={4} type='number' />
<br></br>
<FileInput title="بارگزاری صفحه اول شناسنامه" id={1} />
<br></br>
<FileInput title="بارگزاری عکس پرسنلی" id={2} />
<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>
}
}
render={<CostumeDatePickerInput title='تاریخ تولد' />}
/>
<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>
<FileInput title="بارگزاری صفحه اول شناسنامه" id={1} mobile />
<br></br>
<FileInput title="بارگزاری عکس پرسنلی" id={2} mobile />
<br></br>
</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">
<h1 className="font-black">پایه تحصیلی</h1>
<p className="font-bold text-gray-300 text-sm">لطفا پایه تحصیلی دانش آموز را وارد کنید</p>
</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) => (
<option key={`Grade__${item.id}`}>{item.title}</option>
<option key={`Grade__${item.id}`} value={item.id}>{item.title}</option>
))}
</select>
</div>
@ -328,15 +487,39 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<p className="font-bold text-gray-300 text-sm">اطلاعات هویتی دانش آموز را با دقت تکمیل و عکس مدارک را بارگزاری نمایید</p>
</div>
<div className="flex flex-col items-center">
<Input title="نام مدرسه" borderType="rounded" gapSize="20" direction='rtl' id={5} />
<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>
))}
<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 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>
<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 className="flex pt-10 justify-end">
@ -344,31 +527,16 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<Button borderType='rounded' title='مرحله بعد' onClick={() => {
const inputs = document.querySelectorAll('.Login-box-form-item-input')
// if (inputs[0].value) {
setSteps(1)
setActiveStep([true, true, false, false])
setError('')
setSteps(1)
setActiveStep([true, true, false, false])
setError('')
// } else {
// 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>
@ -378,9 +546,9 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
steps == 1 &&
<form className="w-full">
<div className="mb-4 flex w-full justify-between font-black text-red52">
<h1 className="">مشخصات هویتی خانواده دانش آموز</h1>
<p>مرحله ۲ از ۴</p>
</div>
<h1 className="">مشخصات هویتی خانواده دانش آموز</h1>
<p>مرحله ۲ از ۴</p>
</div>
<div className="w-full pb-6 border-b border-solid border-gray-200">
<div className="mb-4">
<h1 className="font-black">مشخصات هویتی پدر</h1>
@ -389,26 +557,51 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<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 title="شغل" borderType="rounded" direction='rtl' gapSize="8" id={5} />
<Input className={'w-full'} title="تلفن همراه" borderType="rounded" max={11} id={3} value={userInfo.fatherInfo.cellphone} onChange={e => setUserInfo({
...userInfo, fatherInfo: {
...userInfo.fatherInfo,
cellphone: _onInput.phonenumber(e.target.value)
}
})} />
<Input className={'w-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 title="تلفن محل کار" borderType="rounded" gapSize="28" id={7} type='number' />
<Input className={'w-full'} title="محل کار" borderType="rounded" id={5} direction='rtl' value={userInfo.fatherInfo.workPlace}
onChange={e => setUserInfo({ ...userInfo, fatherInfo: { ...userInfo.fatherInfo, workPlace: e.target.value } })} />
<Input className={'w-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">
<Input title="نام" borderType="rounded" gapSize="8" direction='rtl' id={8} />
<Input title="کدملی" borderType="rounded" gapSize="12" id={9} type='number' />
<Input className={'w-full'} title="نام" borderType="rounded" gapSize="8" direction='rtl' id={7} value={userInfo.motherInfo.firstName}
onChange={e => setUserInfo({ ...userInfo, motherInfo: { ...userInfo.motherInfo, firstName: _onInput.noNumber(e.target.value) } })} />
<Input 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 title="شغل" borderType="rounded" direction='rtl' gapSize="8" id={13} />
<Input title="محل کار" borderType="rounded" id={14} direction='rtl' />
<Input title="تلفن محل کار" borderType="rounded" gapSize="28" id={15} type='number' />
<Input className={'w-full'} title="تلفن همراه" borderType="rounded" type='text' id={10} max={11} value={userInfo.motherInfo.cellphone}
onChange={e => setUserInfo({
...userInfo, motherInfo: {
...userInfo.motherInfo,
cellphone: _onInput.phonenumber(e.target.value)
}
})} />
<Input className={'w-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 className={'w-full'} title="محل کار" borderType="rounded" id={12} direction='rtl'
value={userInfo.motherInfo.workPlace}
onChange={e => setUserInfo({
...userInfo, motherInfo: {
...userInfo.motherInfo,
workPlace: e.target.value
}
})} />
<Input className={'w-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)
}
})} />
@ -458,21 +686,16 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<p className="font-bold text-gray-300 text-sm">در این قسمت مشخص کنید دانشس آموز به همراه چه کسانی زندگی میکند </p>
</div>
<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} />
</div>
@ -487,46 +710,13 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
<div className="w-1/2 mr-2">
<Button borderType='rounded' title='مرحله بعد' onClick={() => {
const inputs = document.querySelectorAll('.Login-box-form-item-input')
// if (inputs[0].value) {
setSteps(2);
setActiveStep([true, true, true, false])
setSteps(2);
// } 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,
}
})
setActiveStep([true, true, true, false])
}} />
</div>
</div>
@ -540,13 +730,13 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
steps == 2 &&
<>
<div className="w-full pb-6 border-b border-solid border-gray-200">
<div className="mb-4 flex w-full justify-between font-black text-red52">
<div className="mb-4 flex w-full justify-between font-black text-red52">
<h1 className="">تایید قوانین و مقررات</h1>
<p>مرحله ۳ از ۴</p>
<p>مرحله ۳ از ۴</p>
</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,16 +753,21 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
</div>
<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">
اینجانبان
<span className="text-red52 font-bold"> {userInfo.fatherName} {userInfo.fatherFamilyName} </span>
و
<span className="text-red52 font-bold"> {userInfo.motherName} {userInfo.motherFamilyName} </span>
سرپرست های دانش آموز
<span className="text-red52 font-bold"> {userInfo.name} {userInfo.familyName} </span>
با قوانین و مقررات موافقت نموده و تمامی موارد به عهده اینجانب میباشد
</label>
اینجانبان
<span className="text-red52 font-bold"> {userInfo.fatherInfo.firstName} {userInfo.fatherInfo.lastName} </span>
و
<span className="text-red52 font-bold"> {userInfo.motherInfo.firstName} {userInfo.motherInfo.lastName} </span>
سرپرست های دانش آموز
<span className="text-red52 font-bold"> {userInfo.firstName} {userInfo.lastName} </span>
با قوانین و مقررات موافقت نموده و تمامی موارد به عهده اینجانب میباشد
</label>
</div>
<div className="w-full flex pt-10 justify-between">
<div className="w-1/2 ml-2">
@ -598,68 +793,68 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
steps == 3 &&
<>
<div className="w-full pb-6">
<div className="mb-4 flex w-full justify-between font-black text-red52">
<div className="mb-4 flex w-full justify-between font-black text-red52">
<h1 className="">تایید اطلاعات</h1>
<p>مرحله ۴ از ۴</p>
<p>مرحله ۴ از ۴</p>
</div>
<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>
{
finalViewInfo.slice(0,8).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
<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>
{
finalViewInfo.slice(8,16).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
<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>
{
finalViewInfo.slice(16,24).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
<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>
{
finalViewInfo.slice(24,27).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
</div>
<h1 className="font-bold mb-2 text-lg">مشخصات دانش آموز</h1>
{
finalViewInfo.slice(0, 8).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
<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>
{
finalViewInfo.slice(8, 16).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
<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>
{
finalViewInfo.slice(16, 24).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
<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>
{
finalViewInfo.slice(24, 27).map(item => (
<div className="flex items-center">
<h3 className="text-red26 font-bold">{item.title}</h3> : <p className="mr-2 text-red52">{item.value}</p>
</div>
))
}
</div>
</div>
<div className="w-full flex pt-10 justify-between">
<div className="w-1/2 ml-2">
<Button borderType='rounded' title='بازگشت به مرحله قبل' type='outlined' onClick={() => {
setSteps(2)
setActiveStep([true, true, true, false])
}} />
</div>
<div className="w-full flex pt-10 justify-between">
<div className="w-1/2 ml-2">
<Button borderType='rounded' title='بازگشت به مرحله قبل' type='outlined' onClick={() => {
setSteps(2)
setActiveStep([true, true, true, false])
}} />
</div>
<div className="w-1/2 mr-2">
<Button borderType='rounded' title='ورود' to='/' onClick={() =>
activeLogin()
} />
</div>
<div className="w-1/2 mr-2">
<Button borderType='rounded' title='تایید' to='/' onClick={() =>
setProfile(userInfo)
} />
</div>
</div>
</>
@ -676,7 +871,16 @@ const MobileRegister = ({ activeLogin, isMobile }) => {
};
const mapStateToProps = (state) => ({
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,
videos,
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({
search: "",
grade: "",
@ -55,6 +66,7 @@ const Services = ({
classMinute: "",
});
const [sharzhVal, setSharzhVal] = useState('');
const [selectedProductTypes, setSelectedProductTypes] = useState([1]);
// const onChange = (name, value) => {
// setFilter({ ...filter, [name]: value });
// };
@ -105,7 +117,9 @@ const Services = ({
const [gameId, setGameId] = useState(1);
const chooseGame = (id) => {
setGameId(id);
console.log(selectedProductTypes)
};
console.log(gameId)
if (!isMobile) {
return (
<div
@ -160,6 +174,7 @@ const Services = ({
selectedGames={selectedGames}
gameId={gameId}
chooseGame={chooseGame}
setTypes={val => setSelectedProductTypes(val)}
/>
</div>
{/* filters */}
@ -223,19 +238,26 @@ const Services = ({
</svg>
</div>
<div className="flex items-center mx-6 pl-6 border-l-2 border-gray-300">
{
filterCheck.map((filter) => (
<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
hover:border-red52 hover:text-red52 hover:bg-pinkF5
${filterCheck == 'Online'
${selectedFilters.includes(filter.id)
? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400"
}`}
onClick={(prevState) =>
setFilterCheck('Online')
}
onClick={(prevState) =>{
if(selectedFilters.includes(filter.id)){
setSelectedFilters(selectedFilters.filter(itm => itm !== filter.id))
}else{
setSelectedFilters([...selectedFilters, filter.id])
}
}}
>
<h3>آنلاین</h3>
{filterCheck == 'Online' && (
<h3>{filter.title}</h3>
{selectedFilters.includes(filter.id) && (
<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
@ -259,7 +281,9 @@ const Services = ({
)}
</div>
<div
))
}
{/* <div
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
${filterCheck == 'Physical'
@ -294,12 +318,12 @@ const Services = ({
)}
</div>
</div> */}
</div>
<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) => (
<option key={`Grade__${index}`}>{item.title}</option>
))}
@ -309,9 +333,9 @@ const Services = ({
<div
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
// to={"/class/" + product?.id}
@ -327,7 +351,7 @@ const Services = ({
index={Number(index)}
productName={`${product?.name}`}
productCat={`پایه ${grades[product?.gradeId]}`}
productPrice={separate(product?.product[0]?.price)}
productPrice={separate(product?.price)}
// productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
numberOfRegards={160}
productHolderBorder=""
@ -342,7 +366,7 @@ const Services = ({
teacher: product?.vodTeacher,
description:
"در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت",
price: gameId == 3 ? 0 : product?.product[0]?.price,
price: gameId == 2 ? 0 : product?.price,
classHour: 21,
classMinute: 56,
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)
}
console.log(gameId)
}}
btnOnClick={() => {
pushToCart({
productId: product?.id,
count: 1,
});
if(selectedProductTypes.includes(7)){
pushSchoolToCart({
productId: product?.id,
count: 1,
})
}
else{
pushToCart({
productId: product?.id,
count: 1,
});
}
// console.log(gameId)
setTimeout(() => setPopUp(false), 0)
console.log(popup)
console.log(product.id)
// console.log(popup)
// console.log(product.id)
}
}
/>
@ -391,13 +426,13 @@ const Services = ({
))}
{
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>
<p className="text-red26 text-sm">لطفا مبلغ دلخواه خود را در کادر روبرو وارد کنید</p>
</div>
<div className="flex">
<div className="flex mx-1">
<input
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"
@ -405,7 +440,7 @@ const Services = ({
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>
</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>
<input
placeholder="شارژ حساب"
@ -413,7 +448,7 @@ const Services = ({
/>
</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>
}
@ -430,11 +465,12 @@ const Services = ({
return (
<div className="flex flex-col items-center mt-16 mb-40 rtl">
<Games
selectedGames={selectedGames}
gameId={gameId}
chooseGame={chooseGame}
/>
<Games
selectedGames={selectedGames}
gameId={gameId}
chooseGame={chooseGame}
setTypes={val => setSelectedProductTypes(val)}
/>
<div className="w-11/12 border-b border-gray-200"></div>
{
@ -495,78 +531,51 @@ const Services = ({
</g>
</g>
</svg>
<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 == 'Online'
? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400"
}`}
onClick={(prevState) =>
setFilterCheck('Online')
}
>
<h3>آنلاین</h3>
{filterCheck == 'Online' && (
<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
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>
{
filterCheck.map((filter) => (
<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
hover:border-red52 hover:text-red52 hover:bg-pinkF5
${selectedFilters.includes(filter.id)
? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400"
}`}
onClick={(prevState) =>{
if(selectedFilters.includes(filter.id)){
setSelectedFilters(selectedFilters.filter(itm => itm !== filter.id))
}else{
setSelectedFilters([...selectedFilters, filter.id])
}
}}
>
<h3>{filter.title}</h3>
{selectedFilters.includes(filter.id) && (
<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>
}
<div className="w-11/12 border-b border-gray-200"></div>
@ -574,78 +583,95 @@ const Services = ({
<div
className={`flex items-center w-full justify-center flex-col `}
>
{books?.map((product, index) => (
<Link
// to={"/class/" + product?.id}
to="#"
key={`PRODUCT__${gameId}__${index}`}
onClick={() => {
setPopUpContent({
id: gameId,
title: product?.name,
video: "",
teacher: product.vodTeacher,
description:
"در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت",
price: product.product[0].price,
classHour: 21,
classMinute: 56,
image: 'https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg',
examCont: [
{
title: 'بخش اول آزمون ' + product.name,
date: '۱۴۰۰/۱۲/۱۳',
time: '۱۴:۴۶',
numberOfQ: '۱۸',
price: 10000
},
{
title: 'بخش دوم آزمون ' + product.name,
date: '۱۴۰۰/۱۲/۱۴',
time: '۱۴:۴۶',
numberOfQ: '۱۸',
price: 10000
},
{
title: 'بخش سوم آزمون ' + product.name,
date: '۱۴۰۰/۱۲/۱۵',
time: '۱۴:۴۶',
numberOfQ: '۳۲',
price: 250000
},
]
});
setPopUp(true);
// console.log(gameId)
}}
>
{console.log(product)}
<Product
key={index}
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,
// userId: product?.userId,
count: 1,
})
{ books?.filter(itm => selectedProductTypes.includes(itm.productType)).map((product, index) => (
<div
// to={"/class/" + product?.id}
key={`PRODUCT__${gameId}__${index}`}
}
/>
</Link>
))}
>
{/* {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={() => {
setPopUpContent({
id: gameId,
title: product?.name,
video: "",
teacher: product?.vodTeacher,
description:
"در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت",
price: gameId == 2 ? 0 : product?.price,
classHour: 21,
classMinute: 56,
image: 'https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg',
examCont: [
{
title: 'بخش اول آزمون ' + product.name,
date: '۱۴۰۰/۱۲/۱۳',
time: '۱۴:۴۶',
numberOfQ: '۱۸',
price: 10000
},
{
title: 'بخش دوم آزمون ' + product.name,
date: '۱۴۰۰/۱۲/۱۴',
time: '۱۴:۴۶',
numberOfQ: '۱۸',
price: 10000
},
{
title: 'بخش سوم آزمون ' + product.name,
date: '۱۴۰۰/۱۲/۱۵',
time: '۱۴:۴۶',
numberOfQ: '۳۲',
price: 250000
},
]
});
if (gameId !== 5) {
setPopUp(true)
}
console.log(gameId)
}}
btnOnClick={() => {
if(selectedProductTypes.includes(7)){
pushSchoolToCart({
productId: product?.id,
count: 1,
})
}
else{
pushToCart({
productId: product?.id,
count: 1,
});
}
// console.log(gameId)
setTimeout(() => setPopUp(false), 0)
// console.log(popup)
// console.log(product.id)
}
}
/>
</div>
))}
{
gameId == 6 &&
<div className="w-full p-8 py-10 flex flex-col justify-between items-center " >
@ -699,6 +725,7 @@ const mapDispatchToProps = {
gradeFilter: book.gradeFilter,
setHeaderOptions: publicApi.setHeaderOptions,
pushToCart: userProduct.add,
pushSchoolToCart: userProduct.addSchool,
};
export default connect(mapStateToProps, mapDispatchToProps)(Services);

@ -24,10 +24,10 @@ const servicePopUp = ({
</div>
</div>
<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">
{content.id === 1 ? 'کلاس آنلاین ' : content.id === 4 ? 'کتاب ' : null}
{content.id === 4 ? 'کلاس آنلاین ' : content.id === 1 ? 'کتاب ' : null}
{content.title}</h1>
<p className="text-red26 text-sm my-2">
@ -54,7 +54,7 @@ const servicePopUp = ({
</div>}
{
content.id === 3 &&
content.id === 2 &&
<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>
<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>
}
{content.id === 1 && <video className="w-1/2 rounded-md" controls>
{content.id === 3 && <video className="w-1/2 rounded-md" controls>
<source
src={`https://dnvn.ir/api/v1/file/20540`}
type="video/mp4"
@ -97,7 +97,7 @@ const servicePopUp = ({
</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 className="flex w-full items-center justify-start mb-8" style={{direction: 'ltr'}}>

@ -1412,6 +1412,11 @@
"schema-utils" "^3.0.0"
"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":
"integrity" "sha512-tctjW98NjIN/BaZO42r0ZPx63H41EubU/n+E9nS1zS/3K/xrILQU5s+UP0WqEYoBFNs/mMI7pTJWsxV4WUhdDg=="
"resolved" "https://registry.npmjs.org/@react-pdf-viewer/core/-/core-3.1.2.tgz"
@ -6106,6 +6111,11 @@
dependencies:
"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":
"integrity" "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A=="
"resolved" "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz"
@ -7732,7 +7742,7 @@
"strip-ansi" "^6.0.1"
"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=="
"resolved" "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz"
"version" "17.0.2"
@ -7800,6 +7810,13 @@
"resolved" "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz"
"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":
"integrity" "sha512-oaBdIlyu+g7PhLUvwnCsl/wvu+5tGB9I3RLjcrYLt6U1sUMzQJqplKtVxXRv9TZqRdNaAU5qNOP+dRs55QKjsA=="
"resolved" "https://registry.npmjs.org/react-mapbox-gl-draw/-/react-mapbox-gl-draw-2.0.4.tgz"
@ -7937,7 +7954,7 @@
dependencies:
"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=="
"resolved" "https://registry.npmjs.org/react/-/react-17.0.2.tgz"
"version" "17.0.2"

Loading…
Cancel
Save