diff --git a/src/App.js b/src/App.js index feba4ed..e4604f1 100644 --- a/src/App.js +++ b/src/App.js @@ -739,7 +739,7 @@ function App() { } /> } /> } /> - } /> + } /> {/* + + + + + + + + + + diff --git a/src/assets/img/research.png b/src/assets/img/research.png new file mode 100644 index 0000000..8af7fb3 Binary files /dev/null and b/src/assets/img/research.png differ diff --git a/src/assets/img/thinking.png b/src/assets/img/thinking.png new file mode 100644 index 0000000..8c05ba0 Binary files /dev/null and b/src/assets/img/thinking.png differ diff --git a/src/components/Product/index.js b/src/components/Product/index.js index 5483ec5..4f1d65c 100644 --- a/src/components/Product/index.js +++ b/src/components/Product/index.js @@ -1,3 +1,4 @@ +import moment from "jalali-moment"; import React, { useState } from "react"; import { BsExclamationSquareFill } from "react-icons/bs"; @@ -5,6 +6,8 @@ import { connect } from "react-redux"; import { Link } from "react-router-dom"; import imgPlaceHolder from "../../assets/img/photo-placeholder.png"; + +let groupType = ["A","B","AB","AB1"]; const ProductDesign = ({ colors, likeBtn, @@ -79,6 +82,7 @@ const ProductDesign = ({ }, ]; + let weekday =["شنبه","یک‌شنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنچشنبه","جمعه"] let description = "دستشویی,کتابخانه,آزمایشگاه"; if (catId == 3) { return ( @@ -88,7 +92,7 @@ const ProductDesign = ({ >

{productName}

-

{product?.description} -

+

*/} +
+ شروع از{" "} + {moment(product?.courseStartDate, "YYYY/MM/DD") + .locale("fa") + .format("YYYY/MM/DD")}{" "} + ، پایان در{" "} + {moment(product?.courseEndDate, "YYYY/MM/DD") + .locale("fa") + .format("YYYY/MM/DD")} +
+
+ روزهای برگزاری: +
+ {product?.courseDay.split(",")?.map((item, index) => ( +
{weekday[item]}،
+ ))} +
+
+
+ ساعت کلاس: از {product?.courseStartTime} تا {product?.courseEndTime} +
@@ -111,7 +136,7 @@ const ProductDesign = ({ className="flex border-b border-red82OP px-4 py-2 text-red26" // onClick={onClick} > -

نوع گروه : {product?.productType===4 ?"حضوری":"آنلاین"}

+

نوع گروه : {groupType[product?.categoryId - 1]}

@@ -150,10 +175,10 @@ const ProductDesign = ({ } if (catId == 5) { return ( -
+
diff --git a/src/components/ShoppingCart/index.js b/src/components/ShoppingCart/index.js index 959ecf7..0622b79 100644 --- a/src/components/ShoppingCart/index.js +++ b/src/components/ShoppingCart/index.js @@ -42,29 +42,17 @@ function ShoppingCart({ //handle payment response------------ let search = useLocation().search; let query = Object.fromEntries(new URLSearchParams(search)); - + const [paymentError, setPaymentError] = useState(false); useEffect(() => { if (query.status && window.innerWidth<1000) { if (query.status === "OK") { toast.success("پرداخت با موفقیت انجام شد"); } else { - toast.error( - `عملیات پرداخت موفق نبود. شناسه پیگیری شما ${query.authority} می‌باشد` - ); - // fireAlert({ - // title: "پرداخت ناموفق", - // text: `عملیات پرداخت موفق نبود. شناسه پیگیری شما ${query.authority} می‌باشد`, - // confirmButtonText: "توضیح بیشتر", - // showCancelButton: true, - // cancelButtonText: "متوجه شدم", - // showCloseButton: false, - // customClass: { - // title: "title-error-7", - // closeButton: "close-button-7", - // confirmButton: "confirm-button-7", - // cancelButton: "cancle-button7", - // }, - // }); + // toast.error( + // `عملیات پرداخت موفق نبود. شناسه پیگیری شما ${query.authority} می‌باشد` + // ); + setPaymentError(true); + } setShowPaymentBox(true); } @@ -129,7 +117,7 @@ function ShoppingCart({ className="w-full px-1 h-12 mt-1 text-white bg-red52 rounded-lg text-sm font-semibold" onClick={() => paySchool({ - redirectUrl: "http://localhost:3000/myServices", + redirectUrl: "https://new.andishmand.ir/services", }) } > @@ -236,7 +224,12 @@ function ShoppingCart({
{/* --------------payment-box------------------------------------- */} {showPaymentBoxM && ( - + )}
) : ( diff --git a/src/components/header/Header.js b/src/components/header/Header.js index 3ec965e..b05f778 100644 --- a/src/components/header/Header.js +++ b/src/components/header/Header.js @@ -61,13 +61,13 @@ const Header = ({ {UserData?.displayName || "نامشخص"} ({" "} {UserData?.job || "دانش آموز"} )
- setSubMenu(false)} className="w-full text-right border-b border-gray-200 py-2" > ورود به پنل ادمین - + */} {/* setSubMenu(false)} className='w-full text-right border-b border-gray-200 py-2'> ورود به صفحه افزودن آزمون */} @@ -117,7 +117,7 @@ const Header = ({ />
- + {" "} {" "} diff --git a/src/components/header/MobileSideMenu/index.js b/src/components/header/MobileSideMenu/index.js index 51e52e0..232df77 100644 --- a/src/components/header/MobileSideMenu/index.js +++ b/src/components/header/MobileSideMenu/index.js @@ -34,62 +34,62 @@ const MobileSideMenu = ({ const options = [ - { - icon: profileIcon, - activeIcon: profileIconActive, - title: 'مشخصات', - link: '/' - }, - { - icon: elementIcon, - activeIcon: elementIconActive, - title: 'انتخاب خدمات', - link: '/services' - }, - { - icon: taskIcon, - activeIcon: taskIconActive, - title: 'آزمون های من', - link: '' - }, - { - icon: bookIcon, - activeIcon: bookIconActive, - title: 'وبلاگ', - link: '' - }, - { - icon: elementIcon, - activeIcon: elementIconActive, - title: 'خدمات من', - link: '' - }, - { - icon: smsIcon, - activeIcon: smsIconActive, - title: 'پشتیبانی', - link: '/messages' - }, - { - icon: mapIcon, - activeIcon: mapIconActive, - title: 'اطلاعات تماس', - link: '/contacts' - }, - { - icon: radarIcon, - activeIcon: radarIconActive, - title: 'گزارش ایراد یا نقص فنی', - link: '' - }, - { - icon: exitIcon, - activeIcon: exitIcon, - title: 'خروج', - link: '', - onClick: () => logOut() - }, - ] + { + icon: profileIcon, + activeIcon: profileIconActive, + title: "مشخصات", + link: "/register", + }, + { + icon: elementIcon, + activeIcon: elementIconActive, + title: "انتخاب خدمات", + link: "/services", + }, + // { + // icon: taskIcon, + // activeIcon: taskIconActive, + // title: "آزمون های من", + // link: "", + // }, + // { + // icon: bookIcon, + // activeIcon: bookIconActive, + // title: "وبلاگ", + // link: "", + // }, + { + icon: elementIcon, + activeIcon: elementIconActive, + title: "خدمات من", + link: "/myServices", + }, + { + icon: smsIcon, + activeIcon: smsIconActive, + title: "پشتیبانی", + link: "/messages", + }, + { + icon: mapIcon, + activeIcon: mapIconActive, + title: "اطلاعات تماس", + link: "/contacts", + }, + // { + // icon: radarIcon, + // activeIcon: radarIconActive, + // title: "گزارش ایراد یا نقص فنی", + // link: "", + // }, + { + icon: exitIcon, + activeIcon: exitIcon, + title: "خروج", + link: "", + onClick: () => logOut(), + }, + ]; return (
diff --git a/src/components/nav/Nav.js b/src/components/nav/Nav.js index 24706aa..d5eaee5 100644 --- a/src/components/nav/Nav.js +++ b/src/components/nav/Nav.js @@ -22,44 +22,45 @@ import navIcon4_w from "../../assets/img/vuesax-linear-map2.svg"; // let oldNavItemId = 1; -const Nav = ({ - logOut, - isMobile, - isLogin, - logout -}) => { +const Nav = ({ logOut, isMobile, isLogin, logout }) => { let locationL = useLocation(); let location = locationL.pathname; - const [type, setType] = useState('default'); + const [type, setType] = useState("default"); const location2 = useLocation(); -useEffect(() => { - if(location2.pathname.includes('adminpanel')){ - setType('minimal'); - } - else{ - setType('default') - } - -}, [location2.pathname]) - + useEffect(() => { + if (location2.pathname.includes("adminpanel")) { + setType("minimal"); + } else { + setType("default"); + } + }, [location2.pathname]); let initai_navId = 1; - if(isMobile){ + // if(isMobile){ + useEffect(()=>{ if (location.includes("services")) { - initai_navId = 2; - } else if (location.includes("exams")) { - initai_navId = 3; - } - else if(location.includes('dashboard')){ - initai_navId = 4; + initai_navId = 1; + } else if (location.includes("myServices")) { + setNavId(2); + let top = 100 / 6 + ((((2 - 1) * 100) / 6) * 3) / 4; + document.querySelector(".back-item-img").style.top = `${top}%`; + } else if (location.includes("contacts")) { + setNavId(4); + let top = 100 / 6 + ((((4 - 1) * 100) / 6) * 3) / 4; + document.querySelector(".back-item-img").style.top = `${top}%`; + } else if (location.includes("messages")) { + setNavId(3); + let top = 100 / 6 + ((((3 - 1) * 100) / 6) * 3) / 4; + document.querySelector(".back-item-img").style.top = `${top}%`; } -}else{ - if (location.includes("accounting")) { - initai_navId = 2; - } else if (location.includes("messages")) { - initai_navId = 5; - } -} + },[]) + // }else{ + // if (location.includes("accounting")) { + // initai_navId = 2; + // } else if (location.includes("messages")) { + // initai_navId = 3; + // } + // } const mobileOptions = [ { title: "صفحه اصلی", @@ -184,49 +185,57 @@ useEffect(() => { const [navId, setNavId] = useState(initai_navId); - const chaneNav = (id) => { setNavId(id); - let top = 100 / 6 + (id - 1) * 100 / 6 * 3 / 4; - console.log(top) + let top = 100 / 6 + ((((id - 1) * 100) / 6) * 3) / 4; + console.log(top); document.querySelector(".back-item-img").style.top = `${top}%`; }; if (isMobile) { - - return ( - location2.pathname.includes('azmoon_list') || location2.pathname.includes('messages') || location2.pathname.includes('shoppingCart') || location2.pathname.includes('register') ? null : + return location2.pathname.includes("azmoon_list") || + location2.pathname.includes("messages") || + location2.pathname.includes("shoppingCart") || + location2.pathname.includes("register") ? null : (
- { - mobileOptions.map( - (item, index) => ( - setNavId(index + 1)}> -
- {item.icon} -
-

{item.title}

- { navId == index + 1 && -
- -
- } - - ) - ) - } + {mobileOptions.map((item, index) => ( + setNavId(index + 1)} + > +
+ {item.icon} +
+

{item.title}

+ {navId == index + 1 && ( +
+ )} + + ))}
-
- ) + ); } else { return type === "default" ? (
logo
-
+
{/* ------------ */}
diff --git a/src/view/dashboard2/Games.js b/src/view/dashboard2/Games.js index 4d62f2d..c818c31 100644 --- a/src/view/dashboard2/Games.js +++ b/src/view/dashboard2/Games.js @@ -1,10 +1,10 @@ import { useState } from "react"; -import img1 from "../../assets/img/Group 1344.svg"; -import img2 from "../../assets/img/Group 1345.svg"; -import img3 from "../../assets/img/Group 1349.svg"; -import img4 from "../../assets/img/Group 1364.svg"; -import img5 from "../../assets/img/Group 1357.svg"; -import img6 from "../../assets/img/Group 1362.svg"; +import img1 from "../../assets/img/blackboard.png"; +import img2 from "../../assets/img/buildings.png"; +import img3 from "../../assets/img/diploma.png"; +import img4 from "../../assets/img/books.png"; +import img5 from "../../assets/img/research.png"; +import img6 from "../../assets/img/thinking.png"; import { HiCheck } from "react-icons/hi"; import { connect } from "react-redux"; diff --git a/src/view/my-services/MyServices.js b/src/view/my-services/MyServices.js index 10651dc..48c5184 100644 --- a/src/view/my-services/MyServices.js +++ b/src/view/my-services/MyServices.js @@ -9,21 +9,28 @@ import ResultExams from "./ResultExams"; import Calendar2 from "../../components/Calendar2/Calendar2"; import { toast } from "react-toastify"; import { useLocation } from "react-router-dom"; +import errorIcon from "../../assets/img/error-icon.svg"; +import { + AiOutlinePlus, + AiFillDelete, + AiOutlineCloseCircle, +} from "react-icons/ai"; const MyServices=()=>{ //handle payment response------------ let search = useLocation().search; let query = Object.fromEntries(new URLSearchParams(search)); - + const [paymentError, setPaymentError] = useState(false); useEffect(() => { if (query.status) { if (query.status === "OK") { toast.success("پرداخت با موفقیت انجام شد"); } else { - toast.error( - `عملیات پرداخت موفق نبود. شناسه پیگیری شما ${query.authority} می‌باشد` - ); + // toast.error( + // `عملیات پرداخت موفق نبود. شناسه پیگیری شما ${query.authority} می‌باشد` + // ); + setPaymentError(true); } } }, []); @@ -109,6 +116,54 @@ const MyServices=()=>{ )}
)} + {/* ----------payment-Error-box------------------ */} + {paymentError && ( +
+
+ errorIcon +
+ متاسفانه پرداخت شما انجام نشد +
+
+ شماره پیگیری: {query?.authority} +
+
setPaymentError(false)} + style={ + window.innerWidth < 1000 + ? { width: "50%", fontSize: "14px" } + : null + } + > + متوجه شدم +
+ setPaymentError(false)} + /> +
+
+ )}
); } diff --git a/src/view/register/index.js b/src/view/register/index.js index f3fe3e5..00fe844 100644 --- a/src/view/register/index.js +++ b/src/view/register/index.js @@ -53,6 +53,10 @@ const Register = ({ if (user?.firstName !== null) { setUserInfo(user); } + if(user?.rulesAccepted){ + setActiveStep([true, true, true, true]); + setSteps(3); + } }, [user]); useEffect(() => { window.scrollTo(0, 0); @@ -170,7 +174,7 @@ const Register = ({ }, { title: "تاریخ تولد", - value: userInfo?.birthDate?.toLocaleDateString("fa-IR"), + // value: userInfo?.birthDate?.toLocaleDateString("fa-IR"), }, { title: "نام مدرسه ", diff --git a/src/view/services/PaymentBox.js b/src/view/services/PaymentBox.js index 102d64b..d0c4796 100644 --- a/src/view/services/PaymentBox.js +++ b/src/view/services/PaymentBox.js @@ -8,7 +8,8 @@ import { import { connect } from "react-redux"; import { Link } from "react-router-dom"; import { toast } from "react-toastify"; -import { userFactor,userTransaction } from "../../redux/actions"; +import { userFactor, userTransaction } from "../../redux/actions"; +import errorIcon from "../../assets/img/error-icon.svg"; const PaymentBox = ({ setShowPaymentBox, @@ -18,7 +19,9 @@ const PaymentBox = ({ query, addUserTransaction, restartTransaction, - transactionSituation + transactionSituation, + paymentError, + setPaymentError, }) => { useEffect(() => { getFactorInfo(); @@ -36,7 +39,7 @@ const PaymentBox = ({ cardNumber: null, paidAt: null, TracingNumber: null, - dueDateArray:null + dueDateArray: null, }, ]); useEffect(() => { @@ -57,7 +60,7 @@ const PaymentBox = ({ cardNumber: null, paidAt: null, TracingNumber: null, - dueDateArray:null + dueDateArray: null, }); } } else { @@ -90,7 +93,7 @@ const PaymentBox = ({ cardNumber: null, paidAt: null, TracingNumber: null, - dueDateArray:null + dueDateArray: null, }); setPaymentList(newList); setFake(fake + 1); @@ -122,16 +125,15 @@ const PaymentBox = ({ //cardToCardCHeck----------------------------------- console.log("transactionSituation:"); console.log(transactionSituation); - useEffect(()=>{ - if(transactionSituation) - { + useEffect(() => { + if (transactionSituation) { let newList = paymentList; - newList[newList.length-1].status=0; + newList[newList.length - 1].status = 0; setPaymentList(newList); - setFake(fake+1) - restartTransaction() + setFake(fake + 1); + restartTransaction(); } - },[transactionSituation]) + }, [transactionSituation]); //paymentHandler-------- const paymentHandler = (item, index) => { console.log(item); @@ -139,14 +141,21 @@ const PaymentBox = ({ localStorage.setItem("paymentList", JSON.stringify(paymentList)); localStorage.setItem("lastPaymentIndex", index); localStorage.setItem("factorInfoPrice", factorInfo.payPrice); + if (window.innerWidth > 1000) { + payment({ + price: item.amount, + redirectUrl: "https://new.andishmand.ir/services", + }); + } else { + payment({ + price: item.amount, + redirectUrl: "https://new.andishmand.ir/shoppingCart", + }); + } // payment({ // price: item.amount, - // redirectUrl: "https://new.andishmand.ir/services", + // redirectUrl: "http://localhost:3000/services", // }); - payment({ - price: item.amount, - redirectUrl: "http://localhost:3000/services", - }); } else if (item.type === 2) { let cardNumber = document.querySelector( "#paymentBox-cardNumber-input" @@ -199,7 +208,7 @@ const PaymentBox = ({ newList[index].cardNumber = cardNumber; newList[index].paidAt = dueDate; newList[index].TracingNumber = TracingNumber; - newList[index].dueDateArray=dueDateArray; + newList[index].dueDateArray = dueDateArray; setPaymentList(newList); setFake(fake + 1); addUserTransaction({ @@ -207,7 +216,7 @@ const PaymentBox = ({ dueDate: dueDate, cardNumber, followCode: TracingNumber, - type:5 + type: 5, }); } } @@ -488,6 +497,52 @@ const PaymentBox = ({ تایید
+ {/* -------------payment-Error-box------------------------ */} + {paymentError && ( +
+ errorIcon +
+ متاسفانه پرداخت شما انجام نشد +
+
+ شماره پیگیری: {query?.authority} +
+
setPaymentError(false)} + style={ + window.innerWidth < 1000 + ? { width: "50%", fontSize: "14px" } + : null + } + > + متوجه شدم +
+ setPaymentError(false)} + /> +
+ )} {/*
{ getUserInfo(); },[]) + //------------------------------------ + const [fliterList,setFilterList]=useState([]); + const [fake,setFake]=useState(0); + const fliterHandler=(index)=>{ + let list = fliterList; + if(fliterList.includes(index)){ + let newList = []; + for(let i=0;i { if (query.status) { if (query.status === "OK") { toast.success("پرداخت با موفقیت انجام شد"); } else { - toast.error( - `عملیات پرداخت موفق نبود. شناسه پیگیری شما ${query.authority} می‌باشد` - ); - // fireAlert({ - // title: "پرداخت ناموفق", - // text: `عملیات پرداخت موفق نبود. شناسه پیگیری شما ${query.authority} می‌باشد`, - // confirmButtonText: "توضیح بیشتر", - // showCancelButton: true, - // cancelButtonText: "متوجه شدم", - // showCloseButton: false, - // customClass: { - // title: "title-error-7", - // closeButton: "close-button-7", - // confirmButton: "confirm-button-7", - // cancelButton: "cancle-button7", - // }, - // }); + // toast.error( + // `عملیات پرداخت موفق نبود. شناسه پیگیری شما ${query.authority} می‌باشد` + // ); + setPaymentError(true); } setShowPaymentBox(true); } @@ -223,7 +231,7 @@ const Services = ({ // style={{ paddingTop:'5.5%', height: '100vh' }} >
setSelectedProductTypes(val)} />
- {/* filters */} - {gameId != 6 && ( + {/* filters-------------------------------------- */} + {gameId === 3 && (
filterIcon
-
- {filterCheck.map((filter) => ( -
{ - if (selectedFilters.includes(filter.id)) { - setSelectedFilters( - selectedFilters.filter((itm) => itm !== filter.id) - ); - } else { - setSelectedFilters([...selectedFilters, filter.id]); - } - }} - > -

{filter.title}

- {selectedFilters.includes(filter.id) && ( -
-
- - - -
-
- )} -
- ))} +
+
fliterHandler(4)} + > +
آنلاین
+ +
+
fliterHandler(3)} + > +
حضوری
+ +
- -
- +
+
fliterHandler(1)} + > +
پسرانه
+ +
+
fliterHandler(2)} + > +
دخترانه
+ +
)} @@ -300,38 +306,44 @@ const Services = ({ {books ?.filter((itm) => selectedProductTypes.includes(itm.productType)) .map((product, index) => ( -
- {(selectedProductTypes.includes(4) || - selectedProductTypes.includes(7)) && ( - { - productClickhandler(product); - }} - btnOnClick={() => { - AddToCartHandler(product); - }} - /> + + {(gameId !== 3 || + (!fliterList.includes(product?.productType - 1) && + !fliterList.includes(product?.gender))) && ( +
+ {(selectedProductTypes.includes(4) || + selectedProductTypes.includes(7)) && ( + { + productClickhandler(product); + }} + btnOnClick={() => { + AddToCartHandler(product); + }} + /> + )} +
)} -
+ ))} {!selectedProductTypes.includes(4) && !selectedProductTypes.includes(7) && @@ -386,7 +398,12 @@ const Services = ({ )} {/* --------------payment-box------------------------------------- */} {showPaymentBox && ( - + )}
); diff --git a/src/view/services/service/index.js b/src/view/services/service/index.js index 41b8b9c..bfee91e 100644 --- a/src/view/services/service/index.js +++ b/src/view/services/service/index.js @@ -109,7 +109,7 @@ const servicePopUp = ({ زمان کلاس
- {content.classHour} ساعت + {content.classHour} دقیقه