fix
parent
86b9c070eb
commit
792d68ad07
|
@ -13,13 +13,10 @@ import { useContext, useEffect, useMemo, useState } from "react";
|
||||||
import InfiniteScroll from "react-infinite-scroll-component";
|
import InfiniteScroll from "react-infinite-scroll-component";
|
||||||
|
|
||||||
export default function CategoriesData({ params, products }) {
|
export default function CategoriesData({ params, products }) {
|
||||||
console.log(", filters,....params", products);
|
|
||||||
|
|
||||||
const CTX = useContext(AppContext);
|
const CTX = useContext(AppContext);
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("setStopProducts", CTX.state.stopProducts);
|
|
||||||
if (
|
if (
|
||||||
Number(searchParams.get("page")) === 0 ||
|
Number(searchParams.get("page")) === 0 ||
|
||||||
!Number(searchParams.get("page")) ||
|
!Number(searchParams.get("page")) ||
|
||||||
|
@ -73,15 +70,15 @@ export default function CategoriesData({ params, products }) {
|
||||||
[searchParams]
|
[searchParams]
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(
|
//
|
||||||
"filters",
|
// "filters",
|
||||||
filter,
|
// filter,
|
||||||
isChecked,
|
// isChecked,
|
||||||
selectedBrands,
|
// selectedBrands,
|
||||||
rangePrice,
|
// rangePrice,
|
||||||
isRangePrice,
|
// isRangePrice,
|
||||||
sortBy
|
// sortBy
|
||||||
);
|
// );
|
||||||
|
|
||||||
const fetchBarnds = async () => {
|
const fetchBarnds = async () => {
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
|
@ -99,7 +96,6 @@ export default function CategoriesData({ params, products }) {
|
||||||
const handleInfiniteNextFetchProducts = () => {
|
const handleInfiniteNextFetchProducts = () => {
|
||||||
// Increment the page number
|
// Increment the page number
|
||||||
const nextPage = pageGetProducts + 1;
|
const nextPage = pageGetProducts + 1;
|
||||||
console.log("runeed-handleInfiniteNextFetchProducts", nextPage);
|
|
||||||
|
|
||||||
const params = new URLSearchParams(searchParams.toString());
|
const params = new URLSearchParams(searchParams.toString());
|
||||||
params.set("page", nextPage);
|
params.set("page", nextPage);
|
||||||
|
@ -134,8 +130,6 @@ export default function CategoriesData({ params, products }) {
|
||||||
getData();
|
getData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
console.log(pager?.totalPage > 1, pager?.totalPage);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className=" pb-20">
|
<div className=" pb-20">
|
||||||
|
|
|
@ -30,8 +30,6 @@ const CheckoutData = () => {
|
||||||
shippingId: shippingData[shippingId]?.id,
|
shippingId: shippingData[shippingId]?.id,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(body);
|
|
||||||
|
|
||||||
const GetShippingData = async () => {
|
const GetShippingData = async () => {
|
||||||
try {
|
try {
|
||||||
const data = await Chapar.get(
|
const data = await Chapar.get(
|
||||||
|
@ -67,7 +65,6 @@ const CheckoutData = () => {
|
||||||
);
|
);
|
||||||
CTX.setCheckOutData(data);
|
CTX.setCheckOutData(data);
|
||||||
setPermissionGoPay(true);
|
setPermissionGoPay(true);
|
||||||
console.log(data);
|
|
||||||
} catch ({ error, status }) {
|
} catch ({ error, status }) {
|
||||||
toast.error(`${error?.response?.data?.message}`, {
|
toast.error(`${error?.response?.data?.message}`, {
|
||||||
position: "bottom-right",
|
position: "bottom-right",
|
||||||
|
@ -85,7 +82,6 @@ const CheckoutData = () => {
|
||||||
const handleGoPayment = async () => {
|
const handleGoPayment = async () => {
|
||||||
const token = localStorage.getItem("token").slice(7);
|
const token = localStorage.getItem("token").slice(7);
|
||||||
|
|
||||||
console.log(token);
|
|
||||||
try {
|
try {
|
||||||
const data = await Chapar.post(
|
const data = await Chapar.post(
|
||||||
`${process.env.NEXT_PUBLIC_API_URL}/order/bag/payment/${checkOutData?.id}?paymentMethod=1&access_token=${token}`
|
`${process.env.NEXT_PUBLIC_API_URL}/order/bag/payment/${checkOutData?.id}?paymentMethod=1&access_token=${token}`
|
||||||
|
|
|
@ -20,8 +20,6 @@ const ProductData = ({ params, data }) => {
|
||||||
setProduct(post.product);
|
setProduct(post.product);
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("product", product);
|
|
||||||
|
|
||||||
const displaySpecifications = (specs) => {
|
const displaySpecifications = (specs) => {
|
||||||
let data = [];
|
let data = [];
|
||||||
if (specs?.length > 3) {
|
if (specs?.length > 3) {
|
||||||
|
@ -38,7 +36,7 @@ const ProductData = ({ params, data }) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setSpecificationsHeader(data); // You can replace console.log with any method to display the content in your header
|
setSpecificationsHeader(data); // You can replace
|
||||||
};
|
};
|
||||||
|
|
||||||
const scrollToSection = (id) => {
|
const scrollToSection = (id) => {
|
||||||
|
|
|
@ -61,8 +61,6 @@ const RootData = ({ children }) => {
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
console.log("cart", cart);
|
|
||||||
|
|
||||||
const AddItemToCart = (
|
const AddItemToCart = (
|
||||||
id,
|
id,
|
||||||
persianName,
|
persianName,
|
||||||
|
@ -208,7 +206,7 @@ const RootData = ({ children }) => {
|
||||||
top: 0,
|
top: 0,
|
||||||
behavior: "smooth", // Optional: smooth scrolling behavior
|
behavior: "smooth", // Optional: smooth scrolling behavior
|
||||||
});
|
});
|
||||||
console.log();
|
|
||||||
setProducts(post.products);
|
setProducts(post.products);
|
||||||
|
|
||||||
setStopProducts(true); // Assuming this stops pagination
|
setStopProducts(true); // Assuming this stops pagination
|
||||||
|
@ -291,14 +289,11 @@ const RootData = ({ children }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchOrderBagCheck = async () => {
|
const fetchOrderBagCheck = async () => {
|
||||||
console.log(cart);
|
|
||||||
const productsToSend = cart.map((item) => ({
|
const productsToSend = cart.map((item) => ({
|
||||||
productId: item.id,
|
productId: item.id,
|
||||||
count: parseInt(item.count),
|
count: parseInt(item.count),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
console.log(productsToSend);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = await Chapar.post(
|
const data = await Chapar.post(
|
||||||
`${process.env.NEXT_PUBLIC_API_URL}/order/bag/check`,
|
`${process.env.NEXT_PUBLIC_API_URL}/order/bag/check`,
|
||||||
|
@ -387,13 +382,8 @@ const RootData = ({ children }) => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(
|
|
||||||
"---------s---------",
|
|
||||||
`${process.env.NEXT_PUBLIC_API_URL}/marketer/profile`
|
|
||||||
);
|
|
||||||
setCooperationSystemProfileData(data);
|
setCooperationSystemProfileData(data);
|
||||||
} catch ({ error, status }) {
|
} catch ({ error, status }) {
|
||||||
console.log(status);
|
|
||||||
toast.error(`${error?.response?.data?.message}`, {
|
toast.error(`${error?.response?.data?.message}`, {
|
||||||
position: "bottom-right",
|
position: "bottom-right",
|
||||||
closeOnClick: true,
|
closeOnClick: true,
|
||||||
|
@ -414,7 +404,6 @@ const RootData = ({ children }) => {
|
||||||
|
|
||||||
setCooperationSystemProfileContractData(data);
|
setCooperationSystemProfileContractData(data);
|
||||||
} catch ({ error, status }) {
|
} catch ({ error, status }) {
|
||||||
console.log(status);
|
|
||||||
toast.error(`${error?.response?.data?.message}`, {
|
toast.error(`${error?.response?.data?.message}`, {
|
||||||
position: "bottom-right",
|
position: "bottom-right",
|
||||||
closeOnClick: true,
|
closeOnClick: true,
|
||||||
|
@ -435,7 +424,6 @@ const RootData = ({ children }) => {
|
||||||
|
|
||||||
setSearchResultData(data);
|
setSearchResultData(data);
|
||||||
} catch ({ error, status }) {
|
} catch ({ error, status }) {
|
||||||
console.log(status);
|
|
||||||
toast.error(`${error?.response?.data?.message}`, {
|
toast.error(`${error?.response?.data?.message}`, {
|
||||||
position: "bottom-right",
|
position: "bottom-right",
|
||||||
closeOnClick: true,
|
closeOnClick: true,
|
||||||
|
|
|
@ -4,7 +4,6 @@ import PersianNumber from "plugins/PersianNumber";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const Cart = ({ mainImage, title, categoryName, slug, id, summery }) => {
|
const Cart = ({ mainImage, title, categoryName, slug, id, summery }) => {
|
||||||
console.log(process.env.NEXT_PUBLIC_STORAGE_URL + `/Images/Med/` + mainImage);
|
|
||||||
return (
|
return (
|
||||||
<Link href={`/blogs/${id}/${slug}`}>
|
<Link href={`/blogs/${id}/${slug}`}>
|
||||||
<div className="bg-gray-100 rounded-3xl p-2 ">
|
<div className="bg-gray-100 rounded-3xl p-2 ">
|
||||||
|
|
|
@ -5,7 +5,6 @@ import PersianNumber from "plugins/PersianNumber";
|
||||||
import { useContext, useEffect, useState } from "react";
|
import { useContext, useEffect, useState } from "react";
|
||||||
|
|
||||||
const PaginationBlogs = ({ totalPage }) => {
|
const PaginationBlogs = ({ totalPage }) => {
|
||||||
console.log("totalPage", totalPage);
|
|
||||||
const CTX = useContext(AppContext);
|
const CTX = useContext(AppContext);
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const pager = totalPage;
|
const pager = totalPage;
|
||||||
|
@ -15,7 +14,6 @@ const PaginationBlogs = ({ totalPage }) => {
|
||||||
Number(searchParams.get("page")) ? Number(searchParams.get("page")) : 0
|
Number(searchParams.get("page")) ? Number(searchParams.get("page")) : 0
|
||||||
);
|
);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("pagesssss", Number(searchParams.get("page")));
|
|
||||||
setCurrentPageIndex(
|
setCurrentPageIndex(
|
||||||
Number(searchParams.get("page")) ? Number(searchParams.get("page")) : 0
|
Number(searchParams.get("page")) ? Number(searchParams.get("page")) : 0
|
||||||
);
|
);
|
||||||
|
@ -85,7 +83,7 @@ const PaginationBlogs = ({ totalPage }) => {
|
||||||
|
|
||||||
const handlePageClick = (pageIndex) => {
|
const handlePageClick = (pageIndex) => {
|
||||||
setCurrentPageIndex(pageIndex);
|
setCurrentPageIndex(pageIndex);
|
||||||
// console.log("ss", i);
|
//
|
||||||
// CTX.fetchProducts(
|
// CTX.fetchProducts(
|
||||||
// pageIndex,
|
// pageIndex,
|
||||||
// props.id[0] != 0 ? props.id[0] : "",
|
// props.id[0] != 0 ? props.id[0] : "",
|
||||||
|
@ -98,7 +96,6 @@ const PaginationBlogs = ({ totalPage }) => {
|
||||||
// true //pagination say or not
|
// true //pagination say or not
|
||||||
// );
|
// );
|
||||||
const nextPage = pageIndex;
|
const nextPage = pageIndex;
|
||||||
console.log("runeed-handleInfiniteNextFetchProducts", nextPage);
|
|
||||||
|
|
||||||
const params = new URLSearchParams(searchParams.toString());
|
const params = new URLSearchParams(searchParams.toString());
|
||||||
params.set("page", nextPage);
|
params.set("page", nextPage);
|
||||||
|
|
|
@ -9,7 +9,6 @@ import Cart from "../BlogComponents/Cart";
|
||||||
import PaginationBlogs from "../BlogComponents/PaginationBlogs";
|
import PaginationBlogs from "../BlogComponents/PaginationBlogs";
|
||||||
|
|
||||||
const BlogsData = ({ dataCaetgories, data }) => {
|
const BlogsData = ({ dataCaetgories, data }) => {
|
||||||
console.log(data);
|
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -25,8 +24,6 @@ const BlogsData = ({ dataCaetgories, data }) => {
|
||||||
router.push(`${pathname}?${params}`);
|
router.push(`${pathname}?${params}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("dataCaetgories", dataCaetgories);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Navbar />
|
<Navbar />
|
||||||
|
|
|
@ -13,7 +13,7 @@ import hyphenateString from "plugins/HyphenateString/page";
|
||||||
const CardNormal = ({ data, priority }) => {
|
const CardNormal = ({ data, priority }) => {
|
||||||
const CTX = useContext(AppContext);
|
const CTX = useContext(AppContext);
|
||||||
const cart = CTX.state.cart;
|
const cart = CTX.state.cart;
|
||||||
console.log(data);
|
|
||||||
const hyphenatedName = hyphenateString(data.persianName);
|
const hyphenatedName = hyphenateString(data.persianName);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -22,7 +22,7 @@ const FilterCategory = ({
|
||||||
const brands = CTX.state.brands;
|
const brands = CTX.state.brands;
|
||||||
const pageGetProducts = CTX.state.pageGetProducts;
|
const pageGetProducts = CTX.state.pageGetProducts;
|
||||||
const isFirstRender = useRef(true);
|
const isFirstRender = useRef(true);
|
||||||
console.log("filter", filter);
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const handleCheckboxChange = () => {
|
const handleCheckboxChange = () => {
|
||||||
|
@ -39,10 +39,9 @@ const FilterCategory = ({
|
||||||
|
|
||||||
const handleRangeChange = (values) => {
|
const handleRangeChange = (values) => {
|
||||||
// CTX.setIsRangePrice(true);
|
// CTX.setIsRangePrice(true);
|
||||||
console.log(values);
|
|
||||||
console.log("filters,values", values);
|
|
||||||
// CTX.setRangePrice(values);
|
// CTX.setRangePrice(values);
|
||||||
// console.log("rangePrice", rangePrice);
|
//
|
||||||
|
|
||||||
const params = new URLSearchParams(searchParams.toString());
|
const params = new URLSearchParams(searchParams.toString());
|
||||||
params.set("minPrice", values[0]);
|
params.set("minPrice", values[0]);
|
||||||
|
@ -56,10 +55,10 @@ const FilterCategory = ({
|
||||||
let brandIds = params.get("brandIds")
|
let brandIds = params.get("brandIds")
|
||||||
? Array.from(params.get("brandIds").split(",") ?? [])
|
? Array.from(params.get("brandIds").split(",") ?? [])
|
||||||
: [];
|
: [];
|
||||||
// console.log("handleFilterBrand", id, brandIds, brandIds.includes(id));
|
//
|
||||||
if (brandIds.includes(id)) {
|
if (brandIds.includes(id)) {
|
||||||
brandIds = brandIds.filter((brandId) => brandId !== id);
|
brandIds = brandIds.filter((brandId) => brandId !== id);
|
||||||
console.log("handleFilterBrand", brandIds);
|
|
||||||
if (brandIds.length === 0) {
|
if (brandIds.length === 0) {
|
||||||
params.delete("brandIds");
|
params.delete("brandIds");
|
||||||
router.push(`${pathname}?${params}`);
|
router.push(`${pathname}?${params}`);
|
||||||
|
@ -70,7 +69,7 @@ const FilterCategory = ({
|
||||||
}
|
}
|
||||||
params.set("brandIds", brandIds.join(","));
|
params.set("brandIds", brandIds.join(","));
|
||||||
params.set("page", "0");
|
params.set("page", "0");
|
||||||
console.log("handleFilterBrand", id, brandIds);
|
|
||||||
router.push(`${pathname}?${params}`);
|
router.push(`${pathname}?${params}`);
|
||||||
// Check if the brand is already selected
|
// Check if the brand is already selected
|
||||||
// const isBrandSelected = selectedBrands.some((brand) => brand.id === id);
|
// const isBrandSelected = selectedBrands.some((brand) => brand.id === id);
|
||||||
|
|
|
@ -15,7 +15,7 @@ const ListProdocts = ({
|
||||||
}) => {
|
}) => {
|
||||||
const CTX = useContext(AppContext);
|
const CTX = useContext(AppContext);
|
||||||
const products = CTX.state.products;
|
const products = CTX.state.products;
|
||||||
console.log("products filters", products);
|
|
||||||
const pager = CTX.state.pager;
|
const pager = CTX.state.pager;
|
||||||
const stopProducts = CTX.state.stopProducts;
|
const stopProducts = CTX.state.stopProducts;
|
||||||
const pageGetProducts = CTX.state.pageGetProducts;
|
const pageGetProducts = CTX.state.pageGetProducts;
|
||||||
|
|
|
@ -31,7 +31,6 @@ const SearchSideBar = () => {
|
||||||
// Define a function to send the request
|
// Define a function to send the request
|
||||||
const sendRequest = async () => {
|
const sendRequest = async () => {
|
||||||
CTX.fetchSearchResult(searchValue);
|
CTX.fetchSearchResult(searchValue);
|
||||||
console.log("Sending request for:", searchValue);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set a timer to send the request after 2000 milliseconds of inactivity
|
// Set a timer to send the request after 2000 milliseconds of inactivity
|
||||||
|
|
|
@ -14,7 +14,6 @@ const PaginationCategoory = (props) => {
|
||||||
Number(searchParams.get("page")) ? Number(searchParams.get("page")) : 0
|
Number(searchParams.get("page")) ? Number(searchParams.get("page")) : 0
|
||||||
);
|
);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("pagesssss", Number(searchParams.get("page")));
|
|
||||||
setCurrentPageIndex(
|
setCurrentPageIndex(
|
||||||
Number(searchParams.get("page")) ? Number(searchParams.get("page")) : 0
|
Number(searchParams.get("page")) ? Number(searchParams.get("page")) : 0
|
||||||
);
|
);
|
||||||
|
@ -84,7 +83,7 @@ const PaginationCategoory = (props) => {
|
||||||
|
|
||||||
const handlePageClick = (pageIndex) => {
|
const handlePageClick = (pageIndex) => {
|
||||||
setCurrentPageIndex(pageIndex);
|
setCurrentPageIndex(pageIndex);
|
||||||
// console.log("ss", i);
|
//
|
||||||
// CTX.fetchProducts(
|
// CTX.fetchProducts(
|
||||||
// pageIndex,
|
// pageIndex,
|
||||||
// props.id[0] != 0 ? props.id[0] : "",
|
// props.id[0] != 0 ? props.id[0] : "",
|
||||||
|
@ -97,7 +96,6 @@ const PaginationCategoory = (props) => {
|
||||||
// true //pagination say or not
|
// true //pagination say or not
|
||||||
// );
|
// );
|
||||||
const nextPage = pageIndex;
|
const nextPage = pageIndex;
|
||||||
console.log("runeed-handleInfiniteNextFetchProducts", nextPage);
|
|
||||||
|
|
||||||
const params = new URLSearchParams(searchParams.toString());
|
const params = new URLSearchParams(searchParams.toString());
|
||||||
params.set("page", nextPage);
|
params.set("page", nextPage);
|
||||||
|
|
|
@ -33,7 +33,7 @@ const BeautySection = ({ data }) => {
|
||||||
<Swiper
|
<Swiper
|
||||||
spaceBetween={50}
|
spaceBetween={50}
|
||||||
slidesPerView={6.2}
|
slidesPerView={6.2}
|
||||||
onSlideChange={() => console.log("slide change")}
|
// onSlideChange={() => console.log("slide change")}
|
||||||
className="rtl relative mt-5"
|
className="rtl relative mt-5"
|
||||||
// dir="rtl"
|
// dir="rtl"
|
||||||
breakpoints={{
|
breakpoints={{
|
||||||
|
|
|
@ -33,8 +33,8 @@ const HomeSection = ({ data }) => {
|
||||||
<Swiper
|
<Swiper
|
||||||
spaceBetween={50}
|
spaceBetween={50}
|
||||||
slidesPerView={6.2}
|
slidesPerView={6.2}
|
||||||
onSlideChange={() => console.log("slide change")}
|
// onSlideChange={() => console.log("slide change")}
|
||||||
onSwiper={(swiper) => console.log(swiper)}
|
// onSwiper={(swiper) => console.log(swiper)}
|
||||||
className="rtl relative mt-4"
|
className="rtl relative mt-4"
|
||||||
breakpoints={{
|
breakpoints={{
|
||||||
320: {
|
320: {
|
||||||
|
|
|
@ -3,7 +3,6 @@ import TimerDown from "@comp/TimerDown/TimerDown";
|
||||||
import { Swiper, SwiperSlide } from "swiper/react";
|
import { Swiper, SwiperSlide } from "swiper/react";
|
||||||
|
|
||||||
const SurpriseSection = ({ data }) => {
|
const SurpriseSection = ({ data }) => {
|
||||||
console.log("sss injaaaha", data);
|
|
||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
className="mb-10 pb-10 xs:bg-red-500 lg:bg-transparent xs:mx-3 lg:mx-0 xs:px-5 lg:px-0 xs:rounded-3xl lg:rounded-[0px] mt-20"
|
className="mb-10 pb-10 xs:bg-red-500 lg:bg-transparent xs:mx-3 lg:mx-0 xs:px-5 lg:px-0 xs:rounded-3xl lg:rounded-[0px] mt-20"
|
||||||
|
@ -39,8 +38,8 @@ const SurpriseSection = ({ data }) => {
|
||||||
<Swiper
|
<Swiper
|
||||||
spaceBetween={50}
|
spaceBetween={50}
|
||||||
slidesPerView={6.2}
|
slidesPerView={6.2}
|
||||||
onSlideChange={() => console.log("slide change")}
|
// onSlideChange={() =>
|
||||||
onSwiper={(swiper) => console.log(swiper)}
|
// onSwiper={(swiper) =>
|
||||||
className="rtl relative mt-5"
|
className="rtl relative mt-5"
|
||||||
breakpoints={{
|
breakpoints={{
|
||||||
320: {
|
320: {
|
||||||
|
|
|
@ -18,10 +18,8 @@ const SideBarNavBarMobile = () => {
|
||||||
const searchResultCategoryData = CTX.state.searchResultData.categories;
|
const searchResultCategoryData = CTX.state.searchResultData.categories;
|
||||||
const searchResultProductData = CTX.state.searchResultData.products;
|
const searchResultProductData = CTX.state.searchResultData.products;
|
||||||
|
|
||||||
console.log(firstChild);
|
|
||||||
|
|
||||||
const closeNavbar = CTX.state.closeNavbar;
|
const closeNavbar = CTX.state.closeNavbar;
|
||||||
console.log("closeNavbar", closeNavbar);
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="sm:block lg:hidden ">
|
<div className="sm:block lg:hidden ">
|
||||||
|
|
|
@ -27,8 +27,6 @@ const Navbar = ({ theme }) => {
|
||||||
const searchResultCategoryData = CTX.state.searchResultData.categories;
|
const searchResultCategoryData = CTX.state.searchResultData.categories;
|
||||||
const searchResultProductData = CTX.state.searchResultData.products;
|
const searchResultProductData = CTX.state.searchResultData.products;
|
||||||
|
|
||||||
console.log("dataNav", dataNav);
|
|
||||||
|
|
||||||
const [navItemHover, setNavItemHover] = useState(null);
|
const [navItemHover, setNavItemHover] = useState(null);
|
||||||
const [isDesktop, setIsDesktop] = useState(null);
|
const [isDesktop, setIsDesktop] = useState(null);
|
||||||
const [closeNavbar, setClosNavbar] = useState(false);
|
const [closeNavbar, setClosNavbar] = useState(false);
|
||||||
|
@ -39,7 +37,6 @@ const Navbar = ({ theme }) => {
|
||||||
|
|
||||||
const handleItemNavber = (index) => {
|
const handleItemNavber = (index) => {
|
||||||
setNavItemHover(index);
|
setNavItemHover(index);
|
||||||
console.log("index", index);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRemoveSearch = () => {
|
const handleRemoveSearch = () => {
|
||||||
|
@ -82,7 +79,7 @@ const Navbar = ({ theme }) => {
|
||||||
// Define a function to send the request
|
// Define a function to send the request
|
||||||
const sendRequest = async () => {
|
const sendRequest = async () => {
|
||||||
CTX.fetchSearchResult(searchValue);
|
CTX.fetchSearchResult(searchValue);
|
||||||
console.log("Sending request for:", searchValue);
|
|
||||||
setSearchResultShow(true);
|
setSearchResultShow(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ const GalleryBox = ({ file }) => {
|
||||||
|
|
||||||
const isOpenLightBox = CTX.state.isOpenLightBox;
|
const isOpenLightBox = CTX.state.isOpenLightBox;
|
||||||
|
|
||||||
console.log("image", file);
|
|
||||||
return (
|
return (
|
||||||
<div className=" w-full rounded-3xl">
|
<div className=" w-full rounded-3xl">
|
||||||
<div className="flex justify-center xs:pb-[10px] ">
|
<div className="flex justify-center xs:pb-[10px] ">
|
||||||
|
@ -65,7 +64,7 @@ const GalleryBox = ({ file }) => {
|
||||||
file && file[0].fileLocation
|
file && file[0].fileLocation
|
||||||
}`}
|
}`}
|
||||||
onCloseRequest={() => CTX.setIsOpenLightBox(false)}
|
onCloseRequest={() => CTX.setIsOpenLightBox(false)}
|
||||||
onImageLoadError={(e) => console.log(e)}
|
// onImageLoadError={(e) =>
|
||||||
imageLoadErrorMessage={"باز نمیشه ؟!!!"}
|
imageLoadErrorMessage={"باز نمیشه ؟!!!"}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -11,7 +11,6 @@ const RangeSlider = ({ min, max, onChange, values }) => {
|
||||||
// left: 0,
|
// left: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("slider,values", values, min, max);
|
|
||||||
const trackStyle = [{ backgroundColor: "#2189A8", height: 8 }];
|
const trackStyle = [{ backgroundColor: "#2189A8", height: 8 }];
|
||||||
|
|
||||||
const railStyle = { backgroundColor: "#e6e6e6", height: 8 };
|
const railStyle = { backgroundColor: "#e6e6e6", height: 8 };
|
||||||
|
|
|
@ -12,7 +12,6 @@ import { toast } from "react-toastify";
|
||||||
import logo from "@img/logo.png";
|
import logo from "@img/logo.png";
|
||||||
|
|
||||||
const BottomSheetSeeOrder = ({ id }) => {
|
const BottomSheetSeeOrder = ({ id }) => {
|
||||||
console.log("id", id);
|
|
||||||
const CTX = useContext(AppContext);
|
const CTX = useContext(AppContext);
|
||||||
|
|
||||||
const [bag, setBag] = useState([]);
|
const [bag, setBag] = useState([]);
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
import BlogsData from "@comp/Blog/BlogsData/page";
|
import BlogsData from "@comp/Blog/BlogsData/page";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
async function getData(searchParams) {
|
async function getData(sParams) {
|
||||||
// console.log("page , check", params.page);
|
//
|
||||||
|
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
`${process.env.NEXT_PUBLIC_API_URL}/blog?` +
|
`${process.env.NEXT_PUBLIC_API_URL}/blog?` +
|
||||||
new URLSearchParams({ ...searchParams })
|
new URLSearchParams({ ...sParams })
|
||||||
// ?page=${params.page ?? 0}
|
// ?page=${params.page ?? 0}
|
||||||
// { cache: "no-cache" }
|
// { cache: "no-cache" }
|
||||||
);
|
);
|
||||||
const post = await res.json();
|
const post = await res.json();
|
||||||
// console.log("dddddddd ", post);
|
//
|
||||||
|
|
||||||
return post;
|
return post;
|
||||||
}
|
}
|
||||||
|
@ -21,14 +21,14 @@ async function getCaetgories() {
|
||||||
|
|
||||||
const post = await res.json();
|
const post = await res.json();
|
||||||
|
|
||||||
// console.log("aaaaaaaaaaaaaaaaaaaa", post);
|
//
|
||||||
return post;
|
return post;
|
||||||
}
|
}
|
||||||
|
|
||||||
const page = async ({ searchParams }) => {
|
const page = async ({ searchParams }) => {
|
||||||
const data = await getData(searchParams);
|
const data = await getData(searchParams);
|
||||||
const dataCaetgories = await getCaetgories();
|
const dataCaetgories = await getCaetgories();
|
||||||
// console.log("-------------------------------- ", dataCaetgories);
|
//
|
||||||
|
|
||||||
return <BlogsData data={data} dataCaetgories={dataCaetgories} />;
|
return <BlogsData data={data} dataCaetgories={dataCaetgories} />;
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,8 +48,6 @@ const fetchProducts = async (categoryId, searchParams) => {
|
||||||
...params,
|
...params,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const brandIds = brandIdsString?.split(",") ?? [];
|
const brandIds = brandIdsString?.split(",") ?? [];
|
||||||
const brandIdsQuery =
|
const brandIdsQuery =
|
||||||
brandIds?.length > 0 ? `&brandIds=${brandIds?.join("&brandIds=")}` : "";
|
brandIds?.length > 0 ? `&brandIds=${brandIds?.join("&brandIds=")}` : "";
|
||||||
|
@ -62,7 +60,7 @@ const fetchProducts = async (categoryId, searchParams) => {
|
||||||
);
|
);
|
||||||
if (!res.ok) return [];
|
if (!res.ok) return [];
|
||||||
const products = await res.json();
|
const products = await res.json();
|
||||||
console.log("ppppp", products);
|
|
||||||
return products;
|
return products;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return [];
|
return [];
|
||||||
|
@ -71,7 +69,7 @@ const fetchProducts = async (categoryId, searchParams) => {
|
||||||
|
|
||||||
const page = async ({ params, searchParams }) => {
|
const page = async ({ params, searchParams }) => {
|
||||||
const products = await fetchProducts(params?.["id"]?.[0], searchParams);
|
const products = await fetchProducts(params?.["id"]?.[0], searchParams);
|
||||||
console.log("filters,page", products);
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<CategoriesData params={params} products={products} />
|
<CategoriesData params={params} products={products} />
|
||||||
|
|
|
@ -60,8 +60,8 @@ export const metadata = {
|
||||||
|
|
||||||
export default function RootLayout({ children }) {
|
export default function RootLayout({ children }) {
|
||||||
// if (process.env.NEXT_PUBLIC_IS_DEV === "false") {
|
// if (process.env.NEXT_PUBLIC_IS_DEV === "false") {
|
||||||
// console.log(process.env.NEXT_PUBLIC_IS_DEV === "false" && "PROD");
|
//
|
||||||
// console.log = () => {};
|
//
|
||||||
// }
|
// }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -53,8 +53,6 @@ const Login = () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
localStorage.setItem("token", "Bearer " + data.access_token);
|
localStorage.setItem("token", "Bearer " + data.access_token);
|
||||||
|
|
||||||
if (data.user.signUpStatus == 1) {
|
if (data.user.signUpStatus == 1) {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { permanentRedirect } from "next/navigation";
|
import { permanentRedirect } from "next/navigation";
|
||||||
|
|
||||||
export default async function Page({ params: { slug } }) {
|
export default async function Page({ params: { slug } }) {
|
||||||
console.log("slug", slug);
|
|
||||||
// slug -> id
|
// slug -> id
|
||||||
permanentRedirect(`/products/${slug}`, "replace");
|
permanentRedirect(`/products/${slug}`, "replace");
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ export async function generateMetadata({ params }) {
|
||||||
data?.product?.files && data?.product?.files[0]?.fileLocation,
|
data?.product?.files && data?.product?.files[0]?.fileLocation,
|
||||||
process.env.STORAGE_URL
|
process.env.STORAGE_URL
|
||||||
);
|
);
|
||||||
console.log("dddddd", imageUrl);
|
|
||||||
const metadataUrl = new URL(
|
const metadataUrl = new URL(
|
||||||
`products/${params.id[0]}/${decodedName}`,
|
`products/${params.id[0]}/${decodedName}`,
|
||||||
process.env.NEXT_PUBLIC_APP_URL
|
process.env.NEXT_PUBLIC_APP_URL
|
||||||
|
|
|
@ -10,8 +10,6 @@ const Page = () => {
|
||||||
const CTX = useContext(AppContext);
|
const CTX = useContext(AppContext);
|
||||||
const addressData = CTX.state.addressData;
|
const addressData = CTX.state.addressData;
|
||||||
|
|
||||||
console.log(addressData);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (addressData.length <= 0) {
|
if (addressData.length <= 0) {
|
||||||
CTX.fetchAddressUser();
|
CTX.fetchAddressUser();
|
||||||
|
|
|
@ -17,8 +17,6 @@ const Page = () => {
|
||||||
const [bag, setBag] = useState([]);
|
const [bag, setBag] = useState([]);
|
||||||
|
|
||||||
const getStatusDescription = (status) => {
|
const getStatusDescription = (status) => {
|
||||||
console.log(status);
|
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0:
|
case 0:
|
||||||
return "سبد خرید";
|
return "سبد خرید";
|
||||||
|
|
|
@ -65,7 +65,6 @@ const Page = () => {
|
||||||
// Convert Persian date to timestamp
|
// Convert Persian date to timestamp
|
||||||
const timestamp = moment(persianDate, "jYYYY/jM/jD").unix();
|
const timestamp = moment(persianDate, "jYYYY/jM/jD").unix();
|
||||||
setBirthDate(timestamp);
|
setBirthDate(timestamp);
|
||||||
console.log(timestamp);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const sendInfoUserCooperationSystem = async () => {
|
const sendInfoUserCooperationSystem = async () => {
|
||||||
|
@ -110,7 +109,6 @@ const Page = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("profile.isMarketer", profile);
|
|
||||||
if (profile.isMarketer) {
|
if (profile.isMarketer) {
|
||||||
CTX.fetchCooperationSystemProfile();
|
CTX.fetchCooperationSystemProfile();
|
||||||
setStepsaleCooperationSystem(2);
|
setStepsaleCooperationSystem(2);
|
||||||
|
|
|
@ -8,8 +8,6 @@ const Page = () => {
|
||||||
const paymentStatus = params.get("paymentStatus");
|
const paymentStatus = params.get("paymentStatus");
|
||||||
const factorNumber = params.get("factorNumber");
|
const factorNumber = params.get("factorNumber");
|
||||||
|
|
||||||
console.log("paymentStatus", paymentStatus);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{paymentStatus === "true" ? (
|
{paymentStatus === "true" ? (
|
||||||
|
|
Loading…
Reference in New Issue