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

@ -24,7 +24,7 @@ const userFactor = {
}, },
//vod //vod
payment: vodPayment:
(data1 = {}, data2 = {}) => (data1 = {}, data2 = {}) =>
async (dispatch) => { async (dispatch) => {
await proxy.post("userProduct/addVOD", data1, { 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" 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)" }} // 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 <Input
width="100%" width="100%"
label={"ادرس انتخاب شده در نقشه"} label={"ادرس انتخاب شده در نقشه"}

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

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

@ -105,7 +105,7 @@ export const ProductOverAll = ({ book, grades, isDark, loading }) => {
price={book?.product[type]?.price} price={book?.product[type]?.price}
garanty={book?.product[type]?.garantyText} garanty={book?.product[type]?.garantyText}
suggestedCounter={book?.product[type]?.suggestedCounter} suggestedCounter={book?.product[type]?.suggestedCounter}
seller={book?.product[type]?.sellerId} seller={book?.product[type]?.seller}
offerPrice={book?.product[type]?.offerPrice} offerPrice={book?.product[type]?.offerPrice}
id={book?.product[type]?.id} id={book?.product[type]?.id}
shippingTime={book?.product[type]?.shippingTime} shippingTime={book?.product[type]?.shippingTime}

@ -1,5 +1,10 @@
import React, { useState, useEffect } from "react"; 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 separate from "../../utils/separate";
import { toast } from "react-toastify"; import { toast } from "react-toastify";
import DeliveryForm from "../DeliveryForm"; import DeliveryForm from "../DeliveryForm";
@ -26,7 +31,9 @@ function ShoppingCart({
setHeaderOptions, setHeaderOptions,
desktopContentTransform, desktopContentTransform,
userProducts, userProducts,
payFactor,
loading, loading,
setDialog,
}) { }) {
const [phase, setPhase] = useState("products"); const [phase, setPhase] = useState("products");
@ -49,9 +56,22 @@ function ShoppingCart({
const next = { const next = {
products: () => products: () =>
productsLength productsLength
? userProducts.filter((object) => object.productType === 2).length > 0
? setPhase("deliveryForm") ? setPhase("deliveryForm")
: setDialog({
type: "confirm",
text: "به درگاه پرداخت بریم؟",
open: true,
accept: () => payFactor({ userId: user.id }),
})
: toast.info("ابتدا یک محصول را به سبد خرید خود اضافه کنید."), : toast.info("ابتدا یک محصول را به سبد خرید خود اضافه کنید."),
deliveryForm: () => console.log("Go to shaparak"), deliveryForm: () =>
setDialog({
type: "confirm",
text: "به درگاه پرداخت بریم؟",
open: true,
accept: () => payFactor({ userId: user.id }),
}),
profile: () => { profile: () => {
console.log("Set profile"); console.log("Set profile");
console.log("Go to shaparak"); console.log("Go to shaparak");
@ -284,7 +304,7 @@ function ShoppingCart({
</p> </p>
</div> </div>
)} )}
{phase === "deliveryForm" && ( {null && phase === "deliveryForm" && (
<div className="flex flex-col mt-10"> <div className="flex flex-col mt-10">
<strong className="text-tiny text-blue52 mb-5 font-medium"> <strong className="text-tiny text-blue52 mb-5 font-medium">
انتخاب شیوه پرداخت انتخاب شیوه پرداخت
@ -310,8 +330,17 @@ function ShoppingCart({
<br /> <br />
</div> </div>
)} )}
<br />
<br />
<Button <Button
title="ادامه فرایند خرید" title={
phase === "deliveryForm"
? "پرداخت"
: userProducts.filter((object) => object.productType === 2)
.length > 0
? "ادامه فرایند خرید"
: "پرداخت"
}
backgroundColor="bg-blueC0" backgroundColor="bg-blueC0"
border={{ color: "#196EC055", width: "0px" }} border={{ color: "#196EC055", width: "0px" }}
width="100%" width="100%"
@ -357,6 +386,7 @@ const mapDispatchToProps = {
getFactorInfo: userFactor.info, getFactorInfo: userFactor.info,
payFactor: userFactor.payment, payFactor: userFactor.payment,
setHeaderOptions: publicApi.setHeaderOptions, setHeaderOptions: publicApi.setHeaderOptions,
setDialog: dialog.set,
}; };
export default connect(mapStateToProps, mapDispatchToProps)(ShoppingCart); export default connect(mapStateToProps, mapDispatchToProps)(ShoppingCart);

Loading…
Cancel
Save