From 332cb5da143b966090ad64c020f00f0a84b38a89 Mon Sep 17 00:00:00 2001 From: Dao Duc Date: Tue, 3 Feb 2026 17:20:38 +0700 Subject: [PATCH] update 03/02 --- src/components/cart/Home/EmptyCart.jsx | 19 + src/components/cart/Home/index.tsx | 214 +---- src/components/cart/Send/index.tsx | 59 +- src/components/cart/form/index.tsx | 206 +++++ .../detail/buttons/ScrollToReviewButton.jsx | 27 + .../product/detail/comments/CommentList.tsx | 33 +- .../product/detail/comments/index.tsx | 47 +- src/components/product/detail/index.tsx | 752 +----------------- src/components/product/detail/offer/index.tsx | 4 +- .../product/detail/products/index.tsx | 79 ++ .../product/detail/reviews/ReviewList.tsx | 39 +- src/components/shared/ButtonShowMore.jsx | 19 + src/components/shared/CartItem.tsx | 75 ++ src/components/shared/CommentItem.tsx | 2 - src/data/cart/index.tsx | 501 ++++++++++++ src/data/productHistory/index.tsx | 4 + src/hooks/useShowMore.ts | 21 + src/services/cart.ts | 6 +- src/styles/pc_style.css | 8 +- 19 files changed, 1092 insertions(+), 1023 deletions(-) create mode 100644 src/components/cart/Home/EmptyCart.jsx create mode 100644 src/components/cart/form/index.tsx create mode 100644 src/components/product/detail/buttons/ScrollToReviewButton.jsx create mode 100644 src/components/product/detail/products/index.tsx create mode 100644 src/components/shared/ButtonShowMore.jsx create mode 100644 src/components/shared/CartItem.tsx create mode 100644 src/data/cart/index.tsx create mode 100644 src/data/productHistory/index.tsx create mode 100644 src/hooks/useShowMore.ts diff --git a/src/components/cart/Home/EmptyCart.jsx b/src/components/cart/Home/EmptyCart.jsx new file mode 100644 index 0000000..208446b --- /dev/null +++ b/src/components/cart/Home/EmptyCart.jsx @@ -0,0 +1,19 @@ +import Link from "next/link"; + +export default function EmptyCart() { + return ( +
+
+ +
+

+ Không có sản phẩm nào trong giỏ hàng của bạn ! +

+ + VỀ TRANG CHỦ + +
+ ) +} \ No newline at end of file diff --git a/src/components/cart/Home/index.tsx b/src/components/cart/Home/index.tsx index 54e6213..57d5830 100644 --- a/src/components/cart/Home/index.tsx +++ b/src/components/cart/Home/index.tsx @@ -1,210 +1,64 @@ +import { CartData } from "@/data/cart" +import EmptyCart from "./EmptyCart"; +import Form from "../form"; +import CartItem from "@/components/shared/CartItem" +import { formatPrice } from "@/lib/utils"; + export default function Home() { + console.log(CartData); + + const hasCart = CartData.data.length; + if (hasCart == 0 ) { + return + } + return (
-
-
- -
-

- {" "} - Không có sản phẩm nào trong giỏ hàng của bạn ! -

- - {" "} - VỀ TRANG CHỦ {" "} - -
-

- {" "} - Giỏ hàng của tôi{" "} -

+

Giỏ hàng của tôi

+
-

5 sản phẩm

- + > LÀM TRỐNG GIỎ HÀNG
+
-
- - {" "} - {" "} - -
-
- - HHPC ULTRA 7 265K | 32GB DDR5 | NVIDIA RTX 3060 12GB - -
-

- Chi tiết khuyến mại - -

-
-
-

- - ⭐ Tặng Balo Laptop Hoàng Hà PC - -

-
-
-

- - ⭐ Tặng Chuột không dây - -

-
-
-

- - ⭐ Tặng Bàn di chuột - -

-
-
-
-
-
-
-
-

- {" "} - 42.000.000 đ{" "} -

- - {" "} - 52.000.000 đ{" "} - -
-
-
+ { CartData.data.map((item:any) => + + )}
+

- {" "} - Thông tin đơn hàng{" "} + Thông tin đơn hàng

+

Tổng tiền

-

50.000.000 đ

+

+ {formatPrice(CartData.cart_summary.total_value)} đ +

+

Tổng thanh toán

+

- {" "} - 41.450.000 đ{" "} + {formatPrice(CartData.cart_summary.total_value)} đ

-
-

- {" "} - Thông tin nhận hàng{" "} -

-
- Để tiếp tục đặt hàng, quý khách xin vui lòng - - hoặc nhập thông tin bên dưới. Tư vấn viên sẽ liên hệ theo thông tin bạn - cung cấp để xác nhận, không mua không sao -
-
- - - - -

- {" "} - {" "} - Nhập Số nhà, Đường, Phường/xã, Quận, Tỉnh {" "} -

-