From e19f98d3aefe135250d90eb589eadfef0b162be2 Mon Sep 17 00:00:00 2001 From: CessnaJ Date: Sun, 7 Jan 2024 17:49:39 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[FIX]=20=EC=BF=A0=ED=8F=B0=20=ED=95=A0?= =?UTF-8?q?=EC=9D=B8=EA=B0=80=20=EC=A4=91=EB=B3=B5=EA=B3=84=EC=82=B0=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../promotion/coupon/checkout/CheckoutCouponModal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/promotion/coupon/checkout/CheckoutCouponModal.vue b/src/components/promotion/coupon/checkout/CheckoutCouponModal.vue index 07df376a..b0a70723 100644 --- a/src/components/promotion/coupon/checkout/CheckoutCouponModal.vue +++ b/src/components/promotion/coupon/checkout/CheckoutCouponModal.vue @@ -118,7 +118,7 @@ const applyCouponDatas = () => { let discount = 0 if (item.couponInfoId !== null && item.discountValue !== null) { - const totalPrice = item.orderPrice * item.quantity + const totalPrice = item.orderPrice if (item.discountType === 'PERCENTAGE') { discount = totalPrice * (item.discountValue / 100) From ec035c5cb614a7a6e078f003b0ef40ed53ecdf44 Mon Sep 17 00:00:00 2001 From: CessnaJ Date: Sun, 7 Jan 2024 17:58:00 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[FIX]=20=EC=BF=A0=ED=8F=B0=20=EB=AA=A8?= =?UTF-8?q?=EB=8B=AC=20=EC=9D=B4=EB=AF=B8=EC=A7=80url=EC=97=90=20VITE=5FST?= =?UTF-8?q?ATIC=5FIMG=5FURL=20prefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/promotion/coupon/checkout/OrderItem.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/promotion/coupon/checkout/OrderItem.vue b/src/components/promotion/coupon/checkout/OrderItem.vue index 76d27d3b..92bbcfca 100644 --- a/src/components/promotion/coupon/checkout/OrderItem.vue +++ b/src/components/promotion/coupon/checkout/OrderItem.vue @@ -3,7 +3,7 @@
- 상품이미지 + 상품이미지
{{ orderItem.productName }}
@@ -88,6 +88,8 @@ import type { import type { OrderItemDto } from '@/types/coupon' import type { ProductInfo } from '@/apis/product/ProductDto' +const VITE_STATIC_IMG_URL = ref(import.meta.env.VITE_STATIC_IMG_URL) + const emit = defineEmits<{ // (event: 'apply-coupon', orderItemIndex: number, couponInfoId: number | null): void ( From ca7869a356ebad74ec3c5c7c145fdd7099a29d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=84=EC=A2=85=EB=AF=BC?= Date: Sun, 7 Jan 2024 21:17:11 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[FIX]=20QA=20=EB=B0=98=EC=98=81=20-=20?= =?UTF-8?q?=EC=B0=9C/=EC=9E=A5=EB=B0=94=EA=B5=AC=EB=8B=88=20->=20=EC=83=81?= =?UTF-8?q?=ED=92=88=20=EC=83=81=EC=84=B8=20route=20-=20=EB=B9=84=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8=20=EC=8B=9C=20=EC=B0=9C/=EC=9E=A5=EB=B0=94?= =?UTF-8?q?=EA=B5=AC=EB=8B=88=20=EC=B6=94=EA=B0=80=20api=20block?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/cart.css | 10 ++++++++++ src/assets/css/wish.css | 10 ++++++++++ src/components/wishcart/CartComponent.vue | 9 +++++++-- src/components/wishcart/WishComponent.vue | 14 ++++++++++---- src/views/ProductDetailView.vue | 21 +++++++++++++++++---- src/views/ProductListView.vue | 13 +++++++++++-- 6 files changed, 65 insertions(+), 12 deletions(-) diff --git a/src/assets/css/cart.css b/src/assets/css/cart.css index e90f8e5e..f8ae622c 100644 --- a/src/assets/css/cart.css +++ b/src/assets/css/cart.css @@ -25,6 +25,14 @@ border-bottom: 1px solid #202027; } +.cart-table-data2 { + cursor: pointer; +} + +.cart-table-data2:hover { + background-color: rgba(0, 0, 0, 0.1); +} + .cart-table-data2 > td { color: var(--Grayscale7, #202027); font-family: TheJamsil; @@ -88,6 +96,8 @@ .basket-img { flex-shrink: 0; margin: 20px 0; + width: 100px; + height: 100px; } .basket-column { diff --git a/src/assets/css/wish.css b/src/assets/css/wish.css index 0e7302b5..a4f9b06e 100644 --- a/src/assets/css/wish.css +++ b/src/assets/css/wish.css @@ -55,6 +55,14 @@ padding-bottom: 10px; } +.wish-table-data2 { + cursor: pointer; +} + +.wish-table-data2:hover { + background-color: rgba(0, 0, 0, 0.1); +} + .wish-table-data2 > td { color: var(--Grayscale7, #202027); font-family: TheJamsil; @@ -67,6 +75,8 @@ .basket-img { flex-shrink: 0; margin: 20px 0; + width: 100px; + height: 100px; } .basket-column { diff --git a/src/components/wishcart/CartComponent.vue b/src/components/wishcart/CartComponent.vue index 40414f1a..910b7cbe 100644 --- a/src/components/wishcart/CartComponent.vue +++ b/src/components/wishcart/CartComponent.vue @@ -212,7 +212,12 @@ const routeOrderSheet = () => { 상품 가격 총금액 - +
{ + \ No newline at end of file diff --git a/src/components/wishcart/WishComponent.vue b/src/components/wishcart/WishComponent.vue index 91d836e2..c79e64ac 100644 --- a/src/components/wishcart/WishComponent.vue +++ b/src/components/wishcart/WishComponent.vue @@ -10,6 +10,7 @@ import type { GiftInfo } from '@/apis/order/orderDto' import PaginationComponent from '@/components/ootd/PaginationComponent.vue' import WhitePageComponent from '@/components/wishcart/WhitePageComponent.vue' import router from '@/router' + const productStore = useProductStore() const props = defineProps({ targetId: { @@ -137,7 +138,12 @@ watch(requestPage, async (afterPage: number, beforePage: number) => { 판매 가격 - + { {{ wishList.productPrice.toLocaleString() }}원 - + + @@ -173,4 +179,4 @@ watch(requestPage, async (afterPage: number, beforePage: number) => { + \ No newline at end of file diff --git a/src/views/ProductDetailView.vue b/src/views/ProductDetailView.vue index c67aef3b..14fd3745 100644 --- a/src/views/ProductDetailView.vue +++ b/src/views/ProductDetailView.vue @@ -4,19 +4,19 @@ import ProductDetailCouponModal from '@/components/promotion/coupon/productdetai import BreadCrumbComponent from '@/components/product/BreadCrumbComponent.vue' import { useRoute } from 'vue-router' import { getProductDetail } from '@/apis/product/ProductClient' -import type { ReadProductStockResponse } from '@/apis/product/ProductDto' -import type { ProductInfo } from '@/apis/product/ProductDto' +import type { ProductInfo, ReadProductStockResponse } from '@/apis/product/ProductDto' import DescribeImageComponent from '@/components/product/DescribeImageComponent.vue' import ReviewComponent from '@/components/product/ReviewComponent.vue' import { useProductStore } from '@/stores/product/ProductStore' import router from '@/router' -const productStore = useProductStore() import { upsertCart } from '@/apis/wishcart/CartClient' import type { ReadWishListFromProduct } from '@/apis/wishcart/WishListDto' import { readWishListFromProduct, toggleWishList } from '@/apis/wishcart/WishListClient' import type { AxiosResponse } from 'axios' import TOP4OOTDComponent from '@/components/ootd/TOP4OOTDComponent.vue' +const productStore = useProductStore() + const VITE_STATIC_IMG_URL = ref(import.meta.env.VITE_STATIC_IMG_URL) const route = useRoute() @@ -49,6 +49,13 @@ const executeToggle = () => { if (isWishBtnEnabled.value) { isWishBtnEnabled.value = false + + if (!localStorage.getItem('accessToken')) { + alert('로그인 후 이용해 주세요') + isWishBtnEnabled.value = true + return + } + toggleWishList({ productId: productId.value, productSizeId: selectedProductSize.value.productSizeId @@ -137,6 +144,12 @@ const addToCart = () => { if (isCartBtnEnabled.value === true) { isCartBtnEnabled.value = false + if (!localStorage.getItem('accessToken')) { + alert('로그인 후 이용해 주세요') + isCartBtnEnabled.value = true + return + } + if (selectedProductSize.value.productSizeId === 0) { alert('옵션을 지정해주세요') isCartBtnEnabled.value = true @@ -399,4 +412,4 @@ watch(selectedProductSize, () => { + \ No newline at end of file diff --git a/src/views/ProductListView.vue b/src/views/ProductListView.vue index 58c50d72..a82f3a63 100644 --- a/src/views/ProductListView.vue +++ b/src/views/ProductListView.vue @@ -77,7 +77,11 @@ watch(isScrollEnd, async (after, before) => { :to="`/products/${product.id}`" :key="product.id" > - productImg + productImg

{{ product.brandName }}

{{ product.name }}

@@ -156,4 +160,9 @@ watch(isScrollEnd, async (after, before) => { display: flex; align-items: center; } - + +.product-img { + width: 200px; + height: 200px; +} + \ No newline at end of file From 950cada248b94872746546042995cc7cdda367f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=84=EC=A2=85=EB=AF=BC?= Date: Mon, 8 Jan 2024 00:11:30 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[FEAT]=20=EA=B2=80=EC=83=89=20FE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/product/ProductClient.ts | 30 ++++- src/components/HeaderComponent.vue | 64 ++++++----- src/router/index.ts | 20 ++-- src/views/ProductSearchView.vue | 171 +++++++++++++++++++++++++++++ 4 files changed, 250 insertions(+), 35 deletions(-) create mode 100644 src/views/ProductSearchView.vue diff --git a/src/apis/product/ProductClient.ts b/src/apis/product/ProductClient.ts index f4e48a45..32e07e39 100644 --- a/src/apis/product/ProductClient.ts +++ b/src/apis/product/ProductClient.ts @@ -1,7 +1,7 @@ import type { AxiosResponse } from 'axios' import { AxiosError } from 'axios' import { defaultAxiosInstance } from '@/apis/utils' -import type { ReadProductDetailResponse } from './ProductDto' +import type { ReadProductDetailResponse, ReadProductSliceResponse } from './ProductDto' const PRODUCT_SERVICE_PREFIX: string = '/product-service' const PRODUCT_PREFIX: string = '/products' @@ -43,3 +43,31 @@ export const getProductDetail = async (productId: number): Promise => { + try { + const { data } = await defaultAxiosInstance.get( + `${PRODUCT_SERVICE_PREFIX}${PRODUCT_PREFIX}/search`, + { + params: { lastId: lastId, query: query } + } + ) + return data + } catch (error) { + if (error instanceof AxiosError) { + if (error.response) { + if (error.response.status >= 400) { + alert(error.response.data.message) + console.error(`Client Error=${error.response.data.message}`) + } else if (error.response.status < 500) { + alert('서버 내부 오류') + console.error('Internal Server Error') + } + } + } + throw error + } +} diff --git a/src/components/HeaderComponent.vue b/src/components/HeaderComponent.vue index c43594d0..bae8e425 100644 --- a/src/components/HeaderComponent.vue +++ b/src/components/HeaderComponent.vue @@ -1,11 +1,12 @@ + + + + \ No newline at end of file From 89491650eb9ca4c394f39c53916107fa719070f2 Mon Sep 17 00:00:00 2001 From: JunYong Sun Date: Mon, 8 Jan 2024 05:29:36 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[ADD]=20=EC=A3=BC=EB=AC=B8=20=EC=B7=A8?= =?UTF-8?q?=EC=86=8C=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/order/order.ts | 21 +++++++++++++ src/assets/css/order/order-detail.css | 14 +++++++++ .../order/OrderHistoryComponent.vue | 2 +- .../orderDetail/OrderDetailComponent.vue | 30 +++++++++++++++---- 4 files changed, 61 insertions(+), 6 deletions(-) diff --git a/src/apis/order/order.ts b/src/apis/order/order.ts index 6e4eb7ba..85e02475 100644 --- a/src/apis/order/order.ts +++ b/src/apis/order/order.ts @@ -124,6 +124,27 @@ export const getOrderDetails = async (orderNo: String): Promise { + try { + const response = await authAxiosInstance.delete( + `${ORDER_SERVICE_PREFIX_PATH}/orders/order-details/${orderDetailNo}` + ) + } catch (error) { + if (error instanceof AxiosError) { + if (error.response) { + if (error.response.status >= 400) { + alert(error.response.data.message) + console.error(`Client Error=${error.response.data.message}`) + } else if (error.response.status < 500) { + alert('서버 내부 오류') + console.error('Internal Server Error') + } + } + } + throw error + } +} + export const gifts = async (giftInfo: GiftInfo): Promise => { try { const { data } = await authAxiosInstance.post(`${ORDER_SERVICE_PREFIX_PATH}/gifts`, giftInfo) diff --git a/src/assets/css/order/order-detail.css b/src/assets/css/order/order-detail.css index dc69a9f3..019e2243 100644 --- a/src/assets/css/order/order-detail.css +++ b/src/assets/css/order/order-detail.css @@ -143,6 +143,20 @@ cursor: pointer; } +.gray-button, +.gray-cancel-button { + width: 100%; + height: 40px; + border: none; + border-radius: 2.5px; + font-size: 16px; + font-weight: 400; + line-height: normal; + color: #fff; + background-color: gray; + cursor: default; +} + /* ant */ .ant-rate { color: var(--Grayscale7, #000); diff --git a/src/components/order/OrderHistoryComponent.vue b/src/components/order/OrderHistoryComponent.vue index b9da7e5f..1c133d6c 100644 --- a/src/components/order/OrderHistoryComponent.vue +++ b/src/components/order/OrderHistoryComponent.vue @@ -77,7 +77,7 @@ watchEffect(() => { -import { ref, onBeforeMount } from 'vue' +import { ref, onBeforeMount, defineEmits } from 'vue' import { storeToRefs } from 'pinia' -import { getOrderDetails } from '@/apis/order/order' +import { getOrderDetails, cancelOrderDetail } from '@/apis/order/order' import { createReview } from '@/apis/review/review' import { uploadImageToS3 } from '@/apis/s3/S3Client' import { PlusOutlined } from '@ant-design/icons-vue' @@ -12,7 +12,7 @@ import type { ReviewCreateRequest } from '@/apis/review/reviewDto' import type { UploadProps, UploadChangeParam, UploadFile } from 'ant-design-vue' const { nickname, profileImgUrl } = storeToRefs(useMemberStore()) const orderDetails = ref>([]) - +const emits = defineEmits(['closeModal']) const VITE_STATIC_IMG_URL = ref(import.meta.env.VITE_STATIC_IMG_URL) const props = defineProps({ orderNo: { @@ -124,6 +124,15 @@ const beforeUpload = (file: UploadFile) => { } return false } + +const cancel = async (orderDetailNo: string) => { + if (confirm('정말로 취소하시겠습니까?')) { + await cancelOrderDetail(orderDetailNo) + alert('취소 요청이 접수되었습니다.') + emits('closeModal') + return + } +}