before begaii
parent
a3ead155c9
commit
e2a947a61a
|
@ -49,16 +49,16 @@ const CardCategories = ({ data }) => {
|
|||
{!!data.mainImage ? (
|
||||
<Image
|
||||
src={`${process.env.NEXT_PUBLIC_STORAGE_URL}/${data.mainImage}`}
|
||||
width={100}
|
||||
height={100}
|
||||
className="xs:!w-[110px] lg:!w-[130px] mx-auto !object-cover"
|
||||
width={200}
|
||||
height={200}
|
||||
className="xs:!w-[110px] lg:!w-[130px] mx-auto"
|
||||
alt=""
|
||||
/>
|
||||
) : (
|
||||
<div className="xs:!w-[85px] lg:!w-[85px] h-[90px] mt-10 ">
|
||||
<Image
|
||||
src={logo}
|
||||
className="xs:!w-[70px] lg:!w-[70px] mx-auto !object-cover opacity-25 mt-5"
|
||||
className="xs:!w-[70px] lg:!w-[70px] mx-auto opacity-25 mt-5"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
|
@ -69,10 +69,9 @@ const CardCategories = ({ data }) => {
|
|||
{data.persianName}{" "}
|
||||
</p>
|
||||
|
||||
{data.stock <= 3 && (
|
||||
<p className="mb-0 xs:text-[11px] lg:text-[12px] xl:text-[13px] text-red-600 font-medium">
|
||||
{" "}
|
||||
{data.stock}عدد موجود انبار
|
||||
{data.stock <= 3 && data.stock !== 0 && (
|
||||
<p className="mb-0 text-[11px] text-red-600 font-medium">
|
||||
{data.stock} عدد موجود انبار
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
@ -19,16 +19,16 @@ const CardCategoriesMobile = ({ data }) => {
|
|||
{!!data.mainImage ? (
|
||||
<Image
|
||||
src={`${process.env.NEXT_PUBLIC_STORAGE_URL}/${data.mainImage}`}
|
||||
width={100}
|
||||
height={100}
|
||||
className="xs:!w-[110px] lg:!w-[130px] mx-auto !object-cover"
|
||||
width={200}
|
||||
height={200}
|
||||
className="xs:!w-[110px] lg:!w-[130px] mx-auto "
|
||||
alt=""
|
||||
/>
|
||||
) : (
|
||||
<div className="xs:!w-[85px] lg:!w-[85px] ">
|
||||
<Image
|
||||
src={logo}
|
||||
className="xs:!w-[70px] lg:!w-[70px] mx-auto !object-cover opacity-25 mt-5"
|
||||
className="xs:!w-[70px] lg:!w-[70px] mx-auto opacity-25 mt-5"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
|
@ -43,10 +43,9 @@ const CardCategoriesMobile = ({ data }) => {
|
|||
{data?.persianName}
|
||||
</p>
|
||||
</Link>
|
||||
{data.stock <= 3 && (
|
||||
<p className="mb-0 xs:text-[11px] lg:text-[12px] xl:text-[13px] text-red-600 font-medium">
|
||||
{" "}
|
||||
{data.stock}عدد موجود انبار
|
||||
{data.stock <= 3 && data.stock !== 0 && (
|
||||
<p className="mb-0 text-[11px] text-red-600 font-medium">
|
||||
{data.stock} عدد موجود انبار
|
||||
</p>
|
||||
)}
|
||||
<div className=" rounded-full flex ltr pt-2 mt-2 w-full">
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
"use client";
|
||||
import { useContext } from "react";
|
||||
import React, { useContext } from "react";
|
||||
import { SwiperSlide } from "swiper/react";
|
||||
import logo from "../../../public/images/logo.png";
|
||||
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import PersianNumber from "plugins/PersianNumber";
|
||||
import AddToCart from "../Components/AddToCart/page";
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import AddToCart from "../Components/AddToCart/Page";
|
||||
import Link from "next/link";
|
||||
|
||||
const CardNormal = ({ data }) => {
|
||||
const CTX = useContext(AppContext);
|
||||
|
@ -41,16 +42,16 @@ const CardNormal = ({ data }) => {
|
|||
{!!data.mainImage ? (
|
||||
<Image
|
||||
src={`${process.env.NEXT_PUBLIC_STORAGE_URL}/${data.mainImage}`}
|
||||
width={100}
|
||||
height={100}
|
||||
className="xs:!w-[110px] lg:!w-[130px] mx-auto !object-cover"
|
||||
width={200}
|
||||
height={200}
|
||||
className="xs:!w-[110px] lg:!w-[130px] mx-auto"
|
||||
alt=""
|
||||
/>
|
||||
) : (
|
||||
<div className="xs:!w-[85px] lg:!w-[85px] h-[90px] mt-10 ">
|
||||
<div className="xs:!w-[85px] lg:!w-[85px] h-[90px] xs:mt-5 lg:mt-10 ">
|
||||
<Image
|
||||
src={logo}
|
||||
className="xs:!w-[70px] lg:!w-[70px] mx-auto !object-cover opacity-25 mt-5"
|
||||
className="xs:!w-[70px] lg:!w-[70px] mx-auto opacity-25 mt-5"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
|
@ -58,13 +59,12 @@ const CardNormal = ({ data }) => {
|
|||
</div>
|
||||
<div className="p-3 text-right">
|
||||
<p className="mb-0 text-[14px] max-h-[44px] overflow-hidden ">
|
||||
{data.persianName}{" "}
|
||||
{data.persianName}
|
||||
</p>
|
||||
|
||||
{data.stock <= 3 && (
|
||||
{data.stock <= 3 && data.stock !== 0 && (
|
||||
<p className="mb-0 text-[11px] text-red-600 font-medium">
|
||||
{" "}
|
||||
{data.stock}عدد موجود انبار
|
||||
{data.stock} عدد موجود انبار
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
@ -1,60 +1,97 @@
|
|||
"use client";
|
||||
import { useContext } from "react";
|
||||
import logo from "../../../public/images/logo.png";
|
||||
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import PersianNumber from "plugins/PersianNumber";
|
||||
import p1 from "../../../public/images/product/1.png";
|
||||
import AddToCart from "../Components/AddToCart/page";
|
||||
|
||||
const CardSurprise = () => {
|
||||
const CardSurprise = ({ data }) => {
|
||||
const CTX = useContext(AppContext);
|
||||
const cart = CTX.state.cart;
|
||||
return (
|
||||
<div>
|
||||
<>
|
||||
{" "}
|
||||
<>
|
||||
<div
|
||||
className={` tr03 py-2 overflow-hidden xs:h-[200px] lg:h-[250px] ${
|
||||
1 == 1 ? "bg-white rounded-xl" : " opacity-70"
|
||||
}`}
|
||||
// key={index}
|
||||
// onClick={() => handleRoutineShiftPlanWithDay(index)}
|
||||
>
|
||||
<div className="absolute m-3 ">
|
||||
<div className="w-fit rounded-full bg-red-900 overflow-hidden px-1 ">
|
||||
<p className="mb-0 text-[10px] text-white pt-[3px] ">
|
||||
<PersianNumber number={35} />
|
||||
<small className="text-[10px] ml-1">%</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>{" "}
|
||||
<div className="w-full h-fit ">
|
||||
<Image
|
||||
src={p1}
|
||||
className="xs:w-[110px] lg:w-[170px] mx-auto"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<div className="p-3 text-right">
|
||||
<p className="mb-0 text-[15px] font-bold max-h-[50px] ">
|
||||
لوسیون بدن سلامتی | maya
|
||||
</p>
|
||||
<p className="mb-0 text-[12px] text-red-600 font-medium">
|
||||
{" "}
|
||||
3 عدد موجود انبار
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
<div className="bg-white rounded-full flex ltr p-3 mt-2 w-full">
|
||||
<AddToCart />
|
||||
<Link href={`/products/${data.id}`}>
|
||||
<div
|
||||
className={` tr03 py-2 overflow-hidden xs:h-[200px] lg:h-[230px] border border-gray-100 ${
|
||||
1 == 1 ? "bg-white rounded-xl" : " opacity-70"
|
||||
}`}
|
||||
// key={index}
|
||||
// onClick={() => handleRoutineShiftPlanWithDay(index)}
|
||||
>
|
||||
{data.hasDiscount && (
|
||||
<div className="absolute m-3 ">
|
||||
<div className="w-fit rounded-lg bg-red-600 overflow-hidden px-1 ">
|
||||
<p className="mb-0 text-[10px] text-white pt-[3px] ">
|
||||
<PersianNumber
|
||||
number={data.discountPercent}
|
||||
style={"!text-[10px]"}
|
||||
/>
|
||||
<small className="text-[10px] ml-1">%</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="w-full text-right rounded-full">
|
||||
{2 == 2 ? (
|
||||
<div className="w-full h-fit flex justify-center ">
|
||||
{!!data.mainImage ? (
|
||||
<Image
|
||||
src={`${process.env.NEXT_PUBLIC_STORAGE_URL}/${data.mainImage}`}
|
||||
width={100}
|
||||
height={100}
|
||||
className="xs:!w-[110px] lg:!w-[130px] mx-auto !object-cover"
|
||||
alt=""
|
||||
/>
|
||||
) : (
|
||||
<div className="xs:!w-[85px] lg:!w-[85px] h-[90px] mt-10 ">
|
||||
<Image
|
||||
src={logo}
|
||||
className="xs:!w-[70px] lg:!w-[70px] mx-auto !object-cover opacity-25 mt-5"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="p-3 text-right">
|
||||
<p className="mb-0 text-[14px] max-h-[44px] overflow-hidden ">
|
||||
{data.persianName}{" "}
|
||||
</p>
|
||||
|
||||
{data.stock <= 3 && data.stock !== 0 && (
|
||||
<p className="mb-0 text-[11px] text-red-600 font-medium">
|
||||
{data.stock} عدد موجود انبار
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
</>
|
||||
<div className="bg-gray-50 rounded-lg flex ltr p-1 mt-2 border border-gray-100">
|
||||
<div className="flex w-full">
|
||||
<AddToCart data={data} theme={1} />
|
||||
</div>
|
||||
|
||||
<div className="w-full text-right rounded-full pr-2">
|
||||
{data?.hasDiscount ? (
|
||||
<>
|
||||
<p className="mb-0 font-bold text-sm absolute right-3 opacity-30 mt-[-5px] text-red-600">
|
||||
<del>
|
||||
<PersianNumber number={150000} style={"text-[13px]"} />
|
||||
<PersianNumber
|
||||
number={(data?.cost / 10).toLocaleString()}
|
||||
style="!text-[11px]"
|
||||
/>
|
||||
</del>
|
||||
</p>
|
||||
<div className="flex rtl mt-[8px]">
|
||||
{" "}
|
||||
<p className="mb-0 font-bold">
|
||||
<PersianNumber number={150000} />
|
||||
<PersianNumber
|
||||
number={(data?.costWithDiscount / 10).toLocaleString()}
|
||||
/>
|
||||
</p>
|
||||
<small className="mr-1 mt-[3px]">تومان</small>
|
||||
</div>
|
||||
|
@ -63,14 +100,14 @@ const CardSurprise = () => {
|
|||
<div className="flex rtl mt-[3px]">
|
||||
{" "}
|
||||
<p className="mb-0 font-bold text-lg">
|
||||
<PersianNumber number={150000} />
|
||||
<PersianNumber number={(data?.cost / 10).toLocaleString()} />
|
||||
</p>
|
||||
<small className="mr-1 mt-[6px]">تومان</small>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -7,16 +7,6 @@ const AddToCart = ({ data, theme }) => {
|
|||
const CTX = useContext(AppContext);
|
||||
const cart = CTX.state.cart;
|
||||
|
||||
console.log(
|
||||
data?.id,
|
||||
data?.persianName,
|
||||
data?.cost,
|
||||
data?.costWithDiscount,
|
||||
data?.mainImage,
|
||||
data?.hasDiscount,
|
||||
data?.maxOrderCount
|
||||
);
|
||||
|
||||
const handleAddItemToCart = (id) => {
|
||||
CTX.AddItemToCart(
|
||||
data?.id,
|
||||
|
|
|
@ -90,40 +90,9 @@ const FilterCategoryMobile = (props) => {
|
|||
</div>
|
||||
|
||||
{trendFilter ? (
|
||||
<div className=" flex overflow-auto whitespace-nowrap rtl px-2 mb-5 mt-5 ">
|
||||
{/* <div
|
||||
className="bg-primary-500 p-1 px-2 mx-1 rounded-full"
|
||||
onClick={() => props.setSortBy(1)}
|
||||
>
|
||||
<p className="mb-0 text-sm text-white">پربازدید ترین ها</p>
|
||||
</div>
|
||||
<div className=" flex overflow-auto whitespace-nowrap rtl px-2 mb-5 mt-5 hide-scrollBar ">
|
||||
<div
|
||||
className="bg-primary-500 p-1 px-2 mx-1 rounded-full"
|
||||
onClick={() => props.setSortBy(2)}
|
||||
>
|
||||
<p className="mb-0 text-sm text-white">پربازدید ها</p>
|
||||
</div>
|
||||
<div
|
||||
className="bg-primary-500 p-1 px-2 mx-1 rounded-full"
|
||||
onClick={() => props.setSortBy(3)}
|
||||
>
|
||||
<p className="mb-0 text-sm text-white"> ترین ها</p>
|
||||
</div>
|
||||
<div
|
||||
className="bg-primary-500 p-1 px-2 mx-1 rounded-full"
|
||||
onClick={() => props.setSortBy(4)}
|
||||
>
|
||||
<p className="mb-0 text-sm text-white">پربازدید ها</p>
|
||||
</div>
|
||||
<div
|
||||
className="bg-primary-500 p-1 px-2 mx-1 rounded-full"
|
||||
onClick={() => props.setSortBy(5)}
|
||||
>
|
||||
<p className="mb-0 text-sm text-white">پربازدید ترین </p>
|
||||
</div> */}
|
||||
|
||||
<div
|
||||
className={`w-fit rounded-full px-2 mx-2 tr03 ${
|
||||
className={`w-fit rounded-full px-2 mx-1 tr03 ${
|
||||
props.sortBy == 1 ? "bg-primary-600" : " opacity-60 "
|
||||
}`}
|
||||
onClick={() => props.setSortBy(1)}
|
||||
|
@ -137,7 +106,7 @@ const FilterCategoryMobile = (props) => {
|
|||
</p>
|
||||
</div>
|
||||
<div
|
||||
className={`w-fit rounded-full px-2 mx-2 tr03 ${
|
||||
className={`w-fit rounded-full px-2 mx-1 tr03 ${
|
||||
props.sortBy == 2 ? "bg-primary-600" : " opacity-60 "
|
||||
}`}
|
||||
onClick={() => props.setSortBy(2)}
|
||||
|
@ -151,7 +120,7 @@ const FilterCategoryMobile = (props) => {
|
|||
</p>
|
||||
</div>
|
||||
<div
|
||||
className={`w-fit rounded-full px-2 mx-2 tr03 ${
|
||||
className={`w-fit rounded-full px-2 mx-1 tr03 ${
|
||||
props.sortBy == 3 ? "bg-primary-600" : " opacity-60 "
|
||||
}`}
|
||||
onClick={() => props.setSortBy(3)}
|
||||
|
@ -165,7 +134,7 @@ const FilterCategoryMobile = (props) => {
|
|||
</p>
|
||||
</div>
|
||||
<div
|
||||
className={`w-fit rounded-full px-2 mx-2 tr03 ${
|
||||
className={`w-fit rounded-full px-2 mx-1 tr03 ${
|
||||
props.sortBy == 4 ? "bg-primary-600" : " opacity-60 "
|
||||
}`}
|
||||
onClick={() => props.setSortBy(4)}
|
||||
|
@ -179,7 +148,7 @@ const FilterCategoryMobile = (props) => {
|
|||
</p>
|
||||
</div>
|
||||
<div
|
||||
className={`w-fit rounded-full px-2 mx-2 tr03 ${
|
||||
className={`w-fit rounded-full px-2 mx-1 tr03 ${
|
||||
props.sortBy == 5 ? "bg-primary-600" : " opacity-60 "
|
||||
}`}
|
||||
onClick={() => props.setSortBy(5)}
|
||||
|
|
|
@ -12,9 +12,9 @@ const HeroSection = () => {
|
|||
<div className=" xs:mt-[150px] md:mt-[60px] xl:mt-[180px] relative">
|
||||
<div className="text-center">
|
||||
<h1 className=" xs:text-3xl lg:text-5xl xl:text-6xl text-white font-bold">
|
||||
وسمه ، بن ماضـــــــــــــــــی زیبایی
|
||||
وسمه ، بُن مضـــــــــــارع زیبایی
|
||||
</h1>
|
||||
<h2 className="text-white mt-2 xs:text-sm lg:text-lg xl:text-xl font-light">
|
||||
<h2 className="text-gray-300 mt-4 xs:text-sm lg:text-lg xl:text-xl font-light ">
|
||||
پلتفرم زیبایی ایرانی راهی برای زیبایی بهتر
|
||||
</h2>
|
||||
</div>
|
||||
|
|
|
@ -2,6 +2,7 @@ import CardNormal from "@comp/Cards/CardNormal/page";
|
|||
import Image from "next/image";
|
||||
import { Swiper, SwiperSlide } from "swiper/react";
|
||||
import khane from "../../../public/images/khane.jpg";
|
||||
import CardSurprise from "@comp/Cards/CardSurprise/page";
|
||||
|
||||
const HomeSection = ({ data }) => {
|
||||
return (
|
||||
|
@ -14,7 +15,7 @@ const HomeSection = ({ data }) => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bg-gray-100 relative xs:left-[0px] lg:left-[30px] xs:top-[-35px] lg:top-0 col-span-2 z-0 rounded-3xl xs:pr-5 lg:pr-[55px] xs:pt-[55px] lg:pt-3 xl:pt-10 pl-5 xs:pb-10 lg:pb-0">
|
||||
<div className="relative xs:left-[0px] lg:left-[30px] xs:top-[-35px] lg:top-0 col-span-2 z-0 rounded-3xl xs:pr-5 lg:pr-[55px] xs:pt-[55px] lg:pt-3 xl:pt-10 pl-5 xs:pb-10 lg:pb-0">
|
||||
<div className="xs:block lg:flex">
|
||||
<h2 className="xs:text-2xl lg:text-xl xl:text-3xl font-bold">
|
||||
لوازم بهداشتی منزل وسمه
|
||||
|
@ -51,7 +52,7 @@ const HomeSection = ({ data }) => {
|
|||
>
|
||||
{data?.map((e, index) => (
|
||||
<SwiperSlide key={index}>
|
||||
<CardNormal data={e} />
|
||||
<CardSurprise data={e} />
|
||||
</SwiperSlide>
|
||||
))}
|
||||
</Swiper>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import CardNormal from "@comp/Cards/CardNormal/page";
|
||||
import TimerDown from "@comp/TimerDown/TimerDown";
|
||||
import { Swiper, SwiperSlide } from "swiper/react";
|
||||
|
||||
const SurpriseSection = ({ data }) => {
|
||||
|
@ -29,7 +30,7 @@ const SurpriseSection = ({ data }) => {
|
|||
<p className="mb-0 text-white font-bold xs:text-sm lg:text-2xl xl:text-2xl">
|
||||
پیشنهاد های ویژه امروز{" "}
|
||||
</p>
|
||||
{/* <TimerDown /> */}
|
||||
<TimerDown />
|
||||
</div>
|
||||
</div>
|
||||
<Swiper
|
||||
|
|
|
@ -177,7 +177,7 @@ const Navbar = ({ theme }) => {
|
|||
|
||||
<div
|
||||
className={`flex justify-center rtl pt-3 tr03 z-50 tr03 ${
|
||||
navItemHover != null ? "bg-navbar rounded-xl " : "bg-transparent"
|
||||
navItemHover != null ? "bg-white rounded-xl " : "bg-transparent"
|
||||
}${
|
||||
isScrolled
|
||||
? " !fixed top-0 w-full bg-white "
|
||||
|
@ -191,10 +191,10 @@ const Navbar = ({ theme }) => {
|
|||
<p
|
||||
className={`mb-0 pb-4 px-2 tr03 cursor-pointer ${
|
||||
navItemHover == index
|
||||
? "font-bold border-b-[3px] border-gray-400 text-black "
|
||||
: "border-b-[3px] border-transparent "
|
||||
? " border-y-[5px] border-b-primary-800 border-t-transparent text-primary-900"
|
||||
: "border-y-[5px] border-y-transparent text-black"
|
||||
}
|
||||
${theme == 0 ? "text-gray-300" : "text-gray-900"}
|
||||
${theme == 0 ? "text-gray-400" : "text-gray-900"}
|
||||
${theme == 0 && isScrolled ? "text-gray-900" : ""}`}
|
||||
onMouseEnter={() => handleItemNavber(index)}
|
||||
onMouseLeave={() => setNavItemHover(null)}
|
||||
|
@ -347,13 +347,15 @@ const Navbar = ({ theme }) => {
|
|||
} `}
|
||||
>
|
||||
{" "}
|
||||
<div className="w-[70px] mt-[6px] z-10 ">
|
||||
{isScrolled ? (
|
||||
<Image src={theme == 0 ? logoBlack : logoBlack} alt="" />
|
||||
) : (
|
||||
<Image src={theme == 0 ? logoWhite : logoBlack} alt="" />
|
||||
)}
|
||||
</div>
|
||||
<Link href={"/"}>
|
||||
<div className="w-[70px] mt-[6px] z-10 ">
|
||||
{isScrolled ? (
|
||||
<Image src={theme == 0 ? logoBlack : logoBlack} alt="" />
|
||||
) : (
|
||||
<Image src={theme == 0 ? logoWhite : logoBlack} alt="" />
|
||||
)}
|
||||
</div>
|
||||
</Link>
|
||||
<div className="flex">
|
||||
<div className="flex">
|
||||
{profile?.length <= 0 ? (
|
||||
|
|
|
@ -4,7 +4,7 @@ import PersianNumber from "plugins/PersianNumber";
|
|||
import { useEffect, useState } from "react";
|
||||
|
||||
const TimerDown = () => {
|
||||
const targetTimestamp = 1707629566 * 1000; // Convert to milliseconds
|
||||
const targetTimestamp = 1710654443 * 1000; // Convert to milliseconds
|
||||
|
||||
const [timeRemaining, setTimeRemaining] = useState({
|
||||
days: 0,
|
||||
|
@ -46,46 +46,46 @@ const TimerDown = () => {
|
|||
}, []);
|
||||
|
||||
return (
|
||||
<div className="flex justify-center ltr border-[2px] border-white realtive mr-5 px-2 rounded-full ">
|
||||
<div className="">
|
||||
<p className="mb-0 = text-center text-white font-bold pt-1">
|
||||
<div className=" justify-center ltr realtive mr-5 px-2 xs:hidden lg:flex ">
|
||||
<div className=" rounded-full bg-red-100 w-[50px] h-[50px] mx-1">
|
||||
<p className="mb-0 = text-center text-red-900 font-bold pt-3 ">
|
||||
<PersianNumber
|
||||
number={timeRemaining.days}
|
||||
style={"text-[27px] text-white"}
|
||||
style={"text-[27px] text-red-900 "}
|
||||
/>
|
||||
<small className="text-[10px] px-2">:</small>
|
||||
</p>
|
||||
|
||||
<p className="text-[12px] pt-6 text-center ">روز</p>
|
||||
</div>
|
||||
|
||||
<div className="">
|
||||
<p className="mb-0 text-center text-white font-bold pt-1">
|
||||
<div className=" rounded-full bg-red-100 w-[50px] h-[50px] mx-1">
|
||||
<p className="mb-0 text-center text-red-900 font-bold pt-3 ">
|
||||
<PersianNumber
|
||||
number={timeRemaining.hours}
|
||||
style={"text-[27px] text-white"}
|
||||
style={"text-[27px] text-red-900 "}
|
||||
/>
|
||||
<small className="text-[10px] px-2">:</small>
|
||||
</p>
|
||||
<p className="text-[12px] pt-6 text-center ">ساعت</p>
|
||||
</div>
|
||||
|
||||
<div className=" ">
|
||||
<p className="mb-0 text-center text-white font-bold pt-1">
|
||||
<div className=" rounded-full bg-red-100 w-[50px] h-[50px] mx-1">
|
||||
<p className="mb-0 text-center text-red-900 font-bold pt-3 ">
|
||||
<PersianNumber
|
||||
number={timeRemaining.minutes}
|
||||
style={"text-[27px] text-white"}
|
||||
style={"text-[27px] text-red-900 "}
|
||||
/>
|
||||
<small className="text-[10px] px-2">:</small>
|
||||
</p>
|
||||
<p className="text-[12px] pt-6 text-center ">دقیقه</p>
|
||||
</div>
|
||||
|
||||
<div className="">
|
||||
<div className=" rounded-full bg-red-100 w-[50px] h-[50px] mx-1">
|
||||
<Link href="/login">
|
||||
{" "}
|
||||
<p className="mb-0 text-center text-white font-bold pt-1">
|
||||
<p className="mb-0 text-center text-red-900 font-bold pt-3 ">
|
||||
<PersianNumber
|
||||
number={timeRemaining.seconds}
|
||||
style={"text-[27px] text-white"}
|
||||
style={"text-[27px] text-red-900 "}
|
||||
/>
|
||||
</p>
|
||||
<p className="text-[12px] pt-6 text-center ">ثانیه</p>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
import Script from "next/script";
|
||||
|
||||
export default function Goftino() {
|
||||
const getGoftiono = () => {
|
||||
return {
|
||||
__html: ` !function(){var i="Gk1Yld",a=window,d=document;function g(){var g=d.createElement("script"),s="https://www.goftino.com/widget/"+i,l=localStorage.getItem("goftino_"+i);g.async=!0,g.src=l?s+"?o="+l:s;d.getElementsByTagName("head")[0].appendChild(g);}"complete"===d.readyState?g():a.attachEvent?a.attachEvent("onload",g):a.addEventListener("load",g,!1);}();
|
||||
`,
|
||||
};
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Script
|
||||
strategy="afterInteractive"
|
||||
dangerouslySetInnerHTML={getGoftiono()}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
|
@ -4,6 +4,7 @@ import AppContext from "@ctx/AppContext";
|
|||
import { iranCities } from "iranCities";
|
||||
import { iranProvince } from "iranProvince";
|
||||
import Chapar from "plugins/Chapar";
|
||||
import validateIranPhone from "plugins/IranPhoneRegex";
|
||||
import { useContext, useEffect, useRef, useState } from "react";
|
||||
import { BottomSheet } from "react-spring-bottom-sheet";
|
||||
import { toast } from "react-toastify";
|
||||
|
@ -51,33 +52,45 @@ const BottomSheetAddress = () => {
|
|||
};
|
||||
|
||||
const handleCreateAddress = async () => {
|
||||
if (validator.current.allValid()) {
|
||||
try {
|
||||
const data = await Chapar.post(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/user/address`,
|
||||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
if (validateIranPhone(receiverPhoneNumber)) {
|
||||
if (validator.current.allValid()) {
|
||||
try {
|
||||
const data = await Chapar.post(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/user/address`,
|
||||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
toast.success(`آدرس اضافه شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
toast.success(`آدرس اضافه شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
|
||||
CTX.setBottomSheetAddressOpen(false);
|
||||
CTX.fetchAddressUser();
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error?.response?.data?.message}`, {
|
||||
CTX.setBottomSheetAddressOpen(false);
|
||||
CTX.fetchAddressUser();
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error?.response?.data?.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
toast.error("پرکردن همه ی فیلد ها واجب است", {
|
||||
position: "bottom-right",
|
||||
autoClose: 2000,
|
||||
hideProgressBar: false,
|
||||
closeOnClick: true,
|
||||
pauseOnHover: true,
|
||||
draggable: true,
|
||||
progress: undefined,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
toast.error("پرکردن همه ی فیلد ها واجب است", {
|
||||
toast.error("شماره تماس را درست وارد کنید", {
|
||||
position: "bottom-right",
|
||||
autoClose: 2000,
|
||||
hideProgressBar: false,
|
||||
|
|
|
@ -12,6 +12,8 @@ const BottomSheetLogOut = ({ id }) => {
|
|||
|
||||
const handleLogOut = async () => {
|
||||
localStorage.removeItem("token");
|
||||
CTX.setProfile([]);
|
||||
CTX.setBottomSheetLogOutOpen(false);
|
||||
router.push("/");
|
||||
};
|
||||
|
||||
|
|
|
@ -94,6 +94,8 @@ const Page = () => {
|
|||
},
|
||||
}
|
||||
);
|
||||
|
||||
router.push(data?.paymentUrl);
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error?.response?.data?.message}`, {
|
||||
position: "bottom-right",
|
||||
|
@ -145,9 +147,9 @@ const Page = () => {
|
|||
|
||||
{addressData.map((e, index) => (
|
||||
<div
|
||||
className={`flex rtl px-3 py-2 border-2 border-transparent tr03 mx-2 mt-3 ${
|
||||
className={`flex rtl px-3 py-4 border-2 border-transparent tr03 mx-2 mt-3 cursor-pointer ${
|
||||
addressId == index
|
||||
? "border-2 border-green-600 rounded-lg bg-green-50"
|
||||
? "border-2 !border-green-600 rounded-lg bg-green-50"
|
||||
: ""
|
||||
}`}
|
||||
onClick={() => setAddressId(index)}
|
||||
|
@ -216,9 +218,9 @@ const Page = () => {
|
|||
<div>
|
||||
{shippingData?.map((e, index) => (
|
||||
<div
|
||||
className={`flex rtl px-2 py-1 mx-2 mt-5 border-2 border-transparent tr03 cursor-pointer ${
|
||||
className={`flex rtl px-2 py-2 mx-2 mt-5 border-2 border-transparent tr03 cursor-pointer ${
|
||||
shippingId == index
|
||||
? "border-2 border-green-600 rounded-lg bg-green-50"
|
||||
? "border-2 !border-green-600 rounded-lg bg-green-50"
|
||||
: ""
|
||||
}`}
|
||||
onClick={() => handleShippingID(index)}
|
||||
|
@ -276,8 +278,8 @@ const Page = () => {
|
|||
|
||||
<div>
|
||||
<div
|
||||
className={`flex rtl px-2 py-1 mx-2 border-2 border-transparent mt-5 ${
|
||||
true ? "border-2 border-green-600 rounded-lg bg-green-50" : ""
|
||||
className={`flex rtl px-2 py-2 mx-2 border-2 border-transparent mt-5 ${
|
||||
true ? "border-2 !border-green-600 rounded-lg bg-green-50" : ""
|
||||
}`}
|
||||
>
|
||||
<div>
|
||||
|
@ -302,9 +304,10 @@ const Page = () => {
|
|||
<p className="mb-0 text-[12px] text-gray-500">آسان پرداخت</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={`flex justify-between rtl px-3 mt-5 ${
|
||||
checkOutData?.discountCode != "" ? "opacity-30 blur-[1px]" : ""
|
||||
checkOutData?.discountCode != "" ? "" : ""
|
||||
}`}
|
||||
onClick={() => {
|
||||
if (checkOutData?.discountCode == "") {
|
||||
|
@ -342,14 +345,17 @@ const Page = () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div className="pl-3">
|
||||
<span className="text-[30px] opacity-60">+</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-right flex justify-end px-2 py-1 mx-2">
|
||||
<p className="text-green-600 mb-0 text-[12px] ">
|
||||
کد تخفیف ثبت شد{" "}
|
||||
</p>
|
||||
{checkOutData?.discountCode == "" ? (
|
||||
<div className="pl-3">
|
||||
<span className="text-[30px] opacity-60">+</span>
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-right flex justify-end px-2 py-1 mx-2">
|
||||
<p className="text-green-600 mb-0 text-[12px] ">
|
||||
کد تخفیف ثبت شد{" "}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ const Page = () => {
|
|||
|
||||
<div className="">
|
||||
<div className="text-right flex rtl justify-between border-y-[1px] border-gray-200 my-3 px-4 ">
|
||||
<p className="mb-0 text-sm font-semibold py-4">حساب نهایی</p>
|
||||
<p className="mb-0 text-sm font-medium py-4">حساب نهایی</p>
|
||||
|
||||
{/* <div className="bg-primary-200 w-fit h-fit relative my-3 p-1 rounded-lg">
|
||||
<p className="mb-0 text-[11px] text-white rtl">
|
||||
|
@ -123,7 +123,7 @@ const Page = () => {
|
|||
<p className="mb-0 ">
|
||||
<PersianNumber
|
||||
number={(calculateTotalCost / 10)?.toLocaleString()}
|
||||
style={"!text-[14px] !font-semibold"}
|
||||
style={"!text-[14px] !font-medium"}
|
||||
/>
|
||||
</p>
|
||||
<small className="text-gray-500 text-[12px] mt-1 mx-1">
|
||||
|
@ -136,7 +136,7 @@ const Page = () => {
|
|||
<div className="flex justify-between rtl my-2 px-4">
|
||||
<p className="mb-0 text-[12px] text-gray-500">تخفیف محصول</p>
|
||||
|
||||
<div className="flex justify-center">
|
||||
<div className="flex justify-center ">
|
||||
<p className="mb-0 ">
|
||||
<PersianNumber
|
||||
number={(
|
||||
|
@ -144,7 +144,7 @@ const Page = () => {
|
|||
calculateTotalCostWithDiscount) /
|
||||
10
|
||||
)?.toLocaleString()}
|
||||
style={"!text-[14px] !font-semibold"}
|
||||
style={"!text-[14px] !font-medium"}
|
||||
/>
|
||||
</p>
|
||||
<small className="text-gray-500 text-[12px] mt-1 mx-1">
|
||||
|
@ -186,7 +186,7 @@ const Page = () => {
|
|||
<NavBarDownCart
|
||||
calculateTotalCost={calculateTotalCostWithDiscount / 10}
|
||||
event={() => handleGoCheckOut()}
|
||||
permissionGoPay={true}
|
||||
permissionGoPay={!!cart.length > 0}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
|
|
@ -13,6 +13,15 @@ import "react-toastify/dist/ReactToastify.css";
|
|||
import "swiper/css";
|
||||
import "../../style/fontiran.css";
|
||||
import "../../style/globals.css";
|
||||
import Goftino from "plugins/Goftino/page";
|
||||
|
||||
export const metadata = {
|
||||
title: "Acme",
|
||||
openGraph: {
|
||||
title: "Acme",
|
||||
description: "Acme is a...",
|
||||
},
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }) {
|
||||
const [cart, setCart] = useState([]);
|
||||
|
@ -37,8 +46,6 @@ export default function RootLayout({ children }) {
|
|||
const [isMobile, setIsMobile] = useState(false);
|
||||
const [isOpenLightBox, setIsOpenLightBox] = useState(false);
|
||||
|
||||
console.log("products", products);
|
||||
|
||||
const AddItemToCart = (
|
||||
id,
|
||||
persianName,
|
||||
|
@ -337,6 +344,8 @@ export default function RootLayout({ children }) {
|
|||
<Loading />
|
||||
<BottomSheetAddress />
|
||||
<BottomSheetLogOut />
|
||||
|
||||
<Goftino />
|
||||
</body>
|
||||
</html>
|
||||
</AppContext.Provider>
|
||||
|
|
|
@ -9,6 +9,7 @@ import Chapar from "plugins/Chapar";
|
|||
import { useContext, useState } from "react";
|
||||
import { toast } from "react-toastify";
|
||||
import logo from "../../../public/images/logo.png";
|
||||
import Head from "next/head";
|
||||
|
||||
const Login = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
|
@ -51,19 +52,19 @@ const Login = () => {
|
|||
verifyCode,
|
||||
}
|
||||
);
|
||||
localStorage.setItem("token", "Bearer " + data.access_token);
|
||||
|
||||
console.log(data);
|
||||
|
||||
if (data.user.signUpStatus == 1) {
|
||||
setStepLogin(2);
|
||||
CTX.setProfile(data);
|
||||
} else if (data.user.signUpStatus == 10) {
|
||||
// setProfile(data);
|
||||
CTX.setProfile(data.user);
|
||||
toast.success(` ${data.user.firstName} جان خوش اومدی `, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
localStorage.setItem("token", "Bearer " + data.access_token);
|
||||
|
||||
router.push("/profile");
|
||||
}
|
||||
|
||||
|
@ -92,7 +93,7 @@ const Login = () => {
|
|||
);
|
||||
|
||||
CTX.setLoading(false);
|
||||
CTX.setProfile(data);
|
||||
CTX.setProfile(data.user);
|
||||
if (data.user.signUpStatus == 10) {
|
||||
// setProfile(data);
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import HeroSection from "@comp/LandingPage/HeroSection/page";
|
|||
import HomeSection from "@comp/LandingPage/HomeSection/page";
|
||||
import SurpriseSection from "@comp/LandingPage/SurpriseSection/page";
|
||||
import Navbar from "@comp/Navbar/page";
|
||||
import Head from "next/head";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export default function Page() {
|
||||
|
@ -44,6 +45,9 @@ export default function Page() {
|
|||
}, []);
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>My new cool app</title>
|
||||
</Head>
|
||||
<div className="bg-header">
|
||||
<Navbar theme={0} />
|
||||
<HeroSection />
|
||||
|
|
|
@ -76,7 +76,7 @@ const Page = ({ params }) => {
|
|||
</div>
|
||||
)}
|
||||
|
||||
{!product?.warranty?.trim() === "" && (
|
||||
{!product?.warranty == "" && (
|
||||
<div className="bg-secondary-500 rounded-full py-1 px-3 ml-2">
|
||||
<p className="mb-0 text-sm text-white ">
|
||||
{product?.warranty}
|
||||
|
|
|
@ -7,9 +7,11 @@ const Page = () => {
|
|||
const paymentStatus = params.get("paymentStatus");
|
||||
const factorNumber = params.get("factorNumber");
|
||||
|
||||
console.log(paymentStatus);
|
||||
|
||||
return (
|
||||
<>
|
||||
{paymentStatus ? (
|
||||
{!paymentStatus ? (
|
||||
<div className="bg-contact-us !min-h-[100vh]">
|
||||
<div className=" pb-20">
|
||||
<div className="pt-[190px] px-10">
|
||||
|
@ -63,7 +65,7 @@ const Page = () => {
|
|||
) : (
|
||||
<div className="bg-error !min-h-[100vh]">
|
||||
<div className=" pb-20">
|
||||
<div className="pt-[190px] px-10">
|
||||
<div className="pt-[50px] px-10">
|
||||
<div className="text-[200px] text-white mx-auto text-center">
|
||||
!
|
||||
</div>
|
||||
|
|
|
@ -217,3 +217,22 @@ body::-webkit-scrollbar-track {
|
|||
.scroll-1::-webkit-scrollbar-thumb:hover {
|
||||
background: #555;
|
||||
}
|
||||
|
||||
.dots {
|
||||
display: inline-block;
|
||||
width: 180px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* Hide scrollbar for Chrome, Safari and Opera */
|
||||
.hide-scrollBar::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Hide scrollbar for IE, Edge and Firefox */
|
||||
.hide-scrollBar {
|
||||
-ms-overflow-style: none; /* IE and Edge */
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
|
|
|
@ -85,4 +85,12 @@ module.exports = {
|
|||
},
|
||||
},
|
||||
plugins: [],
|
||||
corePlugins: {
|
||||
backdropOpacity: false,
|
||||
backgroundOpacity: false,
|
||||
borderOpacity: false,
|
||||
divideOpacity: false,
|
||||
ringOpacity: false,
|
||||
textOpacity: false,
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue