reza added something

temp
Reza_ashrafi 3 years ago
parent 48a7083099
commit c35bf617db
  1. 2
      src/components/Button/index.js
  2. 4
      src/components/CourseChapter/index.js
  3. 4
      src/components/ProductStatusCard/index.js
  4. 6
      src/views/ShoppingCart/Code/index.js
  5. 22
      src/views/ShoppingCart/Product/index.js
  6. 11
      src/views/ShoppingCart/index.js
  7. 4
      src/views/Video/index.js

@ -34,7 +34,7 @@ export default function Button({
}} }}
onClick={() => onClick()} onClick={() => onClick()}
> >
{loading ? <Loading size={2} color="bg-green-500" /> : title} {loading ? <Loading size={4} color="bg-green-800" /> : title}
</button> </button>
); );
} }

@ -47,7 +47,7 @@ const CourseChapter = ({
</div> </div>
<span className="w-full h-px bg-blue-200 my-4"></span> <span className="w-full h-px bg-blue-200 my-4"></span>
<div className="overflow-y-scroll w-full hasScrollbar flex-1 flex flex-col"> <div className="overflow-y-scroll w-full hasScrollbar flex-1 flex flex-col">
<div className="bg-blueC0 rounded-sm p-4 flex flex-row items-center justify-between mb-2"> <div className="bg-green-600 rounded-sm p-4 flex flex-row items-center justify-between mb-2">
<p className="text-tiny font-bold text-white"> <p className="text-tiny font-bold text-white">
{seasons?.length > 0 && {seasons?.length > 0 &&
playList?.length > 0 && playList?.length > 0 &&
@ -92,7 +92,7 @@ const CourseChapter = ({
className={`w-full bg-white flex flex-col transition duration-400 hover:scale-95 shadow-md transform rounded-md className={`w-full bg-white flex flex-col transition duration-400 hover:scale-95 shadow-md transform rounded-md
${ ${
selectedVideo?.id === video?.id selectedVideo?.id === video?.id
? "bg-blueC0 text-white" ? "bg-green-600 text-white"
: "text-blueC0" : "text-blueC0"
} }
`} `}

@ -53,9 +53,9 @@ const ProductStatusCard = ({
</div> </div>
))} ))}
<div className="flex flex-col items-center py-3"> <div className="flex flex-col items-center py-3">
<p className="text-xl text-green4F"> <p className="text-xl text-blueC0 font-bold">
{separate(price)} {separate(price)}
<span className="text-sm text-gray-700 font-light">تومان</span> <span className="text-sm text-gray-700 font-light mr-1">تومان</span>
</p> </p>
<p className="text-xs font-light text-gray-600 mt-2"> <p className="text-xs font-light text-gray-600 mt-2">
با خرید این کالا با خرید این کالا

@ -10,13 +10,13 @@ function Code({ codeId, setCodeId, userId, factorId }) {
} }
return ( return (
<form className="flex w-full flex-row border border-blueC0 border-solid rounded-md mt-3 overflow-hidden"> <form className="flex w-full flex-row border border-blueC0 border-solid rounded-md mt-3 overflow-hidden lg:w-2/5 lg:mt-5">
<input <input
type="text" type="text"
className="border-0 flex-1 text-right pr-3 font-medium text-tiny dark:bg-gray2077 placeholder:text-blue5F dark:text-white" className="border-0 flex-1 text-right pr-3 font-medium text-tiny dark:bg-gray2077 placeholder:text-blue5F dark:text-white outline-none lg:text-base lg:font-bold"
placeholder={"کد تخفیف دارید ؟"} placeholder={"کد تخفیف دارید ؟"}
/> />
<button className={"py-3 px-4 text-tiny bg-blueC0 text-white border border-blueC0 border-solid"} onClick={setOff}>ثبت کد</button> <button className={"py-3 px-4 lg:py-4 text-tiny bg-blueC0 text-white border border-blueC0 border-solid lg:font-bold"} onClick={setOff}>ثبت کد</button>
</form> </form>
); );
} }

