From 641ac015828e7d86ee3784ceeafb0473f17bfbe4 Mon Sep 17 00:00:00 2001 From: Dao Duc Date: Mon, 2 Mar 2026 11:57:37 +0700 Subject: [PATCH] last day --- src/components/account/ChangeInfo.tsx | 115 ++++++++++++++++++++++ src/components/account/ChangePassword.tsx | 40 ++++++++ src/components/account/Comment.tsx | 23 +++++ src/components/account/Order.tsx | 40 ++++++++ src/components/account/OrderDetail.tsx | 0 src/components/account/Review.tsx | 23 +++++ src/components/account/index.tsx | 55 ++++++++--- src/components/customer/Login.tsx | 5 + 8 files changed, 290 insertions(+), 11 deletions(-) create mode 100644 src/components/account/ChangeInfo.tsx create mode 100644 src/components/account/ChangePassword.tsx create mode 100644 src/components/account/Comment.tsx create mode 100644 src/components/account/Order.tsx create mode 100644 src/components/account/OrderDetail.tsx create mode 100644 src/components/account/Review.tsx diff --git a/src/components/account/ChangeInfo.tsx b/src/components/account/ChangeInfo.tsx new file mode 100644 index 0000000..b42f4d8 --- /dev/null +++ b/src/components/account/ChangeInfo.tsx @@ -0,0 +1,115 @@ +export default function ChangeInfo({ customer }: any) { + return ( +
+

Thông tin tài khoản

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Họ tên + +
Giới tính + + +
Địa chỉ email + + + +
Địa chỉ nhà + +
Tỉnh / TP + +
Điện thoại di động + +
+ + +
+ +
+ +
+ ); +} \ No newline at end of file diff --git a/src/components/account/ChangePassword.tsx b/src/components/account/ChangePassword.tsx new file mode 100644 index 0000000..7877501 --- /dev/null +++ b/src/components/account/ChangePassword.tsx @@ -0,0 +1,40 @@ +export default function ChangePassword() { + return ( + <> +

Thay đổi mật khẩu

+ +
+ + + + + + + + + + + + + + + + + + +
Mật khẩu hiện tại + +
Mật khẩu mới + +
Nhập lại mật khẩu + +
+ + +
+ +
+ + + ); +} \ No newline at end of file diff --git a/src/components/account/Comment.tsx b/src/components/account/Comment.tsx new file mode 100644 index 0000000..e44dd26 --- /dev/null +++ b/src/components/account/Comment.tsx @@ -0,0 +1,23 @@ +export default function Comment({ customer } : any) { + return ( + <> +

Bình luận sản phẩm

+ +
+
+
+ HuraSoft - Sản phẩm test (Không xóa) + +

+ + Chưa duyệt + Đã duyệt +

+
account test comment
+
+
+
+
+ + ); +} \ No newline at end of file diff --git a/src/components/account/Order.tsx b/src/components/account/Order.tsx new file mode 100644 index 0000000..23e607b --- /dev/null +++ b/src/components/account/Order.tsx @@ -0,0 +1,40 @@ +export default function Order() { + return ( + <> +

Danh sách đơn hàng

+
+ + + + + + + + + + + + + + + + + + + + + + +
STTSố đơn hàngGiá trịThời gianThông tin
1 + #12236 + Xem chi tiết + + 1.990.000 + 22-10-2025 + Đang xử lý +
+
+ + + ); +} \ No newline at end of file diff --git a/src/components/account/OrderDetail.tsx b/src/components/account/OrderDetail.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/components/account/Review.tsx b/src/components/account/Review.tsx new file mode 100644 index 0000000..ffaff74 --- /dev/null +++ b/src/components/account/Review.tsx @@ -0,0 +1,23 @@ +export default function Review() { + return ( + <> +

Đánh giá sản phẩm

+
+
+
+ HuraSoft - Sản phẩm test (Không xóa) + +

+ + Chưa duyệt + Đã duyệt +

+
account test comment
+
+
+
+
+ + + ); +} \ No newline at end of file diff --git a/src/components/account/index.tsx b/src/components/account/index.tsx index dd97bbf..f427abe 100644 --- a/src/components/account/index.tsx +++ b/src/components/account/index.tsx @@ -1,50 +1,81 @@ 'use client'; import Link from "next/link"; import { CustomerInfo } from "@/data/customers" +import { useSearchParams } from 'next/navigation'; +import ChangeInfo from "./ChangeInfo"; +import Order from "./Order"; +import ChangePass from "./ChangePassword"; +import Review from "./Review"; +import Comment from "./Comment"; + export default function AccountPage() { + const searchParams = useSearchParams(); + const view = searchParams.get('view'); + const customer = CustomerInfo[0]; + + const viewComponent: any = { + "change-info": ChangeInfo, + "order": Order, + "product-review": Review, + "product-comment": Comment, + "change-pass": ChangePass, + }; + const ActiveComponent = viewComponent[view || "change-info"]; + + console.log(customer) return (
-

- Tài khoản của, - {CustomerInfo[0]?.name} +

+ Tài khoản của, + {customer.name}

- + Thông tin tài khoản - + Danh sách đơn hàng - + Đánh giá của tôi - + Bình luận của tôi - + Thay đổi mật khẩu - + Sản phẩm đã xem - + @@ -54,7 +85,9 @@ export default function AccountPage() {
-

Bạn đang ở trang tài khoản. Vui lòng chọn các mục bên trái để xem thông tin.

+ {ActiveComponent && + }
diff --git a/src/components/customer/Login.tsx b/src/components/customer/Login.tsx index 954a1c6..6996d47 100644 --- a/src/components/customer/Login.tsx +++ b/src/components/customer/Login.tsx @@ -38,6 +38,11 @@ export default function LoginPage() { ĐĂNG NHẬP
+

+ Test: + admin@mail.com / 123456 +

+

Email*