From bce548d063c37224f70a4b73661c3e180195aed6 Mon Sep 17 00:00:00 2001 From: Alireza khaji Date: Mon, 16 May 2022 16:59:44 +0430 Subject: [PATCH] some mobile setting --- src/components/Product/index.js | 18 ++--- src/components/ShoppingCart/index.js | 107 ++++++++++++++++++++------- src/redux/actions/userProduct.js | 8 +- src/view/my-services/MyServices.js | 32 ++++++-- src/view/services/PaymentBox.js | 75 ++++++++++++------- src/view/services/index.css | 74 +++++++++++++++++- src/view/services/index.js | 75 ++++--------------- 7 files changed, 255 insertions(+), 134 deletions(-) diff --git a/src/components/Product/index.js b/src/components/Product/index.js index 78781ab..5483ec5 100644 --- a/src/components/Product/index.js +++ b/src/components/Product/index.js @@ -83,9 +83,7 @@ const ProductDesign = ({ if (catId == 3) { return (
@@ -104,14 +102,16 @@ const ProductDesign = ({
-

استاد : {teacher}

+

+ استاد : {product?.teacherName} +

-

نوع گروه : A

+

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

@@ -187,7 +187,7 @@ const ProductDesign = ({

آدرس: {product?.address} @@ -196,7 +196,7 @@ const ProductDesign = ({

@@ -276,7 +276,7 @@ const ProductDesign = ({

{productPrice} تومان

-
+
{!rulesAccepted && ( { - getList(); + 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", + // }, + // }); + } + setShowPaymentBox(true); + } + }, []); + + //---------------------------------------------- + //-------------------------------------- + useEffect(() => { + getList( + { + condition: 0, + }, + { + condition: 0, + } + ); getFactorInfo({ userId }); setHeaderOptions(headerOptions); }, []); @@ -45,11 +89,17 @@ function ShoppingCart({ //payHandler--------------------------------------- const payHandler = () => { - setShowPaymentBox(true); + if(window.innerWidth<1000){ + alert("hoooo"); + setShowPaymentBoxM(true); + }else{ + setShowPaymentBox(true); + } }; return isMobile ? ( + // ============================== mobile ========================================
- {factorInfo?.offPrice && ( -
-

تخفیف

-

{factorInfo?.offPrice} - تومان

-
- )} +
+

تخفیف

+

{factorInfo?.offPrice} - تومان

+
+
+
+ پرداخت {factorInfo?.payPrice ? separate(factorInfo?.payPrice) : 0}
-
+ {/* --------------payment-box------------------------------------- */} + {showPaymentBoxM && ( + + )}
) : ( + // ==============================desktop========================================
paySchool()} + onClick={() => + paySchool({ + redirectUrl: "http://localhost:3000/myServices", + }) + } > پرداخت مستقیم به حساب مدرسه با مبلغ {separate(school.price)}{" "} تومان @@ -301,12 +360,10 @@ function ShoppingCart({

جمع مبالغ خدمات

{factorInfo?.sumPrice} تومان

- {factorInfo?.offPrice && ( -
-

تخفیف

-

{factorInfo?.offPrice} - تومان

-
- )} +
+

تخفیف

+

{factorInfo?.offPrice} - تومان

+