Skip to content

Commit

Permalink
Merge pull request #243 from lotteon2/develop
Browse files Browse the repository at this point in the history
[FIX] 주문서 할인금액, 할인적용금액 소수점 내림처리
  • Loading branch information
CessnaJ authored Jan 20, 2024
2 parents b6630dd + 0170c8b commit 97aee3b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 28 deletions.
45 changes: 24 additions & 21 deletions src/components/order/OrderSheetComponent.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang='ts'>
<script setup lang="ts">
import { ref } from 'vue'
import { storeToRefs } from 'pinia'
import { useProductStore } from '@/stores/product/ProductStore'
Expand All @@ -9,44 +9,47 @@ const productStore = useProductStore()
const { products, orderType, giftInfo } = storeToRefs(productStore)
</script>
<template>
<div class='purchase-list-container' v-if='products.length'>
<div class='container-title'>주문상품 정보</div>
<div class='line'></div>
<div class='shop-wrapper' v-for='(product, index) in products' :key='index'>
<div class='shop-name-div'>
<div class="purchase-list-container" v-if="products.length">
<div class="container-title">주문상품 정보</div>
<div class="line"></div>
<div class="shop-wrapper" v-for="(product, index) in products" :key="index">
<div class="shop-name-div">
<span v-if="orderType === 'GIFT'">받는 사람 : {{ giftInfo.receiverName }}</span>
<span></span>
</div>
<div class='shop-prod-div'>
<div class='shop-prod-inner-div'>
<div class="shop-prod-div">
<div class="shop-prod-inner-div">
<h1>{{ product.productName }}</h1>
<div class='shop-prod-inner-info'>
<img class='info-img' :src='`${VITE_STATIC_IMG_URL}${product.imgUrl}`' alt='' />
<div class='info-first-col'>
<div class='info-first-col-first-row'>
<div class='button1'>옵션</div>
<div class="shop-prod-inner-info">
<img class="info-img" :src="`${VITE_STATIC_IMG_URL}${product.imgUrl}`" alt="" />
<div class="info-first-col">
<div class="info-first-col-first-row">
<div class="button1">옵션</div>
{{ product.sizeName }}
</div>
<div class='info-first-col-first-row'>
<div class='button1'>수량</div>
<div class="info-first-col-first-row">
<div class="button1">수량</div>
{{ product.quantity }}
</div>
</div>
<div class='info-second-col'>
<div class="info-second-col">
<span>상품금액</span>
<span>할인금액</span>
<span>할인적용금액</span>
</div>
<div class='info-third-col'>
<div class="info-third-col">
<span>{{ product.orderPrice.toLocaleString() }} 원</span>
<span
><div class='highlight1'>
{{ product.discountAmount.toLocaleString() }} 원
><div class="highlight1">
{{ Math.floor(product.discountAmount).toLocaleString() }} 원
</div></span
>
<span>
<div class='highlight2'>
{{ (product.orderPrice - product.discountAmount).toLocaleString() }} 원
<div class="highlight2">
{{
(product.orderPrice - Math.floor(product.discountAmount)).toLocaleString()
}}
</div></span
>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,20 @@ const handleDownloadMultipleCoupons = async () => {
const downloadResponse: MultipleCouponDownloadResponse =
await downloadMultipleCoupons(downloadableCouponInfoIds)
await successModal(
'알림',
downloadResponse.successfulIds.length + '개의 쿠폰을 다운로드 했습니다.'
)
console.log('다운로드된 couponInfoId 목록:', downloadResponse.successfulIds)
console.log('다운로드 실패한 couponInfoId 목록:', downloadResponse.failedIds)
// 다운로드 된 쿠폰들 상태변경
coupons.value = coupons.value.map((coupon) => {
if (downloadResponse.successfulIds.includes(coupon.couponInfoId)) {
return { ...coupon, isDownloadable: false } // 상태 업데이트
}
return coupon
})
console.log('다운로드된 couponInfoId 목록:', downloadResponse.successfulIds)
console.log('다운로드 실패한 couponInfoId 목록:', downloadResponse.failedIds)
await successModal(
'알림',
downloadResponse.successfulIds.length + '개의 쿠폰을 다운로드 했습니다.'
)
} catch (error) {
console.error('모든 쿠폰 다운로드 중 에러 발생:', error)
}
Expand Down

0 comments on commit 97aee3b

Please sign in to comment.