mobile(myOrders),payment-box...

main
alireza khaji 3 years ago
parent 28ccf2c3b5
commit 6b0cf077b5
  1. 2
      public/index.html
  2. 452
      src/components/ShoppingCart/index.js
  3. 2
      src/redux/actions/public.js
  4. 4
      src/redux/reducers/public.js
  5. 2
      src/redux/reducers/userFactor.js
  6. 65
      src/view/LoginSignUp/SignUpBox.js
  7. 6
      src/view/my-services/index.css
  8. 130
      src/view/my-services/mobile/MyCourse.js
  9. 168
      src/view/my-services/mobile/MyOrders.js
  10. 84
      src/view/my-services/mobile/MyRegisters.js
  11. 9
      src/view/my-services/mobile/MyServices.js
  12. 1
      src/view/my-services/mobile/ResultExams.js
  13. 274
      src/view/services/index.js
  14. 302
      src/view/services/service/index.js

@ -4,7 +4,7 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/logo.ico" /> <link rel="icon" href="%PUBLIC_URL%/logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#fff" />
<meta <meta
name="description" name="description"
content="Web site created using create-react-app" content="Web site created using create-react-app"

@ -30,218 +30,294 @@ function ShoppingCart({
desktopContentTransform, desktopContentTransform,
pushToCart, pushToCart,
pushSchoolToCart, pushSchoolToCart,
paySchool paySchool,
setShowPaymentBox,
}) { }) {
const [phase, setPhase] = useState("products"); const [phase, setPhase] = useState("products");
useEffect(() => { useEffect(() => {
getList(); getList();
getFactorInfo({userId}); getFactorInfo({ userId });
setHeaderOptions(headerOptions); setHeaderOptions(headerOptions);
}, []); }, []);
console.log("Cart----------======================-------------------"); console.log("Cart----------======================-------------------");
console.log(schoolList); console.log(schoolList);
return(isMobile ?
<div className="w-full flex flex-col justify-between items-center bg-gray-200 rtl left-0 pt-[3.5%]" 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 mt-0 " 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 text-sm font-semibold" onClick={() => paySchool()}>
پرداخت مستقیم به حساب مدرسه با مبلغ {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 ">
//payHandler---------------------------------------
const payHandler = () => {
setShowPaymentBox(true);
};
return isMobile ? (
<div
className="w-full flex flex-col justify-between items-center bg-gray-200 rtl left-0 pt-[3.5%]"
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 <div
className="w-8 h-8 text-white text-sm rounded-full cursor-pointer flex justify-center items-center bg-red52" className="flex bg-white justify-between items-center border-2 border-gray-300 p-4 rounded-xl m-2 mt-0 "
style={{ transform: 'translateX(-30px)' }} key={`SCHOOL_${index}`}
onClick={() => style={{ width: "90%" }}
pushSchoolToCart(
{
productId: school?.productId,
userId: school?.userId,
count: school?.count == 1 ? -school?.count : -1,
},
{},
{ id: school?.factorId }
)
}
> >
<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">
{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)"> </div>
<path id="Vector" d="M0,13.347,13.347,0" fill="none" stroke="#fff" strokeLinecap="round" strokeWidth="2" /> <h1 className="text-md font-black px-2 text-black40">
<path id="Vector-2" data-name="Vector" d="M13.347,13.347,0,0" fill="none" stroke="#fff" strokeLinecap="round" strokeWidth="2" /> {" "}
</g> {school?.product?.name}
</g> </h1>
</svg>: </div>
<svg width="100" height="100" viewBox="0 0 100 100"> <button
<g stroke = "#fff" strokeWidth = "5" fill="none"> className="w-full px-1 h-12 mt-1 text-white bg-red52 rounded-lg text-sm font-semibold"
<path d="M 25 50 L 75 50 onClick={() => paySchool()}
>
پرداخت مستقیم به حساب مدرسه با مبلغ {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 M 50 5
" /> "
</g> />
</svg>} </g>
</svg>
)}
</div>
</div>
</div> </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) => (
schoolList.length > 0 && <div className="bg-gray-300 my-2 pb-1 rounded-full w-11/12"></div> <Product key={index} product={product} />
} ))}
{list.map((product, index) => (
<Product key={index} product={product} />
))}
</div>
{/* {console.log(list)} */}
<div className="w-full px-5 mb-6">
<Code />
<div className="flex flex-col w-full border-t border-gray-400 my-2 py-2">
<div className="flex justify-between w-full py-2 text-blue-700 text-lg ">
<p>جمع مبالغ خدمات</p>
<p>{factorInfo?.sumPrice} تومان</p>
</div> </div>
<div className="flex justify-between w-full py-2 text-red26 text-lg "> {/* {console.log(list)} */}
<p> تخفیف </p>
<p> {factorInfo?.offPrice} - تومان</p> <div className="w-full px-5 mb-6">
</div> <Code />
<div className="flex justify-between w-full py-2 text-red26 text-lg "> <div className="flex flex-col w-full border-t border-gray-400 my-2 py-2">
<p>کسر از اعتبار</p> <div className="flex justify-between w-full py-2 text-blue-700 text-lg ">
<p>-۰ تومان</p> <p>جمع مبالغ خدمات</p>
<p>{factorInfo?.sumPrice} تومان</p>
</div>
{factorInfo?.offPrice && (
<div className="flex justify-between w-full py-2 text-red26 text-lg ">
<p> تخفیف </p>
<p> {factorInfo?.offPrice} - تومان</p>
</div>
)}
</div>
<Button
title={`پرداخت هزینه : ${
factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0
} تومان`}
borderType="rounded-xl"
className="h-16 w-full mx-none text-xl"
onClick={() => payFactor()}
/>
</div> </div>
</div> </div>
<Button ) : (
title={`پرداخت هزینه : ${factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0} تومان`} <div className="ccc w-full h-full flex flex-col justify-between items-center bg-gray-100 left-0 pt-14">
borderType='rounded-xl' <div
className='h-16 w-full mx-none text-xl' className={`w-full flex items-center flex-col h-[60%] overflow-y-auto`}
onClick={() => payFactor()} >
/> {schoolList?.map((school, index) => (
</div>
</div>
:
<div className="flex flex-col justify-between items-center bg-gray-100 left-0 pt-14" style={{height: '100vh'}}>
<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'}} onClick={() => paySchool()}>
پرداخت مستقیم به حساب مدرسه با مبلغ {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 <div
className="w-8 h-8 text-white text-sm rounded-full cursor-pointer flex justify-center items-center bg-red52" className="flex bg-white justify-between items-center border-2 border-gray-300 p-4 rounded-xl m-2 "
style={{ transform: 'translateX(-30px)' }} key={`SCHOOL_${index}`}
onClick={() => style={{ width: "90%" }}
pushSchoolToCart(
{
productId: school?.productId,
userId: school?.userId,
count: school?.count == 1 ? -school?.count : -1,
},
{},
{ id: school?.factorId }
)
}
> >
<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">
{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)"> </div>
<path id="Vector" d="M0,13.347,13.347,0" fill="none" stroke="#fff" strokeLinecap="round" strokeWidth="2" /> <h1 className="text-md font-black px-2 text-black40">
<path id="Vector-2" data-name="Vector" d="M13.347,13.347,0,0" fill="none" stroke="#fff" strokeLinecap="round" strokeWidth="2" /> {" "}
</g> {school?.product?.name}
</g> </h1>
</svg>: </div>
<svg width="100" height="100" viewBox="0 0 100 100"> <button
<g stroke = "#fff" strokeWidth = "5" fill="none"> className="w-full px-1 h-12 mt-1 text-white bg-red52 rounded-lg font-semibold"
<path d="M 25 50 L 75 50 style={{ fontSize: "0.65vw" }}
onClick={() => paySchool()}
>
پرداخت مستقیم به حساب مدرسه با مبلغ {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 M 50 5
" /> "
</g> />
</svg>} </g>
</svg>
)}
</div>
</div>
</div> </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) => (
schoolList.length > 0 && <div className="bg-gray-300 my-2 pb-1 rounded-full w-11/12"></div> <Product key={index} product={product} />
} ))}
{list.map((product, index) => (
<Product key={index} product={product} />
))}
</div>
{/* {console.log(list)} */}
<div style={{width: '80%'}} className="mb-6">
<Code />
<div className="flex flex-col w-full border-t border-gray-400 my-2 py-2">
<div className="flex justify-between w-full py-2 text-blue-700 text-lg ">
<p>جمع مبالغ خدمات</p>
<p>{factorInfo?.sumPrice} تومان</p>
</div> </div>
<div className="flex justify-between w-full py-2 text-red26 text-lg "> {/* {console.log(list)} */}
<p> تخفیف </p>
<p> {factorInfo?.offPrice} - تومان</p> <div style={{ width: "80%" }} className="mb-6">
</div> <Code />
<div className="flex justify-between w-full py-2 text-red26 text-lg "> <div className="flex flex-col w-full border-t border-gray-400 my-2 py-2">
<p>کسر از اعتبار</p> <div className="flex justify-between w-full py-2 text-blue-700 text-lg ">
<p>-۰ تومان</p> <p>جمع مبالغ خدمات</p>
<p>{factorInfo?.sumPrice} تومان</p>
</div>
{factorInfo?.offPrice && (
<div className="flex justify-between w-full py-2 text-red26 text-lg ">
<p> تخفیف </p>
<p> {factorInfo?.offPrice} - تومان</p>
</div>
)}
</div>
<Button
title={`پرداخت هزینه : ${
factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0
} تومان`}
borderType="rounded-xl"
className="h-16 text-xl xl:text-sm"
onClick={payHandler}
/>
</div> </div>
</div> </div>
<Button
title={`پرداخت هزینه : ${factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0} تومان`}
borderType='rounded-xl'
className='h-16 text-xl xl:text-sm'
onClick={() => payFactor()}
/>
</div>
</div>
); );
} }