@ -1,4 +1,4 @@
import React, {useState} from "react"; import React, { useState } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { userProduct } from "../../../redux/actions"; import { userProduct } from "../../../redux/actions";
import separate from "../../../utils/separate"; import separate from "../../../utils/separate";
@ -10,6 +10,7 @@ import exitIcon from "../../../assets/icons/exit.svg";
import deleteIcon from "../../../assets/icons/delete.svg"; import deleteIcon from "../../../assets/icons/delete.svg";
function Product({ product, grades, pushToCart, isMobile, loading }) { function Product({ product, grades, pushToCart, isMobile, loading }) {
let id;
return isMobile ? ( return isMobile ? (
<div className="flex flex-row justify-between py-5 border-b border-solid border-grayDB dark:border-gray45"> <div className="flex flex-row justify-between py-5 border-b border-solid border-grayDB dark:border-gray45">
<div className="flex flex-row"> <div className="flex flex-row">
@ -89,7 +90,12 @@ function Product({ product, grades, pushToCart, isMobile, loading }) {
</div> </div>
</div> </div>
) : ( ) : (
<div className="flex flex-row w-full gap-10 py-4 border-b border-solid border-gray-200"> <div
className="flex flex-row w-full gap-10 py-4 border-b border-solid border-gray-200"
onClick={() => {
id = product?.id;
}}
>
<div className="w-3/4 flex flex-row"> <div className="w-3/4 flex flex-row">
<img <img
src={"https://dnvn.ir/api/v1/file/" + product?.product?.book?.fileIds} src={"https://dnvn.ir/api/v1/file/" + product?.product?.book?.fileIds}
@ -119,7 +125,7 @@ function Product({ product, grades, pushToCart, isMobile, loading }) {
</div> </div>
<div className="w-1/4 flex flex-row items-center"> <div className="w-1/4 flex flex-row items-center">
<button <button
className="rounded-md pt-2 pb-1.5 px-3 border border-solid border-blueC0 text-blueC0 text-lg ffont-bold" className="rounded-md pt-1 px-1.5 border border-solid border-blueC0 text-blueC0 text-lg font-bold"
onClick={() => onClick={() =>
pushToCart({ pushToCart({
productId: product?.productId, productId: product?.productId,
@ -130,8 +136,12 @@ function Product({ product, grades, pushToCart, isMobile, loading }) {
> >
+ +
</button> </button>
<span className="mx-2.5 font-semibold text-lg text-green4F w-8 flex justify-center"> <span className="mx-2.5 font-semibold text-5xl text-green4F w-8 flex justify-center">
{loading ? <Loading size={2} color="bg-green-500" /> : product.count} {loading ? (
<Loading size={2} color="bg-green-500" />
) : (
product.count
)}
</span> </span>
{ {
<> <>
@ -154,7 +164,7 @@ function Product({ product, grades, pushToCart, isMobile, loading }) {
/> />
) : ( ) : (
<button <button
className="rounded-md pt-2 pb-1.5 font-bold px-3.5 border border-solid border-blueC0 text-blueC0 dark:border-blueC0 dark:text-blueC0 text-lg" className="rounded-md px-2 font-bold border border-solid border-blueC0 text-blueC0 dark:border-blueC0 dark:text-blueC0 text-2xl"
onClick={() => onClick={() =>
pushToCart({ pushToCart({
productId: product?.productId, productId: product?.productId,

@ -75,6 +75,9 @@ function ShoppingCart({
) )
)} )}
</ul> </ul>
<div className="w-full flex justify-end">
<Code />
</div>
</div> </div>
); );
}; };
@ -191,18 +194,18 @@ function ShoppingCart({
<div className="flex flex-col w-full border-t py-2 border-gray-300 border-b"> <div className="flex flex-col w-full border-t py-2 border-gray-300 border-b">
<PriceStatus <PriceStatus
name="مبلغ سبد خرید" name="مبلغ سبد خرید"
value={productsLength ? factorInfo?.sumPrice : 384000} value={productsLength ? factorInfo?.sumPrice : ''}
type="normal" type="normal"
/> />
<PriceStatus <PriceStatus
name="میزان تخفیف" name="میزان تخفیف"
value={productsLength ? factorInfo?.offPrice : 384000} value={productsLength ? factorInfo?.offPrice : ''}
type="error" type="error"
/> />
<PriceStatus <PriceStatus
name="مالیات بر ارزش افزوده" name="مالیات بر ارزش افزوده"
value={ value={
productsLength ? Math.floor(factorInfo?.sumPrice * 0.009) : 384000 productsLength ? Math.floor(factorInfo?.sumPrice * 0.009) : ''
} }
type="error" type="error"
/> />
@ -212,7 +215,7 @@ function ShoppingCart({
جمع کل سبد خرید جمع کل سبد خرید
</strong> </strong>
<p className="font-medium text-greenBA text-lg dark:text-white"> <p className="font-medium text-greenBA text-lg dark:text-white">
{separate(productsLength ? factorInfo?.payPrice : 384000)} {separate(productsLength ? factorInfo?.payPrice : '')}
<span className="font-medium text-greenBA text-sm mr-2"> <span className="font-medium text-greenBA text-sm mr-2">
تومان تومان
</span> </span>

@ -152,7 +152,7 @@ function Video({
/> />
)} )}
</div> </div>
<div className="w-3/12 flex flex-col"> <div className="w-3/12 flex flex-col" style={{minWidth: 350}}>
<div className="w-full flex flex-col pr-2 py-2 border-0"> <div className="w-full flex flex-col pr-2 py-2 border-0">
<h1 className="text-blue5F mb-3 font-semibold text-xl dark:text-white"> <h1 className="text-blue5F mb-3 font-semibold text-xl dark:text-white">
{"دوره ویدئویی" + " " + book?.name} {"دوره ویدئویی" + " " + book?.name}
@ -209,7 +209,7 @@ function Video({
</div> </div>
</div> </div>
<Link <Link
to={"/products/" + book?.id} to={"/products/" + location.getId()}
className="bg-blueC0 text-green7B bg-opacity-5 font-semibold text-tiny rounded-md border border-solid border-blueC0 w-full py-4 text-center flex flex-row items-center justify-center" className="bg-blueC0 text-green7B bg-opacity-5 font-semibold text-tiny rounded-md border border-solid border-blueC0 w-full py-4 text-center flex flex-row items-center justify-center"
> >
مشاهده کتاب این محصول مشاهده کتاب این محصول

Loading…
Cancel
Save