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" ? (
-
+
{/* ------------ */}
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 && (
+
+
+
+
+ متاسفانه پرداخت شما انجام نشد
+
+
+ شماره پیگیری: {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 && (
+