reza added something

temp
Reza_ashrafi 3 years ago
parent 79ae51e795
commit fa7f68e45b
  1. 14
      src/components/ProductStatusCard/index.js
  2. 2
      src/redux/actions/userFactor.js
  3. 2
      src/views/Address/index.js
  4. 4
      src/views/Home/Portrait/Private/MyBooks/index.js
  5. 4
      src/views/Home/Portrait/Private/Videos/index.js
  6. 2
      src/views/Product/Desktop/ProductOverAll/index.js
  7. 40
      src/views/ShoppingCart/index.js

@ -44,8 +44,14 @@ const ProductStatusCard = ({
<div className="flex flex-row items-center justify-between py-3">
<div className="flex flex-row items-center">
<img src={shop} alt="" className="w-8" />
<div className="flex flex-1 flex-col mr-3 text-sm">
{"فروشنده" + " " + seller}
<div className="flex flex-1 flex-col mr-3 text-sm gap-2">
<div className="text-tiny">
{" "}
{"فروشنده" + " " + seller.name}
</div>
<div className="text-xs">
{"رضایت مشتریان" + " " + "%" + seller.rate * 20}
</div>
</div>
</div>
<img src={circle} alt="" className="w-5" />
@ -80,7 +86,9 @@ const ProductStatusCard = ({
{offerPrice && (
<p className="text-xs font-light text-gray-600 mt-2">
با خرید این کالا
<span className="text-sm font-bold">{' ' + separate(price - offerPrice) + ' ' + 'تومان '}</span>
<span className="text-sm font-bold">
{" " + separate(price - offerPrice) + " " + "تومان "}
</span>
صرفه جویی کنید
</p>
)}

@ -24,7 +24,7 @@ const userFactor = {
},
//vod
payment:
vodPayment:
(data1 = {}, data2 = {}) =>
async (dispatch) => {
await proxy.post("userProduct/addVOD", data1, { dispatch });

@ -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)" }}
>
<div className="flex flex-col-reverse w-full lg:w-1/2">
<div className="flex flex-col w-full lg:w-1/2">
<Input
width="100%"
label={"ادرس انتخاب شده در نقشه"}

@ -14,8 +14,8 @@ function MyBooks({ books, grades, isMobile }) {
alt=""
className="rounded-sm"
style={{
height: isMobile ? "" : "calc(100vh / 5)",
width: isMobile ? "" : "calc(100vh / 5 * 3 / 4)",
height: isMobile ? "" : "calc(100vh / 4)",
width: isMobile ? "" : "calc(100vh / 4 * 3 / 4)",
minHeight: isMobile ? "calc(100vh / 5)" : "",
minWidth: isMobile ? "calc(100vh / 5 * 3 / 4)" : "",
maxHeight: isMobile ? 100 : "",

@ -20,8 +20,8 @@ function Videos({ videos, grades, isDark, isMobile }) {
alt=""
className="rounded-sm"
style={{
height: isMobile ? "" : "calc(100vw / 8 * 2 / 4)",
width: isMobile ? "" : "calc(100vw / 8 )",
height: isMobile ? "" : "calc(100vw / 6 * 3 / 4.5)",
width: isMobile ? "" : "calc(100vw / 6 )",
maxHeight: isMobile ? "calc(100vw / 2 * 2 / 3)" : "",
minWidth: isMobile ? "calc(100vw / 2)" : "",
}}

@ -105,7 +105,7 @@ export const ProductOverAll = ({ book, grades, isDark, loading }) => {
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}

@ -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({
</p>
</div>
)}
{phase === "deliveryForm" && (
{null && phase === "deliveryForm" && (
<div className="flex flex-col mt-10">
<strong className="text-tiny text-blue52 mb-5 font-medium">
انتخاب شیوه پرداخت
@ -310,8 +330,17 @@ function ShoppingCart({
<br />
</div>
)}
<br />
<br />
<Button
title="ادامه فرایند خرید"
title={
phase === "deliveryForm"
? "پرداخت"
: userProducts.filter((object) => object.productType === 2)
.length > 0
? "ادامه فرایند خرید"
: "پرداخت"
}
backgroundColor="bg-blueC0"
border={{ color: "#196EC055", width: "0px" }}
width="100%"
@ -357,6 +386,7 @@ const mapDispatchToProps = {
getFactorInfo: userFactor.info,
payFactor: userFactor.payment,
setHeaderOptions: publicApi.setHeaderOptions,
setDialog: dialog.set,
};
export default connect(mapStateToProps, mapDispatchToProps)(ShoppingCart);

Loading…
Cancel
Save