Đánh giá chi tiết màn hình Viewsonic VA2432A-H 24\" IPS 120Hz viền mỏng
\n
Với tần số quét 120Hz và tấm nền IPS, màn hình Viewsonic VA2432A-H 24\" là một lựa chọn tuyệt vời cho cả game thủ và những người làm việc đồ họa. Chiếc màn hình này hứa hẹn sẽ đem lại cho bạn những hình ảnh sinh động và mượt mà, hỗ trợ nâng cao năng suất hoạt động.
\n
Hình ảnh sắc nét với tần số quét 120Hz, tốc độ phản hồi 1ms
\n
Tần số quét 120Hz của màn hình ViewSonic VA2432A-H giúp hình ảnh chuyển động mượt mà hơn gấp đôi so với màn hình máy tính 60Hz thông thường. Bạn sẽ không còn bỏ lỡ bất kỳ chi tiết nào trong những pha hành động nhanh của game FPS. Song song đó với thời gian phản hồi 1ms (MPRT) siêu nhanh giúp loại bỏ hiện tượng bóng mờ, mang đến trải nghiệm chơi game mượt mà và không bị giật lag.
\n
\n
Ngoại hình hiện đại, tinh tế với ba cạnh không viền
\n
Màn hình Viewsonic VA2432A-H có thiết kế hiện đại và tối giản với viền màn hình siêu mỏng, tạo cảm giác màn hình tràn viền, giúp bạn tập trung vào nội dung hiển thị mà không bị phân tán bởi các chi tiết thừa. Phần chân đế thường được làm từ chất liệu nhựa cao cấp mang lại cảm giác chắc chắn và bền bỉ.
\n
\n
\n
",
"isActive": true
}
],
@@ -182,7 +73,13 @@
"id": "a",
"userId": "1",
"productId": "aaa",
- "quantity": 10
+ "quantity": 11
+ },
+ {
+ "id": "c06c",
+ "productId": "d317",
+ "userId": "1",
+ "quantity": 1
}
]
}
\ No newline at end of file
diff --git a/src/RouterSetup.tsx b/src/RouterSetup.tsx
index 7363b88..cb9be1e 100644
--- a/src/RouterSetup.tsx
+++ b/src/RouterSetup.tsx
@@ -9,11 +9,17 @@ import CategoryManagement from './pages/admin/Category/CategoryManagement'
import ProductManagement from './pages/admin/Product/ProductManagement'
import CreateProductForm from './pages/admin/Product/components/CreateProductForm'
import Cart from './pages/home/cart/Cart'
+import HomeContent from './pages/home/HomeContent'
+import Collection from './pages/home/collections/Collection'
+import ProductDetail from './pages/home/product/ProductDetail'
export default function RouterSetup() {
return }>
- }>
+ }>
+ }>
+ }>
+ }>
}>
{
let result = await axios.get(`${import.meta.env.VITE_SV_HOST}/carts?userId=${userId}`)
return result.data
+ },
+ addToCart: async (data: AddToCartDTO) => {
+ let resultExisted = await axios.get(`${import.meta.env.VITE_SV_HOST}/carts?productId=${data.productId}`)
+ console.log("resultExisted", resultExisted.data)
+ if (!resultExisted.data[0]) {
+ /* thêm mới */
+ await axios.post(`${import.meta.env.VITE_SV_HOST}/carts`, {
+ ...data,
+ quantity: 1
+ })
+
+ return
+ }
+
+ /* cập nhật */
+ let resultUpdate = await axios.patch(`${import.meta.env.VITE_SV_HOST}/carts/${resultExisted.data[0].id}`, {
+ quantity: resultExisted.data[0].quantity + 1
+ })
+
+ console.log("resultUpdate", resultUpdate.data)
}
}
\ No newline at end of file
diff --git a/src/apis/core/product.api.ts b/src/apis/core/product.api.ts
index 254f2fa..0b52e74 100644
--- a/src/apis/core/product.api.ts
+++ b/src/apis/core/product.api.ts
@@ -19,5 +19,13 @@ export const ProductApi = {
isActive: true
})
return result.data
- }
+ },
+ findListWithCategoryId: async (categoryId: string) => {
+ let result = await axios.get(`${import.meta.env.VITE_SV_HOST}/products?categoryId=${categoryId}`)
+ return result.data
+ },
+ findProductById: async (productId: string) => {
+ let result = await axios.get(`${import.meta.env.VITE_SV_HOST}/products/` + productId)
+ return result.data
+ },
}
\ No newline at end of file
diff --git a/src/pages/home/HomeContent.tsx b/src/pages/home/HomeContent.tsx
new file mode 100644
index 0000000..e196bee
--- /dev/null
+++ b/src/pages/home/HomeContent.tsx
@@ -0,0 +1,31 @@
+import React, { useEffect, useState } from 'react'
+import type { Category } from '../../types/category.type'
+import { Apis } from '../../apis'
+import { Link } from 'react-router'
+
+export default function HomeContent() {
+ const [categories, setCategories] = useState([])
+
+ useEffect(() => {
+ Apis.category.getAll()
+ .then(res => {
+ setCategories(res)
+ })
+ }, [])
+ return (
+