@ -1,9 +1,8 @@
import React , { useEffect , useState } from "react" ;
import React , { useEffect , useState } from "react" ;
import Class from "../../components/products/classes" ;
import { book , publicApi , userProduct } from "../../redux/actions" ;
import { book , publicApi , userProduct } from "../../redux/actions" ;
import { connect } from 'react-redux' ;
import { connect } from "react-redux" ;
import { Link } from "react-router-dom" ;
import { Link } from "react-router-dom" ;
import Product from '../../components/Product' ;
import Product from "../../components/Product" ;
import img1 from "../../assets/img/Group 1344.svg" ;
import img1 from "../../assets/img/Group 1344.svg" ;
import img2 from "../../assets/img/Group 1345.svg" ;
import img2 from "../../assets/img/Group 1345.svg" ;
@ -16,7 +15,8 @@ import ServicePopUp from "./service";
import Games from "../dashboard2/Games" ;
import Games from "../dashboard2/Games" ;
import Packages from "../dashboard2/Packages" ;
import Packages from "../dashboard2/Packages" ;
const Services = ( { isMobile ,
const Services = ( {
isMobile ,
books ,
books ,
getList ,
getList ,
grades ,
grades ,
@ -26,9 +26,16 @@ const Services = ({ isMobile,
setHeaderOptions ,
setHeaderOptions ,
headerOptions ,
headerOptions ,
videos ,
videos ,
pushToCart
pushToCart ,
} ) => {
} ) => {
const [ checked , setChecked ] = useState ( [ false , false , false , false , false , false ] ) ;
const [ checked , setChecked ] = useState ( [
false ,
false ,
false ,
false ,
false ,
false ,
] ) ;
const [ filterCheck , setFilterCheck ] = useState ( [ false , false , false , false ] ) ;
const [ filterCheck , setFilterCheck ] = useState ( [ false , false , false , false ] ) ;
const [ filter , setFilter ] = useState ( {
const [ filter , setFilter ] = useState ( {
search : "" ,
search : "" ,
@ -36,17 +43,16 @@ const Services = ({ isMobile,
productsType : "کتاب" ,
productsType : "کتاب" ,
} ) ;
} ) ;
const [ popup , setPopUp ] = useState ( false )
const [ popup , setPopUp ] = useState ( false ) ;
const [ popUpContent , setPopUpContent ] = useState ( {
const [ popUpContent , setPopUpContent ] = useState ( {
title : '' ,
title : "" ,
video : '' ,
video : "" ,
description : '' ,
description : "" ,
price : '' ,
price : "" ,
teacher : '' ,
teacher : "" ,
classHour : '' ,
classHour : "" ,
classMinute : ''
classMinute : "" ,
} ) ;
} )
const onChange = ( name , value ) => {
const onChange = ( name , value ) => {
setFilter ( { ... filter , [ name ] : value } ) ;
setFilter ( { ... filter , [ name ] : value } ) ;
@ -63,34 +69,34 @@ const Services = ({ isMobile,
const services = [
const services = [
{
{
title : 'کلاس های آموزشی' ,
title : "کلاس های آموزشی" ,
image : img1 ,
image : img1 ,
role : ''
role : "" ,
} ,
} ,
{
{
title : 'پیش ثبت نام مدارس' ,
title : "پیش ثبت نام مدارس" ,
image : img2 ,
image : img2 ,
role : ''
role : "" ,
} ,
} ,
{
{
title : 'بسته های آزمون' ,
title : "بسته های آزمون" ,
image : img3 ,
image : img3 ,
role : ''
role : "" ,
} ,
} ,
{
{
title : 'کتاب های آموزشی' ,
title : "کتاب های آموزشی" ,
image : img4 ,
image : img4 ,
role : ''
role : "" ,
} ,
} ,
{
{
title : 'دوره های مجازی' ,
title : "دوره های مجازی" ,
image : img5 ,
image : img5 ,
role : ''
role : "" ,
} ,
} ,
{
{
title : 'سایر خدمات' ,
title : "سایر خدمات" ,
image : img6 ,
image : img6 ,
role : ''
role : "" ,
} ,
} ,
] ;
] ;
@ -101,11 +107,24 @@ const Services = ({ isMobile,
} ;
} ;
return (
return (
< div className = "flex items-start justify-between" style = { { width : '93.5%' , direction : 'rtl' } } >
< div
{ popup ? < ServicePopUp content = { popUpContent } closeOnClick = { ( ) => setPopUp ( false ) } / > : null }
className = "flex items-start justify-between"
< div className = "w-3/4 flex flex-col justify-center " style = { { marginTop : '5.5%' } } >
style = { { width : "93.5%" , direction : "rtl" } }
>
< div className = "relative h-48 w-full border-b border-red82OP px-10" style = { { direction : 'ltr' } } >
{ popup ? (
< ServicePopUp
content = { popUpContent }
closeOnClick = { ( ) => setPopUp ( false ) }
/ >
) : null }
< div
className = "w-3/4 flex flex-col justify-center "
style = { { marginTop : "5.5%" } }
>
< div
className = "relative h-48 w-full border-b border-red82OP px-10"
style = { { direction : "ltr" } }
>
{ / * {
{ / * {
services . map ( ( item , index ) => (
services . map ( ( item , index ) => (
< div
< div
@ -144,91 +163,193 @@ const Services = ({ isMobile,
{ /* filters */ }
{ /* filters */ }
< div className = "flex mx-2 my-4 justify-center" >
< div className = "flex mx-2 my-4 justify-center" >
< div className = "flex items-center " >
< div className = "flex items-center " >
< svg xmlns = "http://www.w3.org/2000/svg" width = "40" height = "40" viewBox = "0 0 14.378 14.378" >
< svg
< g id = "vuesax_linear_filter-tick" data - name = "vuesax/linear/filter-tick" transform = "translate(-620 -700)" >
xmlns = "http://www.w3.org/2000/svg"
width = "40"
height = "40"
viewBox = "0 0 14.378 14.378"
>
< g
id = "vuesax_linear_filter-tick"
data - name = "vuesax/linear/filter-tick"
transform = "translate(-620 -700)"
>
< g id = "filter-tick" transform = "translate(620 700)" >
< g id = "filter-tick" transform = "translate(620 700)" >
< path id = "Vector" d = "M5.691,2.846a2.8,2.8,0,0,1-.407,1.468A2.836,2.836,0,0,1,2.846,5.691,2.768,2.768,0,0,1,1.312,5.23a2.685,2.685,0,0,1-.9-.917A2.807,2.807,0,0,1,0,2.846,2.848,2.848,0,0,1,2.846,0a2.648,2.648,0,0,1,.623.072A2.84,2.84,0,0,1,5.691,2.846Z" transform = "translate(7.267 5.991)" fill = "none" stroke = "#696969" stroke - linecap = "round" stroke - linejoin = "round" stroke - width = "0.6" / >
< path
< path id = "Vector-2" data - name = "Vector" d = "M0,.7l.7.7L2.217,0" transform = "translate(9.004 8.136)" fill = "none" stroke = "#696969" stroke - linecap = "round" stroke - linejoin = "round" stroke - width = "0.6" / >
id = "Vector"
< path id = "Vector-3" data - name = "Vector" d = "M0,0H14.378V14.378H0Z" transform = "translate(14.378 14.378) rotate(180)" fill = "none" opacity = "0" / >
d = "M5.691,2.846a2.8,2.8,0,0,1-.407,1.468A2.836,2.836,0,0,1,2.846,5.691,2.768,2.768,0,0,1,1.312,5.23a2.685,2.685,0,0,1-.9-.917A2.807,2.807,0,0,1,0,2.846,2.848,2.848,0,0,1,2.846,0a2.648,2.648,0,0,1,.623.072A2.84,2.84,0,0,1,5.691,2.846Z"
transform = "translate(7.267 5.991)"
fill = "none"
stroke = "#696969"
stroke - linecap = "round"
stroke - linejoin = "round"
stroke - width = "0.6"
/ >
< path
id = "Vector-2"
data - name = "Vector"
d = "M0,.7l.7.7L2.217,0"
transform = "translate(9.004 8.136)"
fill = "none"
stroke = "#696969"
stroke - linecap = "round"
stroke - linejoin = "round"
stroke - width = "0.6"
/ >
< path
id = "Vector-3"
data - name = "Vector"
d = "M0,0H14.378V14.378H0Z"
transform = "translate(14.378 14.378) rotate(180)"
fill = "none"
opacity = "0"
/ >
< g id = "Group" transform = "translate(1.983 1.198)" >
< g id = "Group" transform = "translate(1.983 1.198)" >
< path id = "Vector-4" data - name = "Vector" d = "M10.412,1.21V2.54a2.292,2.292,0,0,1-.605,1.4l-1.054.929a2.648,2.648,0,0,0-.623-.072A2.848,2.848,0,0,0,5.284,7.638,2.807,2.807,0,0,0,5.7,9.106a2.685,2.685,0,0,0,.9.917v.2a1.336,1.336,0,0,1-.545,1.03l-.845.545a1.233,1.233,0,0,1-1.875-1.03V7.567A2.342,2.342,0,0,0,2.846,6.3l-2.3-2.42A2.041,2.041,0,0,1,0,2.666V1.27A1.229,1.229,0,0,1,1.21,0H9.2A1.215,1.215,0,0,1,10.412,1.21Z" fill = "none" stroke = "#696969" stroke - linecap = "round" stroke - linejoin = "round" stroke - width = "0.6" / >
< path
id = "Vector-4"
data - name = "Vector"
d = "M10.412,1.21V2.54a2.292,2.292,0,0,1-.605,1.4l-1.054.929a2.648,2.648,0,0,0-.623-.072A2.848,2.848,0,0,0,5.284,7.638,2.807,2.807,0,0,0,5.7,9.106a2.685,2.685,0,0,0,.9.917v.2a1.336,1.336,0,0,1-.545,1.03l-.845.545a1.233,1.233,0,0,1-1.875-1.03V7.567A2.342,2.342,0,0,0,2.846,6.3l-2.3-2.42A2.041,2.041,0,0,1,0,2.666V1.27A1.229,1.229,0,0,1,1.21,0H9.2A1.215,1.215,0,0,1,10.412,1.21Z"
fill = "none"
stroke = "#696969"
stroke - linecap = "round"
stroke - linejoin = "round"
stroke - width = "0.6"
/ >
< / g >
< / g >
< / g >
< / g >
< / g >
< / g >
< / s v g >
< / s v g >
< / d i v >
< / d i v >
< div className = "flex items-center mx-4 pl-6 border-l-2 border-gray-300" >
< div className = "flex items-center mx-4 pl-6 border-l-2 border-gray-300" >
< div
< div
className = { ` flex w-32 border-2 p-2 mx-2 justify-center items-center rounded-md cursor-pointer
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
hover : border - red52 hover : text - red52 hover : bg - pinkF5
$ { filterCheck [ 0 ] ? 'border-red52 text-red52 bg-pinkF5' : 'border-gray200 text-gray-400' } ` }
$ {
onClick = { prevState => setFilterCheck ( [ ... prevState , filterCheck [ 0 ] = ! filterCheck [ 0 ] ] ) }
filterCheck [ 0 ]
? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400"
} ` }
onClick = { ( prevState ) =>
setFilterCheck ( [
... prevState ,
( filterCheck [ 0 ] = ! filterCheck [ 0 ] ) ,
] )
}
>
>
< h3 > آنلاین < / h 3 >
< h3 > آنلاین < / h 3 >
{
{ filterCheck [ 0 ] && (
filterCheck [ 0 ] && < div className = "flex w-full" style = { { direction : 'ltr' } } >
< div className = "flex w-full" style = { { direction : "ltr" } } >
< div className = "w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52" >
< div className = "w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52" >
< svg
< svg width = "37" height = "37" viewBox = "0 0 24 24" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
width = "37"
< path d = "M7.75 12L10.58 14.83L16.25 9.17004" stroke = "#fff" stroke - width = "1.5" stroke - linecap = "round" stroke - linejoin = "round" / >
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"
stroke - width = "1.5"
stroke - linecap = "round"
stroke - linejoin = "round"
/ >
< / s v g >
< / s v g >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
}
) }
< / d i v >
< / d i v >
< 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 [ 1 ] ? 'border-red52 text-red52 bg-pinkF5' : 'border-gray200 text-gray-400' } ` } >
< 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 [ 1 ]
? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400"
} ` }
>
< h3 > حضوری < / h 3 >
< h3 > حضوری < / h 3 >
{
{ filterCheck [ 1 ] && (
filterCheck [ 1 ] && < div className = "flex w-full" style = { { direction : 'ltr' } } >
< div className = "flex w-full" style = { { direction : "ltr" } } >
< div className = "w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52" >
< div className = "w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52" >
< svg
< svg width = "37" height = "37" viewBox = "0 0 24 24" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
width = "37"
< path d = "M7.75 12L10.58 14.83L16.25 9.17004" stroke = "#fff" stroke - width = "1.5" stroke - linecap = "round" stroke - linejoin = "round" / >
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"
stroke - width = "1.5"
stroke - linecap = "round"
stroke - linejoin = "round"
/ >
< / s v g >
< / s v g >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
}
) }
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< div className = "flex items-center mx-4 pl-6 border-l-2 border-gray-300" >
< div className = "flex items-center mx-4 pl-6 border-l-2 border-gray-300" >
< 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 [ 2 ] ? 'border-red52 text-red52 bg-pinkF5' : 'border-gray200 text-gray-400' } ` } >
< 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 [ 2 ]
? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400"
} ` }
>
< h3 > دختران < / h 3 >
< h3 > دختران < / h 3 >
{
{ filterCheck [ 2 ] && (
filterCheck [ 2 ] && < div className = "flex w-full" style = { { direction : 'ltr' } } >
< div className = "flex w-full" style = { { direction : "ltr" } } >
< div className = "w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52" >
< div className = "w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52" >
< svg
< svg width = "37" height = "37" viewBox = "0 0 24 24" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
width = "37"
< path d = "M7.75 12L10.58 14.83L16.25 9.17004" stroke = "#fff" stroke - width = "1.5" stroke - linecap = "round" stroke - linejoin = "round" / >
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"
stroke - width = "1.5"
stroke - linecap = "round"
stroke - linejoin = "round"
/ >
< / s v g >
< / s v g >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
}
) }
< / d i v >
< / d i v >
< 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 [ 3 ] ? 'border-red52 text-red52 bg-pinkF5' : 'border-gray200 text-gray-400' } ` } >
< 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 [ 3 ]
? "border-red52 text-red52 bg-pinkF5"
: "border-gray200 text-gray-400"
} ` }
>
< h3 > پسران < / h 3 >
< h3 > پسران < / h 3 >
{
{ filterCheck [ 3 ] && (
filterCheck [ 3 ] && < div className = "flex w-full" style = { { direction : 'ltr' } } >
< div className = "flex w-full" style = { { direction : "ltr" } } >
< div className = "w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52" >
< div className = "w-4 h-4 text-white text-sm rounded-full flex justify-center items-center bg-red52" >
< svg
< svg width = "37" height = "37" viewBox = "0 0 24 24" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
width = "37"
< path d = "M7.75 12L10.58 14.83L16.25 9.17004" stroke = "#fff" stroke - width = "1.5" stroke - linecap = "round" stroke - linejoin = "round" / >
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"
stroke - width = "1.5"
stroke - linecap = "round"
stroke - linejoin = "round"
/ >
< / s v g >
< / s v g >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
}
) }
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< div className = "flex items-center mx-4 pl-6" >
< div className = "flex items-center mx-4 pl-6" >
@ -238,25 +359,28 @@ const Services = ({ isMobile,
) ) }
) ) }
< / s e l e c t >
< / s e l e c t >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< div className = { ` flex ${ gameId == 2 && 'flex-col' } items-center w-full justify-center flex-wrap ` } >
< div
className = { ` flex ${
gameId == 2 && "flex-col"
} items - center w - full justify - center flex - wrap ` }
>
{ books ? . map ( ( product , index ) => (
{ books ? . map ( ( product , index ) => (
< Link
< Link
// to={"/class/" + product?.id}
// to={"/class/" + product?.id}
to = '#'
to = "#"
onClick = { ( ) => {
onClick = { ( ) => {
setPopUpContent ( {
setPopUpContent ( {
title : product ? . name ,
title : product ? . name ,
video : '' ,
video : "" ,
teacher : product . vodTeacher ,
teacher : product . vodTeacher ,
description : 'در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار می گیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت' ,
description :
"در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار می گیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت" ,
price : product . product [ 0 ] . price ,
price : product . product [ 0 ] . price ,
classHour : 21 ,
classHour : 21 ,
classMinute : 56
classMinute : 56 ,
} )
} ) ;
setPopUp ( true ) ;
setPopUp ( true ) ;
} }
} }
>
>
@ -271,28 +395,25 @@ const Services = ({ isMobile,
productPrice = { product . product [ 0 ] . price }
productPrice = { product . product [ 0 ] . price }
// productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
// productImg={"https://dnvn.ir/api/v1/file/" + product?.fileIds}
numberOfRegards = { 160 }
numberOfRegards = { 160 }
productHolderBorder = ''
productHolderBorder = ""
productHolderHoverBorder = 'shadow-md'
productHolderHoverBorder = "shadow-md"
teacher = { product . vodTeacher }
teacher = { product . vodTeacher }
catId = { gameId }
catId = { gameId }
btnOnClick = { ( ) =>
btnOnClick = { ( ) =>
pushToCart ( {
pushToCart ( {
productId : product ? . productId ,
productId : product ? . productId ,
userId : product ? . userId ,
userId : product ? . userId ,
count : 1 ,
count : 1 ,
} ) }
} )
}
/ >
/ >
< / L i n k >
< / L i n k >
) ) }
) ) }
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< div className = "w-1/4 fixed left-0" style = { { height : '100vh' } } >
< div className = "w-1/4 fixed left-0" style = { { height : "100vh" } } >
< ShoppingCart / >
< ShoppingCart / >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
) ;
) ;
} ;
} ;