From fa7f68e45b35acc5b252115f29c16418b766d777 Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Tue, 8 Mar 2022 16:07:36 +0330 Subject: [PATCH] reza added something --- src/components/ProductStatusCard/index.js | 14 +++++-- src/redux/actions/userFactor.js | 2 +- src/views/Address/index.js | 2 +- .../Home/Portrait/Private/MyBooks/index.js | 4 +- .../Home/Portrait/Private/Videos/index.js | 4 +- .../Product/Desktop/ProductOverAll/index.js | 2 +- src/views/ShoppingCart/index.js | 40 ++++++++++++++++--- 7 files changed, 53 insertions(+), 15 deletions(-) diff --git a/src/components/ProductStatusCard/index.js b/src/components/ProductStatusCard/index.js index 5e72a01..3e6cda9 100644 --- a/src/components/ProductStatusCard/index.js +++ b/src/components/ProductStatusCard/index.js @@ -44,8 +44,14 @@ const ProductStatusCard = ({
-
- {"فروشنده" + " " + seller} +
+
+ {" "} + {"فروشنده" + " " + seller.name} +
+
+ {"رضایت مشتریان" + " " + "%" + seller.rate * 20} +
@@ -80,7 +86,9 @@ const ProductStatusCard = ({ {offerPrice && (

با خرید این کالا - {' ' + separate(price - offerPrice) + ' ' + 'تومان '} + + {" " + separate(price - offerPrice) + " " + "تومان "} + صرفه جویی کنید

)} diff --git a/src/redux/actions/userFactor.js b/src/redux/actions/userFactor.js index a46962c..7bb2c31 100644 --- a/src/redux/actions/userFactor.js +++ b/src/redux/actions/userFactor.js @@ -24,7 +24,7 @@ const userFactor = { }, //vod - payment: + vodPayment: (data1 = {}, data2 = {}) => async (dispatch) => { await proxy.post("userProduct/addVOD", data1, { dispatch }); diff --git a/src/views/Address/index.js b/src/views/Address/index.js index 2d13b52..b9130fc 100644 --- a/src/views/Address/index.js +++ b/src/views/Address/index.js @@ -201,7 +201,7 @@ export const Address = ({ className="flex flex-col lg:flex-row-reverse flex-1 pt-10 lg:pt-0 pb-20 gap-5 lg:divide-x lg:divide-solid lg:divide-gray-200" // style={{ minHeight: "calc(100vh - 500px)" }} > -
+
{ price={book?.product[type]?.price} garanty={book?.product[type]?.garantyText} suggestedCounter={book?.product[type]?.suggestedCounter} - seller={book?.product[type]?.sellerId} + seller={book?.product[type]?.seller} offerPrice={book?.product[type]?.offerPrice} id={book?.product[type]?.id} shippingTime={book?.product[type]?.shippingTime} diff --git a/src/views/ShoppingCart/index.js b/src/views/ShoppingCart/index.js index 32b8230..9e34388 100644 --- a/src/views/ShoppingCart/index.js +++ b/src/views/ShoppingCart/index.js @@ -1,5 +1,10 @@ import React, { useState, useEffect } from "react"; -import { userProduct, userFactor, publicApi } from "../../redux/actions"; +import { + userProduct, + userFactor, + publicApi, + dialog, +} from "../../redux/actions"; import separate from "../../utils/separate"; import { toast } from "react-toastify"; import DeliveryForm from "../DeliveryForm"; @@ -26,7 +31,9 @@ function ShoppingCart({ setHeaderOptions, desktopContentTransform, userProducts, + payFactor, loading, + setDialog, }) { const [phase, setPhase] = useState("products"); @@ -49,9 +56,22 @@ function ShoppingCart({ const next = { products: () => productsLength - ? setPhase("deliveryForm") + ? userProducts.filter((object) => object.productType === 2).length > 0 + ? setPhase("deliveryForm") + : setDialog({ + type: "confirm", + text: "به درگاه پرداخت بریم؟", + open: true, + accept: () => payFactor({ userId: user.id }), + }) : toast.info("ابتدا یک محصول را به سبد خرید خود اضافه کنید."), - deliveryForm: () => console.log("Go to shaparak"), + deliveryForm: () => + setDialog({ + type: "confirm", + text: "به درگاه پرداخت بریم؟", + open: true, + accept: () => payFactor({ userId: user.id }), + }), profile: () => { console.log("Set profile"); console.log("Go to shaparak"); @@ -284,7 +304,7 @@ function ShoppingCart({

)} - {phase === "deliveryForm" && ( + {null && phase === "deliveryForm" && (
انتخاب شیوه پرداخت @@ -310,8 +330,17 @@ function ShoppingCart({
)} +
+