@ -41,6 +41,8 @@ const publicApi = {
await proxy.get("public/city", data, { dispatch }), await proxy.get("public/city", data, { dispatch }),
selectMenu: (data) => async (dispatch) => selectMenu: (data) => async (dispatch) =>
await dispatch({ type: "public/selectMenu", data }), await dispatch({ type: "public/selectMenu", data }),
sendOtp: (data) => async (dispatch) =>
await proxy.post("public/sendOTP", data, { dispatch }),
getHeader: getHeader:
(data = {}) => (data = {}) =>
async (dispatch) => async (dispatch) =>

@ -1,3 +1,4 @@
import { toast } from "react-toastify";
import { ostan } from "../../constants/states"; import { ostan } from "../../constants/states";
import location from "../../utils/location"; import location from "../../utils/location";
@ -233,6 +234,9 @@ export default function publicApi(state = initialState, action) {
return { ...state, loading: false, error: null, contactData: data }; return { ...state, loading: false, error: null, contactData: data };
case "public/blogList": case "public/blogList":
return { ...state, loading: false, error: null, blogList: data }; return { ...state, loading: false, error: null, blogList: data };
case "public/sendOTP":
toast.success("درخواست با موفقیت ثبت شد")
return { ...state, loading: false, error: null };
case "public/blogInfo": case "public/blogInfo":
return { ...state, loading: false, error: null, blog: data }; return { ...state, loading: false, error: null, blog: data };
case "public/setSubscribe": case "public/setSubscribe":

@ -52,7 +52,7 @@ export default function userFactor(state = initialState, action) {
case "userFactor/loading": case "userFactor/loading":
return { ...state, loading: true }; return { ...state, loading: true };
case "userFactor/error": case "userFactor/error":
toast.error(data.message); if (data.statusCode!==404){ toast.error(data.message);}
return { ...state, loading: false, error: data.message }; return { ...state, loading: false, error: data.message };
default: default:
return state; return state;

@ -1,8 +1,10 @@
import { useState } from "react"; import { useState } from "react";
import { connect } from "react-redux";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
import {user,publicApi} from '../../redux/actions'
import logo from "../../assets/img/logo.png"; import logo from "../../assets/img/logo.png";
import backIcon from "../../assets/img/vuesax-linear-arrow-left.svg"; import backIcon from "../../assets/img/vuesax-linear-arrow-left.svg";
const SignUpBox = ({ setSignUp }) => { const SignUpBox = ({ setSignUp, sendOtp,otpLogin }) => {
const [step, setStep] = useState(0); const [step, setStep] = useState(0);
const [data, setData] = useState(null); const [data, setData] = useState(null);
const submitHandler = () => { const submitHandler = () => {
@ -26,6 +28,7 @@ const SignUpBox = ({ setSignUp }) => {
nationalId, nationalId,
cellphone, cellphone,
}); });
sendOtp({ cellphone });
setStep(1); setStep(1);
} }
}; };
@ -40,19 +43,43 @@ const SignUpBox = ({ setSignUp }) => {
}; };
//codeFocuseHandler-------------- //codeFocuseHandler--------------
const codeFocuseHandler=(index)=>{ const codeFocuseHandler = (index) => {
let box = document.querySelectorAll(".codeInput"); let box = document.querySelectorAll(".codeInput");
if(index!==3){ if (index !== 3) {
box[index+1].focus() box[index + 1].focus();
}else{ } else {
if(box[0].value!=="" && box[1].value!=="" && box[2].value!=="" && box[3].value!==""){ if (
let code = Number( box[0].value !== "" &&
box[0].value + box[1].value + box[2].value + box[3].value box[1].value !== "" &&
); box[2].value !== "" &&
alert(code); box[3].value !== ""
) {
let code = Number(
box[0].value + box[1].value + box[2].value + box[3].value
);
alert(code);
} }
//api send //api send
} }
};
//otpLoginHandler--------------
const otpLoginHandler=()=>{
let codeInput = document.querySelectorAll(".codeInput");
let code = codeInput[0].value + codeInput[1].value + codeInput[2].value + codeInput[3].value;
if(code.length<4){
toast.error("لطفا کد را به صورت کامل وارد کنید")
}else{
otpLogin({
cellphone: data.cellphone,
firstName: data.firstName,
lastName: data.lastName,
nationalId: data.nationalId,
otp: code,
userToken: "1",
applicationToken:"1",
});
}
} }
return ( return (
<div className="SignUpBox w-full h-full flex flex-col items-center justify-center bg-white absolute top-0 left-0 rounded-lg "> <div className="SignUpBox w-full h-full flex flex-col items-center justify-center bg-white absolute top-0 left-0 rounded-lg ">
@ -85,7 +112,10 @@ const SignUpBox = ({ setSignUp }) => {
{step === 1 && <SendCodeAgain cellphone={data.cellphone} />} {step === 1 && <SendCodeAgain cellphone={data.cellphone} />}
{/* ----------code----------------- */} {/* ----------code----------------- */}
{step === 1 && ( {step === 1 && (
<div className="w-[85%] flex items-center justify-between mt-5" style={{direction:"ltr"}}> <div
className="w-[85%] flex items-center justify-between mt-5"
style={{ direction: "ltr" }}
>
<input <input
type="text" type="text"
name="codeInput" name="codeInput"
@ -128,7 +158,7 @@ const SignUpBox = ({ setSignUp }) => {
{step === 1 && ( {step === 1 && (
<div <div
className="w-[85%] h-[50px] rounded-lg bg-[#DF1452] flex items-center justify-center text-lg text-white mt-5 cursor-pointer" className="w-[85%] h-[50px] rounded-lg bg-[#DF1452] flex items-center justify-center text-lg text-white mt-5 cursor-pointer"
// onClick={submitHandler} onClick={otpLoginHandler}
> >
تایید تایید
</div> </div>
@ -137,7 +167,16 @@ const SignUpBox = ({ setSignUp }) => {
); );
}; };
export default SignUpBox; const mapStateToProps = (state) => ({
});
const mapDispatchToProps = {
sendOtp: publicApi.sendOtp,
otpLogin:user.otp_login
};
export default connect(mapStateToProps, mapDispatchToProps)(SignUpBox);
//---------------------------------- //----------------------------------

@ -75,6 +75,12 @@
} }
} }
@media only screen and (max-width: 350px) {
.myOrders-mobile-item{
width: 54% !important;
}
}
@media only screen and (max-width: 340px) { @media only screen and (max-width: 340px) {
.FutureExams-m-item-box{ .FutureExams-m-item-box{
width: 55% !important; width: 55% !important;

@ -0,0 +1,130 @@
import Title from "../Title";
import img1 from "../../../assets/img/rhema-kallianpur-2W3bDp7K1oQ-unsplash.jpg";
import img2 from "../../../assets/img/pankaj-patel-_SgRNwAVNKw-unsplash.jpg";
let data = [
{
id: 1,
name: "صفر تا صد javascript",
date: "1401/3/3",
img: img1,
description:
"ما در این دوره از پایهای ترین مفاهیم javascript شروع خواهیم کرد و رفته رفته به سمت مطالب حرفهای تر حرکت میکنیم.",
teacher: "فرانتکار عجیب",
},
{
id: 2,
name: "صفر تا صد javascript",
date: "1401/3/3",
img: img2,
description:
"ما در این دوره از پایهای ترین مفاهیم javascript شروع خواهیم کرد و رفته رفته به سمت مطالب حرفهای تر حرکت میکنیم.",
teacher: "فرانتکار عجیب",
},
{
id: 3,
name: "صفر تا صد javascript",
date: "1401/3/3",
img: img1,
description:
"ما در این دوره از پایهای ترین مفاهیم javascript شروع خواهیم کرد و رفته رفته به سمت مطالب حرفهای تر حرکت میکنیم.",
teacher: "فرانتکار عجیب",
},
{
id: 4,
name: "صفر تا صد javascript",
date: "1401/3/3",
img: img2,
description:
"ما در این دوره از پایهای ترین مفاهیم javascript شروع خواهیم کرد و رفته رفته به سمت مطالب حرفهای تر حرکت میکنیم.",
teacher: "فرانتکار عجیب",
},
];
const MyCourse = ({ seeMoreHandler, seeMoreStatus, deActiveSeeMore }) => {
return (
<div
className="MyCourse w-full p-2 rounded-lg border mt-4"
// style={seeMoreStatus === 4 ? { width: "100%" } : null}
>
{/* ----title-------- */}
<Title
titleText="دورههای من"
seeMoreHandler={() => seeMoreHandler(4)}
seeMoreStatus={seeMoreStatus}
deActiveSeeMore={deActiveSeeMore}
/>
{/* ----body-------- */}
<div className="w-full mt-1 flex flex-row-reverse items-center gap-x-1 overflow-x-auto">
{data?.map((item, index) => (
<div key={index} className="w-[47%] rounded border shrink-0 pb-1">
<div className="w-full aspect-[1/0.7] rounded overflow-hidden flex justify-center">
<img
src={item.img}
alt="course-banner"
className="w-full rounded"
/>
</div>
{/* ---- */}
<div className="w-full mt-1 px-1">
<div
className="text-xs text-right text-[#B1B1B1]"
// style={seeMoreStatus === 4 ? { fontSize: "14px" } : null}
>
{item?.date}
</div>
<div
className=" w-full text-sm text-right mt-1 text-black"
style={
seeMoreStatus === 4
? {
fontFamily: "IRANSansXFaNum-Medium",
direction: "rtl",
fontSize: "20px",
}
: {
fontFamily: "IRANSansXFaNum-Medium",
direction: "rtl",
}
}
>
{item.name}
</div>
<div
className="w-full text-xs text-right text-[#B1B1B1] mt-1 overflow-hidden text-ellipsis"
style={
seeMoreStatus === 4
? {
WebkitLineClamp: "2",
WebkitBoxOrient: "vertical",
display: "-webkit-box",
direction: "rtl",
fontSize: "16px",
}
: {
WebkitLineClamp: "2",
WebkitBoxOrient: "vertical",
display: "-webkit-box",
direction: "rtl",
}
}
>
{item.description}
</div>
<div
className="w-full text-left text-xs w-full mt-2 text-black"
style={
seeMoreStatus === 4
? { direction: "ltr", fontSize: "14px" }
: { direction: "ltr" }
}
>
استاد:{item?.teacher}
</div>
</div>
</div>
))}
</div>
</div>
);
};
export default MyCourse;

@ -0,0 +1,168 @@
import React from "react";
import Title from "../Title";
let data = [
{
id: 1,
factorId: "ABC12345",
date: "1401/3/3",
status: 1,
sumPrice: 100000,
products: [
{
id: 100,
img: "",
},
{
id: 101,
img: "",
},
],
},
{
id: 2,
factorId: "ABC12345",
date: "1401/3/3",
status: 2,
sumPrice: 100000,
products: [
{
id: 100,
img: "",
},
{
id: 101,
img: "",
},
],
},
{
id: 3,
factorId: "ABC12345",
date: "1401/3/3",
status: 3,
sumPrice: 100000,
products: [
{
id: 100,
img: "",
},
{
id: 101,
img: "",
},
],
},
{
id: 4,
factorId: "ABC12345",
date: "1401/3/3",
status: 1,
sumPrice: 100000,
products: [
{
id: 100,
img: "",
},
{
id: 101,
img: "",
},
],
},
];
let statusColor = ["#F7EA46", "#57F746", "#FE1E1E"];
const MyOrders = ({ seeMoreHandler, seeMoreStatus, deActiveSeeMore }) => {
return (
<div
className="MyOrders w-full rounded-lg border p-2 my-4 text-black"
style={seeMoreStatus === 5 ? { width: "100%" } : null}
>
<div className="w-full h-full overflow-y-auto">
{/* ----title-------- */}
<Title
titleText="سفارشهای من"
seeMoreHandler={() => seeMoreHandler(5)}
seeMoreStatus={seeMoreStatus}
deActiveSeeMore={deActiveSeeMore}
/>
{/* ----body-------- */}
<div className="w-full mt-2 flex flex-row-reverse items-center gap-x-2 overflow-x-auto">
{data.map((item, index) => (
<div key={index} className="myOrders-mobile-item w-[48%] border px-1 py-2 shrink-0 rounded">
<div className="w-full flex flex-row-reverse items-center justify-between py-1 border-b border-[#E0E0E0]">
<div
className="w-full pl-1 text-center text-xs border-l"
// style={seeMoreStatus === 5 ? { width: "55%" } : null}
>
{item.factorId}
</div>
</div>
<div className="w-full flex flex-row-reverse items-center justify-between my-2">
<div className=" text-right text-xs">{item.date}</div>
<div
className=" flex flex-row-reverse items-center"
// style={seeMoreStatus === 5 ? { width: "15%" } : null}
>
<div
className="w-3 h-3 rounded-full bg-black"
style={{
backgroundColor: `${statusColor[item.status - 1]}`,
}}
></div>
<div className="order-m-status text-xs text-right mr-1">
{item.status === 1
? "در حال پردازش"
: item.status === 2
? "تکمیل شده"
: "کنسل شده"}
</div>
</div>
</div>
{/* ---------- */}
<div className="w-full mt-1">
<div className="my-order-m-right w-full flex flex-row-reverse items-start gap-x-2 gap-y-2 shrink-0 overflow-hidden">
{item.products.map((ITEM, INDEX) => (
<React.Fragment key={INDEX}>
{INDEX < 3 && (
<div
key={INDEX}
className="w-[27%] aspect-[1/1.6] rounded bg-[#E0E0E0] overflow-hidden flex items-center justfy-center cursor-pointer"
// style={
// seeMoreStatus === 5
// ? { width: "80px", height: "128px" }
// : null
// }
></div>
)}
</React.Fragment>
))}
</div>
<div className="my-order-m-left w-full mt-2">
<div
className="factor-sum-price w-full text-center text-xs"
// style={seeMoreStatus === 5 ? { fontSize: "16px" } : null}
>
جمع فاکتور {item.sumPrice} تومان
</div>
<div
className="w-full h-7 rounded flex items-center justify-center text-xs text-center text-white bg-[#DF1452] mt-2 mx-auto"
style={
seeMoreStatus === 5
? { width: "130px", fontSize: "16px", height: "35px" }
: null
}
>
جزئیات سفارش
</div>
</div>
</div>
</div>
))}
</div>
</div>
</div>
);
};
export default MyOrders;

@ -0,0 +1,84 @@
import Title from "../Title";
let data = [
{
id: 1,
factorId: "ABC12345",
name: "کلاس حضوری فیزیک کوآنتوم",
date: "1401/3/3",
type: 1,
},
{
id: 2,
factorId: "ABC12345",
name: "کلاس حضوری فیزیک کوآنتوم",
date: "1401/3/3",
type: 2,
},
{
id: 3,
factorId: "ABC12345",
name: "کلاس حضوری فیزیک کوآنتوم",
date: "1401/3/3",
type: 3,
},
{
id: 4,
factorId: "ABC12345",
name: "کلاس حضوری فیزیک کوآنتوم",
date: "1401/3/3",
type: 4,
},
{
id: 5,
factorId: "ABC12345",
name: "کلاس حضوری فیزیک کوآنتوم",
date: "1401/3/3",
type: 1,
},
];
const MyRegisters = ({ seeMoreStatus, seeMoreHandler }) => {
return (
<div className="MyRegisters w-full py-2 border rounded-lg px-2 mt-4">
{/* ---title-------- */}
<Title
titleText="ثبتنامهای من"
seeMoreStatus={seeMoreStatus}
seeMoreHandler={seeMoreHandler}
/>
{/* ---body-------- */}
<div className="w-full flex flex-row-reverse items-center gap-x-1 overflow-x-auto">
{data.map((item, index) => (
<div key={index} className="w-[47%] py-2 px-1 rounded shrink-0 border">
<div className="w-full h-8 flex flex-row-reverse items-center border-b py-1">
<div className="w-1/2 h-full flex items-center justify-center text-cneter text-xs text-black border-l">
{item.factorId}
</div>
<div className="w-1/2 h-full flex items-center justify-center text-cneter text-xs text-black">
{item.date}
</div>
</div>
{/* -- */}
<div className="w-full h-16 mt-1 py-1 text-sm text-right text-black">
{item.name}
</div>
{/* -- */}
<div className="w-full h-11 mt-1 flex flex-row-reverse justify-between">
<div className="w-[45%] h-full rounded flex items-center justify-center border border-[#DF1452] text-xs text-[#DF1452] text-center">
قرارداد
</div>
<div
className="w-[53%] h-full rounded flex items-center justify-center bg-[#DF1452] text-xs text-white text-center"
// style={{ width: "calc(50% - 100px)" }}
>
{item.type === 1 ? "شرکت در دوره" : "مکان برگزاری"}
</div>
</div>
</div>
))}
</div>
</div>
);
};
export default MyRegisters;

@ -1,6 +1,9 @@
import { useState } from "react"; import { useState } from "react";
import Calendar2 from "../../../components/Calendar2/Calendar2"; import Calendar2 from "../../../components/Calendar2/Calendar2";
import FutureExams from "./FutureExams"; import FutureExams from "./FutureExams";
import MyCourse from "./MyCourse";
import MyOrders from "./MyOrders";
import MyRegisters from "./MyRegisters";
import ResultExams from "./ResultExams"; import ResultExams from "./ResultExams";
@ -31,6 +34,12 @@ const MyServices=()=>{
seeMoreStatus={seeMoreStatus} seeMoreStatus={seeMoreStatus}
seeMoreHandler={seeMoreHandler} seeMoreHandler={seeMoreHandler}
/> />
<MyRegisters
seeMoreStatus={seeMoreStatus}
seeMoreHandler={seeMoreHandler}
/>
<MyCourse seeMoreStatus={seeMoreStatus} seeMoreHandler={seeMoreHandler} />
<MyOrders seeMoreStatus={seeMoreStatus} seeMoreHandler={seeMoreHandler} />
</div> </div>
); );
} }

@ -71,6 +71,7 @@ const ResultExams = ({ seeMoreStatus, seeMoreHandler }) => {
<div className="w-full mt-1 flex flex-row-reverse items-center gap-x-2 overflow-x-auto"> <div className="w-full mt-1 flex flex-row-reverse items-center gap-x-2 overflow-x-auto">
{data?.map((item, index) => ( {data?.map((item, index) => (
<div <div
key={index}
className="w-[35%] aspect-[1/1.1] rounded shrink-0 p-2 flex flex-col items-center justify-center" className="w-[35%] aspect-[1/1.1] rounded shrink-0 p-2 flex flex-col items-center justify-center"
style={{ backgroundColor: colorList[index % 5].bg }} style={{ backgroundColor: colorList[index % 5].bg }}
> >

@ -4,9 +4,9 @@ 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 { CgDanger } from "react-icons/cg"; import { CgDanger } from "react-icons/cg";
import { AiOutlinePlus, AiFillDelete } from "react-icons/ai";
// import ScrollContainer from 'react-indiana-drag-scroll' // import ScrollContainer from 'react-indiana-drag-scroll'
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";
import img3 from "../../assets/img/Group 1349.svg"; import img3 from "../../assets/img/Group 1349.svg";
@ -18,9 +18,7 @@ import ServicePopUp from "./service";
import Games from "../dashboard2/Games"; import Games from "../dashboard2/Games";
// import Packages from "../dashboard2/Packages"; // import Packages from "../dashboard2/Packages";
import "./index.css";
import './index.css'
import separate from "../../utils/separate"; import separate from "../../utils/separate";
const Services = ({ const Services = ({
@ -35,20 +33,19 @@ const Services = ({
headerOptions, headerOptions,
videos, videos,
pushToCart, pushToCart,
pushSchoolToCart pushSchoolToCart,
}) => { }) => {
const [filterCheck, setFilterCheck] = useState([ const [filterCheck, setFilterCheck] = useState([
{ {
id:1, id: 1,
title: 'حضوری', title: "حضوری",
}, },
{ {
id:2, id: 2,
title: 'آنلاین', title: "آنلاین",
}, },
]); ]);
const [selectedFilters, setSelectedFilters] = useState([]) const [selectedFilters, setSelectedFilters] = useState([]);
const [filter, setFilter] = useState({ const [filter, setFilter] = useState({
search: "", search: "",
grade: "", grade: "",
@ -66,7 +63,7 @@ const Services = ({
classHour: "", classHour: "",
classMinute: "", classMinute: "",
}); });
const [sharzhVal, setSharzhVal] = useState(''); const [sharzhVal, setSharzhVal] = useState("");
const [selectedProductTypes, setSelectedProductTypes] = useState([7]); const [selectedProductTypes, setSelectedProductTypes] = useState([7]);
// const onChange = (name, value) => { // const onChange = (name, value) => {
// setFilter({ ...filter, [name]: value }); // setFilter({ ...filter, [name]: value });
@ -119,9 +116,51 @@ const Services = ({
const [gameId, setGameId] = useState(5); const [gameId, setGameId] = useState(5);
const chooseGame = (id) => { const chooseGame = (id) => {
setGameId(id); setGameId(id);
console.log(selectedProductTypes) console.log(selectedProductTypes);
}; };
console.log(gameId) console.log(gameId);
//-------------------------------------
const [fake,setFake]=useState(0);
const [paymentList, setPaymentList] = useState([
{
id: 1,
amount: null,
status: 4,
type: 1,
},
]);
const changeType=(e,index)=>{
let newList = paymentList;
newList[index] = { ...newList[index],type:Number(e.target.value)};
console.log("g:")
console.log(newList[index]);
setPaymentList(newList);
setFake(fake+1);
}
const [showPaymentBox, setShowPaymentBox] = useState(false);
const addPaymentHandler=()=>{
let newList = paymentList;
newList.push({
id: newList.length+1,
amount: null,
status: 4,
type: 1,
});
setPaymentList(newList);
setFake(fake + 1);
}
const deletePayment=(index)=>{
let newList = [];
for(let i=0;i<paymentList.length;i++){
if(i !== index){
newList.push(paymentList[i]);
}
}
setPaymentList(newList);
setFake(fake + 1);
}
//-==========================================================
if (!isMobile) { if (!isMobile) {
return ( return (
<div <div
@ -317,7 +356,7 @@ const Services = ({
// to={"/class/" + product?.id} // to={"/class/" + product?.id}
className="w-[30%]" className="w-[30%]"
key={`PRODUCT__${gameId}__${index}`} key={`PRODUCT__${gameId}__${index}`}
style={gameId===5?{width:"100%"}:null} style={gameId === 5 ? { width: "100%" } : null}
> >
{/* {console.log(product)} */} {/* {console.log(product)} */}
{(selectedProductTypes.includes(4) || {(selectedProductTypes.includes(4) ||
@ -340,38 +379,16 @@ const Services = ({
setPopUpContent({ setPopUpContent({
id: gameId, id: gameId,
title: product?.name, title: product?.name,
video: "", video: product?.fileId,
teacher: product?.vodTeacher, teacher: product?.teacherName,
description: description: product?.description,
"در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت قرار میگیرد در این قسمت یک توضیحات کوتاه در مورد دوره خواهد آمد که بصورت دو خط در این قسمت",
price: gameId == 2 ? 0 : product?.price, price: gameId == 2 ? 0 : product?.price,
classHour: 21, classHour: product?.duration,
classMinute: 56, classMinute: "",
image: image:
"https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg", "https://narafella.ir/wp-content/uploads/2021/08/books-min.jpg",
examCont: [ examCont: [],
{ type: product?.productType,
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) { if (gameId !== 5) {
setPopUp(true); setPopUp(true);
@ -401,15 +418,16 @@ const Services = ({
)} )}
</div> </div>
))} ))}
{(!selectedProductTypes.includes(4) && {!selectedProductTypes.includes(4) &&
!selectedProductTypes.includes(7) && gameId !== 6) && ( !selectedProductTypes.includes(7) &&
<div className="w-full h-28 flex flex-col items-center justify-center mx-auto rounded"> gameId !== 6 && (
<CgDanger className="text-4xl" /> <div className="w-full h-28 flex flex-col items-center justify-center mx-auto rounded">
<div className="text-xl mt-4" style={{ direction: "rtl" }}> <CgDanger className="text-4xl" />
این بخش هنوز فعال نشده است. <div className="text-xl mt-4" style={{ direction: "rtl" }}>
این بخش هنوز فعال نشده است.
</div>
</div> </div>
</div> )}
)}
{gameId == 6 && ( {gameId == 6 && (
<div className="w-4/5 mx-auto h-48 flex justify-between text-right items-center border-2 rounded-xl border-red52 "> <div className="w-4/5 mx-auto h-48 flex justify-between text-right items-center border-2 rounded-xl border-red52 ">
<div className="w-1/5 mx-1"> <div className="w-1/5 mx-1">
@ -447,10 +465,154 @@ const Services = ({
</div> </div>
{/* --------------left-part------------------------------------- */} {/* --------------left-part------------------------------------- */}
{!isMobile && ( {!isMobile && (
<div className="w-[23.5%] left-0" style={{ height: "100vh" }}> <div className="w-[23.5%] left-0 " style={{ height: "100vh" }}>
<ShoppingCart /> <ShoppingCart />
</div> </div>
)} )}
{/* --------------payment-box------------------------------------- */}
<div className="w-[93.5vw] h-[93.5vh] bg-black fixed top-[6.5%] left-0 backdrop-blur-md bg-[#0000004D] flex items-center justify-center">
<div className="w-[80%] h-[80%] bg-white rounded-lg px-8 py-2">
<div className="w-full text-right text-2xl text-[#DF1452]">
پرداخت و ثبت تراکنشها
</div>
<div className="payment-container w-full mt-6">
{paymentList.map((item, index) => (
<div
key={index}
className="w-full mb-2 flex justify-between text-black"
>
<select
className="w-[17%] h-10 rounded outline-0 border text-black px-1 py-0"
onChange={(e) => changeType(e, index)}
>
{/* <option value={null}>نوع پرداخت</option> */}
<option value={1}>پرداخت اینترنتی</option>
<option value={2}>کارت به کارت</option>
{/* <option value={3}>پرداخت با چک</option>
<option value={4}>پرداخت نقدی</option> */}
</select>
{/* ------------ */}
<div className="w-[58%]">
<div className="w-full h-10 flex box-border rounded overflow-hidden border">
<div className="w-1/5 bg-[#000] flex items-center justify-center text-white rounded-r">
مبلغ
</div>
<input
type="text"
name="payment-box-amount-input"
id="payment-box-amount-input"
className="w-[70%] h-10 px-1 outline-0 text-center"
/>
<div className="w-[10%] h-full flex items-center justify-center text-sm">
تومان
</div>
</div>
{/* - */}
{item.type === 2 && (
<div className="w-full h-10 flex box-border rounded overflow-hidden border mt-2">
<div className="w-1/5 bg-[#000] flex items-center justify-center text-white rounded-r">
شماره کارت
</div>
<input
type="text"
name="payment-box-amount-input"
id="payment-box-amount-input"
className="w-[80%] h-10 px-1 outline-0 text-center"
/>
</div>
)}
{/* - */}
{item.type === 2 && (
<div className="w-full h-10 flex items-center justify-between mt-1">
<div className="w-[60%] h-10 flex box-border rounded overflow-hidden border mt-2">
<div className="w-[40%] bg-[#000] flex items-center justify-center text-white rounded-r text-sm">
تاریخ پرداخت
</div>
<div className="w-[60%] h-full flex items-center justify-between p-1">
<input
type="text"
className="w-[29%] h-full rounded border text-center text-sm"
/>
<div className="h-full w-[5%] flex items-center justify-center">
/
</div>
<input
type="text"
className="w-[29%] h-full rounded border text-center text-sm"
/>
<div className="h-full w-[5%] flex items-center justify-center">
/
</div>
<input
type="text"
className="w-[29%] h-full rounded border text-center text-sm"
/>
</div>
</div>
{/* ---- */}
<div className="w-[39%] h-10 flex box-border rounded overflow-hidden border mt-2">
<div className="w-[40%] bg-[#000] flex items-center justify-center text-white rounded-r text-sm">
ساعت پرداخت
</div>
<div className="w-[60%] h-full flex justify-between items-center p-1">
<input
type="text"
className="w-[45%] h-full rounded border text-center text-sm"
/>
<div className="h-full w-[5%] flex items-center justify-center">
:
</div>
<input
type="text"
className="w-[45%] h-full rounded border text-center text-sm"
/>
</div>
</div>
</div>
)}
{/* - */}
{item.type === 2 && (
<div className="w-full h-10 flex box-border rounded overflow-hidden border mt-2">
<div className="w-1/5 bg-[#000] flex items-center justify-center text-white rounded-r">
شماره پیگیری
</div>
<input
type="text"
name="payment-box-amount-input"
id="payment-box-amount-input"
className="w-[80%] h-10 px-1 outline-0 text-center"
/>
</div>
)}
</div>
{/* ------------------ */}
<div className="w-[17%] h-10">
{item.type === 1 && (
<div className="w-full h-full rounded bg-[#DF1452] flex items-center justify-center text-white cursor-pointer">
پرداخت
</div>
)}
{item.type === 2 && (
<div className="w-full h-full rounded bg-[#DF1452] flex items-center justify-center text-white cursor-pointer">
ثبت پرداخت
</div>
)}
</div>
{/* ------------------ */}
<div className="w-[4%] h-10 rounded flex items-center justify-center cursor-pointer bg-red-600 text-white" style={index===0 ?{pointerEvents:"none",filter:"grayscale(100%)"}:null} onClick={()=>deletePayment(index)}>
<AiFillDelete className="text-xl text-white"/>
</div>
</div>
))}
</div>
{/* <div
className="w-10 h-10 rounded-full mt-4 border mx-auto border-[#DF1452] cursor-pointer flex items-center justify-center"
onClick={addPaymentHandler}
>
<AiOutlinePlus className="text-2xl text-[#DF1452]" />
</div> */}
</div>
</div>
</div> </div>
); );
} }
@ -576,10 +738,7 @@ const Services = ({
{books {books
?.filter((itm) => selectedProductTypes.includes(itm.productType)) ?.filter((itm) => selectedProductTypes.includes(itm.productType))
.map((product, index) => ( .map((product, index) => (
<div <div className="bg-black" key={`PRODUCT__${gameId}__${index}`}>
className="bg-black"
key={`PRODUCT__${gameId}__${index}`}
>
{selectedProductTypes.includes(4) && ( {selectedProductTypes.includes(4) && (
<Product <Product
key={index} key={index}
@ -700,7 +859,6 @@ const Services = ({
</div> </div>
); );
} }
}; };
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({

@ -1,116 +1,212 @@
import React from "react"; import React from "react";
import Button from "../../../components/Button"; import Button from "../../../components/Button";
import Checkbox from '../../../components/Checkbox'; import Checkbox from "../../../components/Checkbox";
import separate from "../../../utils/separate"; import separate from "../../../utils/separate";
const servicePopUp = ({ const servicePopUp = ({
content, content,
closeOnClick, closeOnClick,
addToCartFunction, addToCartFunction,
sendPrice sendPrice,
}) => { }) => {
return ( return (
<div className="flex justify-center w-full items-center fixed text-right z-30 backdrop-blur" style={{ background: 'rgba(0,0,0,0.1)', height: 'calc(100vh - 6.5vh)', top: '8.5vh' }}> <div
<div className="bg-white flex flex-col w-1/2 rounded-2xl py-6 px-10" > className="flex justify-center w-full items-center fixed text-right z-30 backdrop-blur"
<div className="w-full"> style={{
<div className="w-8 h-8 text-white text-sm rounded-full cursor-pointer flex justify-center items-center bg-red52" onClick={closeOnClick}> background: "rgba(0,0,0,0.1)",
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 15.044 15.044"> height: "calc(100vh - 6.5vh)",
<g id="vuesax_linear_card-remove" data-name="vuesax/linear/card-remove" transform="translate(-252.46 -511.461)"> top: "8.5vh",
<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" /> <div className="bg-white flex flex-col w-1/2 rounded-2xl py-6 px-10">
</g> <div className="w-full">
</g> <div
</svg> className="w-8 h-8 text-white text-sm rounded-full cursor-pointer flex justify-center items-center bg-red52 mb-2"
</div> onClick={closeOnClick}
</div> >
<div className={`flex justify-${content.id === 3 ? 'center' : 'between'} mb-20`} style={{direction: content.id === 1 ? 'rtl' : 'ltr'}} > <svg
{ 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`}> xmlns="http://www.w3.org/2000/svg"
<h1 className="text-red25 font-black text-md"> width="12"
height="12"
{content.id === 4 ? 'کلاس آنلاین ' : content.id === 1 ? 'کتاب ' : null} viewBox="0 0 15.044 15.044"
>
{content.title}</h1> <g
<p className="text-red26 text-sm my-2"> id="vuesax_linear_card-remove"
{content.description} data-name="vuesax/linear/card-remove"
</p> transform="translate(-252.46 -511.461)"
<div className="w-full flex flex-col" style={{direction: 'rtl'}}> >
<div className="flex mb-2"> <g id="card-remove" transform="translate(253.309 512.31)">
<div className="bg-gray-100 rounded w-40 px-4 py-2 ml-2 text-red52">نام کلاس</div> <path
<div className="bg-gray-100 rounded w-full px-4 py-2 ml-2 text-red26">{content.title}</div> id="Vector"
</div> d="M0,13.347,13.347,0"
<div className="flex mb-2"> fill="none"
<div className="bg-gray-100 rounded w-40 px-4 py-2 ml-2 text-red52"> استاد </div> stroke="#fff"
<div className="bg-gray-100 rounded w-full px-4 py-2 ml-2 text-red26">{content.teacher}</div> strokeLinecap="round"
</div> strokeWidth="2"
<div className="flex mb-2"> />
<div className="bg-gray-100 rounded w-40 px-4 py-2 ml-2 text-red52">زمان کلاس</div> <path
<div className="bg-gray-100 rounded w-full px-4 py-2 ml-2 text-red26"> id="Vector-2"
{content.classHour} ساعت و {content.classMinute} دقیقه data-name="Vector"
</div> d="M13.347,13.347,0,0"
</div> fill="none"
stroke="#fff"
strokeLinecap="round"
</div> strokeWidth="2"
/>
</div>} </g>
{ </g>
content.id === 2 && </svg>
<div className="flex w-11/12 flex-col rounded-xl border border-red82OP"> </div>
<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>
<div className="flex w-full border-b border-red82OP text-red26 text-sm font-bold" style={{direction : 'rtl'}}> <div
<div className="w-1/4 flex justify-center py-4 border-l border-red82OP">نوع آزمون : آنلاین</div> className={`flex justify-${
<div className="w-1/4 flex justify-center py-4 border-l border-red82OP">تاریخ شروع : 1400/12/03</div> content.id === 3 ? "center" : "between"
<div className="w-1/4 flex justify-center py-4 border-l border-red82OP">تعداد آزمون : ۱۸</div> } mb-20`}
<div className="w-1/4 flex items-center justify-center py-4 "> بودجه بندی آزمون </div> style={{ direction: content.id === 1 ? "rtl" : "ltr" }}
</div> >
<div className="flex w-full border-b border-red82OP text-red26 text-xs py-3 px-6 " style={{direction : 'rtl'}}> {content.id !== 2 && (
<span className="text-red52 ml-1 font-bold"> <div
توجه: className={`${
</span> content.id === 4
به صورت معمول تمامی آزمون ها برای شما خریداری خواهند شد مگر اینکه شما به صورت دلخواه یک یا چند آزمون را انتخاب نمایید ? "w-1/2"
</div> : content.id === 1
{ ? "w-2/3"
content.examCont?.map( : "w-full"
(item, index) => ( } my-4 mx-2 p-2`}
<div className="flex w-full items-center justify-between border-b border-red82OP font-bold text-red26 text-xs py-3 px-6 " style={{direction : 'rtl'}}> >
<div className="flex items-center font-bold"> <h1 className="text-red25 font-black text-md">
<Checkbox name={`examPackage_${item.id}_${index}`} onclick={(e) => e.target.checked ? sendPrice(item.price) : sendPrice(-item.price)}/> {content.id === 4
<p>{item.title}</p> ? "کلاس آنلاین "
</div> : content.id === 1
<p>تاریخ : {item.date}</p> ? "کتاب "
<p>ساعت : {item.time}</p> : null}
<p>بودجه بندی !</p>
<p>تعداد سوالات: {item.numberOfQ}</p>
<p>{separate(item.price)} تومان</p>
</div>
)
)
}
</div>
}
{content.id === 3 && <video className="w-1/2 rounded-md" controls>
<source
src={`https://dnvn.ir/api/v1/file/20540`}
type="video/mp4"
/>
</video>}
{ {content.title}
content.id === 1 && <img src={content.image} className="w-1/3 rounded-md mt-4" alt="Content"/> </h1>
} <p className="text-red26 text-sm my-2">{content.description}</p>
<div
className="w-full flex flex-col"
style={{ direction: "rtl" }}
>
<div className="flex mb-2">
<div className="bg-gray-100 rounded w-40 px-4 py-2 ml-2 text-red52">
نام کلاس
</div>
<div className="bg-gray-100 rounded w-full px-4 py-2 ml-2 text-red26">
{content.title}
</div>
</div> </div>
<div className="flex w-full items-center justify-start mb-8" style={{direction: 'ltr'}}> <div className="flex mb-2">
<Button title='افزودن به سبد خرید' onClick={addToCartFunction} className="w-40"/> <div className="bg-gray-100 rounded w-40 px-4 py-2 ml-2 text-red52">
{" "}
<h1 className="text-xl font-bold text-red52 p-2 mt-3"> استاد{" "}
مبلغ کل : {separate(content.price)} تومان </div>
</h1> <div className="bg-gray-100 rounded w-full px-4 py-2 ml-2 text-red26">
{content.teacher}
</div>
</div> </div>
<div className="flex mb-2">
<div className="bg-gray-100 rounded w-40 px-4 py-2 ml-2 text-red52">
زمان کلاس
</div>
<div className="bg-gray-100 rounded w-full px-4 py-2 ml-2 text-red26">
{content.classHour} ساعت
</div>
</div>
</div>
</div>
)}
{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" }}
>
<div className="w-1/4 flex justify-center py-4 border-l border-red82OP">
نوع آزمون : آنلاین
</div>
<div className="w-1/4 flex justify-center py-4 border-l border-red82OP">
تاریخ شروع : 1400/12/03
</div>
<div className="w-1/4 flex justify-center py-4 border-l border-red82OP">
تعداد آزمون : ۱۸
</div>
<div className="w-1/4 flex items-center justify-center py-4 ">
{" "}
بودجه بندی آزمون{" "}
</div>
</div>
<div
className="flex w-full border-b border-red82OP text-red26 text-xs py-3 px-6 "
style={{ direction: "rtl" }}
>
<span className="text-red52 ml-1 font-bold">توجه:</span>
به صورت معمول تمامی آزمون ها برای شما خریداری خواهند شد مگر
اینکه شما به صورت دلخواه یک یا چند آزمون را انتخاب نمایید
</div>
{content.examCont?.map((item, index) => (
<div
className="flex w-full items-center justify-between border-b border-red82OP font-bold text-red26 text-xs py-3 px-6 "
style={{ direction: "rtl" }}
>
<div className="flex items-center font-bold">
<Checkbox
name={`examPackage_${item.id}_${index}`}
onclick={(e) =>
e.target.checked
? sendPrice(item.price)
: sendPrice(-item.price)
}
/>
<p>{item.title}</p>
</div>
<p>تاریخ : {item.date}</p>
<p>ساعت : {item.time}</p>
<p>بودجه بندی !</p>
<p>تعداد سوالات: {item.numberOfQ}</p>
<p>{separate(item.price)} تومان</p>
</div>
))}
</div> </div>
)}
{(content.id === 3
&& (
<video className="w-1/2 rounded-md" controls>
<source
src={`https://new.andishmand.ir/api/v1/file/${content?.video}`}
type="video/mp4"
/>
</video>
))}
{content.id === 1 && (
<img
src={content.image}
className="w-1/3 rounded-md mt-4"
alt="Content"
/>
)}
</div> </div>
); {/* <div
className="flex w-full items-center justify-start mb-8"
style={{ direction: "ltr" }}
>
<Button
title="افزودن به سبد خرید"
onClick={addToCartFunction}
className="w-40"
/>
<h1 className="text-xl font-bold text-red52 p-2 mt-3">
مبلغ کل : {separate(content.price)} تومان
</h1>
</div> */}
</div>
</div>
);
}; };
export default servicePopUp; export default servicePopUp;
Loading…
Cancel
Save