Skip to content

Commit

Permalink
Merge pull request #241 from lotteon2/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
CokeLee777 authored Jan 20, 2024
2 parents dbc75f8 + 50ac917 commit 199de3a
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 60 deletions.
7 changes: 6 additions & 1 deletion src/components/order/orderDetail/OrderDetailComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ const cancel = async (orderDetailNo: string) => {
return
}
}
const formatPrice = (price: number | null | undefined) => {
if (!price) return '0원'
return `${new Intl.NumberFormat('ko-KR').format(price)}원`
}
</script>
<template v-if="orderDetails.length">
<div v-for="(orderDetail, index) in orderDetails" :key="index" class="order-detail-container">
Expand All @@ -153,7 +158,7 @@ const cancel = async (orderDetailNo: string) => {
{{ orderDetail.productQuantity }}개
</div>
<div>쿠폰이름 : {{ orderDetail.couponName }}</div>
<div>쿠폰 적용 금액 : {{ orderDetail.couponDiscountPrice }}</div>
<div>쿠폰 적용 금액 : {{ formatPrice(orderDetail.couponDiscountPrice) }}</div>
</div>
</div>
<div class="left-inner-empty"></div>
Expand Down
116 changes: 58 additions & 58 deletions src/components/promotion/EventComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,70 +15,70 @@ const totalElements = ref<number>(0)
const histories = ref<ReadAuctionHistoryResponse[]>([])
const fetchData = async () => {
/*const response: ReadAuctionHistoryPageResponse = await getAuctionHistory(
const response: ReadAuctionHistoryPageResponse = await getAuctionHistory(
requestPage.value,
requestSize
)
totalPages.value = response.totalPages
totalElements.value = response.totalElements
histories.value = response.responses*/
histories.value = response.responses
// dummy data
totalElements.value = 3
totalPages.value = 1
histories.value = [
{
id: 'AH1',
memberId: '1',
auctionId: 'A1',
auctionName: 'A1',
auctionProductId: 101,
auctionProductImg: 'https://dummyimage.com/200',
auctionProductName: '상품A',
auctionProductSizeId: 1,
auctionProductSizeName: '소형',
winner: true,
paid: false,
amountToPay: 10000,
memberHighestBid: 12000,
auctionWinnerBid: 10000,
createdAt: '2024-02-01T00:00:00'
},
{
id: 'AH2',
memberId: '1',
auctionId: 'A2',
auctionName: 'A2',
auctionProductId: 102,
auctionProductImg: 'https://dummyimage.com/200',
auctionProductName: '상품B',
auctionProductSizeId: 2,
auctionProductSizeName: '중형',
winner: false,
paid: false,
amountToPay: 20000,
memberHighestBid: 22000,
auctionWinnerBid: 20000,
createdAt: '2024-02-01T00:00:00'
},
{
id: 'AH3',
memberId: '1',
auctionId: 'A3',
auctionName: 'A3',
auctionProductId: 103,
auctionProductImg: 'https://dummyimage.com/200',
auctionProductName: '상품C',
auctionProductSizeId: 3,
auctionProductSizeName: '대형',
winner: true,
paid: true,
amountToPay: 30000,
memberHighestBid: 33000,
auctionWinnerBid: 30000,
createdAt: '2024-02-01T00:00:00'
}
]
// totalElements.value = 3
// totalPages.value = 1
// histories.value = [
// {
// id: 'AH1',
// memberId: '1',
// auctionId: 'A1',
// auctionName: 'A1',
// auctionProductId: 101,
// auctionProductImg: 'https://dummyimage.com/200',
// auctionProductName: '상품A',
// auctionProductSizeId: 1,
// auctionProductSizeName: '소형',
// winner: true,
// paid: false,
// amountToPay: 10000,
// memberHighestBid: 12000,
// auctionWinnerBid: 10000,
// createdAt: '2024-02-01T00:00:00'
// },
// {
// id: 'AH2',
// memberId: '1',
// auctionId: 'A2',
// auctionName: 'A2',
// auctionProductId: 102,
// auctionProductImg: 'https://dummyimage.com/200',
// auctionProductName: '상품B',
// auctionProductSizeId: 2,
// auctionProductSizeName: '중형',
// winner: false,
// paid: false,
// amountToPay: 20000,
// memberHighestBid: 22000,
// auctionWinnerBid: 20000,
// createdAt: '2024-02-01T00:00:00'
// },
// {
// id: 'AH3',
// memberId: '1',
// auctionId: 'A3',
// auctionName: 'A3',
// auctionProductId: 103,
// auctionProductImg: 'https://dummyimage.com/200',
// auctionProductName: '상품C',
// auctionProductSizeId: 3,
// auctionProductSizeName: '대형',
// winner: true,
// paid: true,
// amountToPay: 30000,
// memberHighestBid: 33000,
// auctionWinnerBid: 30000,
// createdAt: '2024-02-01T00:00:00'
// }
// ]
}
const onChangePage = async (page: number) => {
Expand Down Expand Up @@ -158,4 +158,4 @@ onBeforeMount(fetchData)

<style scoped>
@import '@/assets/css/event.css';
</style>
</style>
5 changes: 4 additions & 1 deletion src/views/ChatView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useAuctionStore } from '@/stores/auction/AuctionStore'
import { useMemberStore } from '@/stores/member/MemberStore'
import { storeToRefs } from 'pinia'
import router from '@/router'
const VITE_AUCTION_WS_URL: string = import.meta.env.VITE_AUCTION_WS_URL
const VITE_STATIC_IMG_URL = ref<string>(import.meta.env.VITE_STATIC_IMG_URL)
const mebmerStore = useMemberStore()
Expand Down Expand Up @@ -73,6 +74,7 @@ const handleOk = async () => {
}
if (biddingInput.value > productDetail.value!.price) {
message.error('상품 가격보다 높게 입찰 할 수 없습니다.')
return
}
if (!auctionDetail.value?.started) {
message.error('아직 경매가 시작되지 않았습니다.')
Expand All @@ -87,7 +89,6 @@ const handleOk = async () => {
nickname: nickname.value ? nickname.value : '',
inputCheck: true
}
console.log(data)
const response = await createBid(data)
myBidPrice.value = response
Expand All @@ -106,6 +107,7 @@ onMounted(async () => {
return
}
auctionDetail.value = res.readAuctionDetailResponse.auctionResponse
console.log(auctionDetail.value)
productDetail.value = res.readAuctionDetailResponse.productDetailResponse
auctionStore.setToken(res.token)
currentBid.value = auctionDetail.value.startBidPrice
Expand Down Expand Up @@ -139,6 +141,7 @@ const connect = async () => {
messages.value.push(data.data)
break
case 'START':
auctionDetail.value!.started = true
console.log('경매가 시작되었습니다.')
break
case 'TIME_SYNC':
Expand Down

0 comments on commit 199de3a

Please sign in to comment.