Skip to content

Commit

Permalink
Bookingstep4 보여지는 결과 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
KangYeonbae committed Dec 5, 2024
1 parent 33cdcdd commit becdb41
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
27 changes: 16 additions & 11 deletions src/components/steps/BookingStep4.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,35 @@ export const BookingStep4 = ({ bookingData, bookingInfo, price }) => {
});
};

const { spaceInfo, reservationInfo } = bookingData || {};

return (
<div className="booking_step">
<h2 className="booking_step4-text">예약 확인</h2>
<div className="booking_step4-round">
<div>
<h3 className="booking_step4-booking-info">예약정보</h3>
<p>공간: {bookingInfo.title}</p>
<p>날짜: {bookingData.date}</p>
<p>시간: {formatTime(bookingData.start_time)} ~ {formatTime(bookingData.end_time)}</p>
<p>인원: {bookingData.numberOfPeople}</p>
{bookingData.requirements && (
<p>요청사항: {bookingData.requirements}</p>
<p>공간: {spaceInfo?.title}</p>
{reservationInfo?.date ? (
<p>날짜: {reservationInfo.date}</p>
) : (
<p>시간: {formatTime(reservationInfo?.start_time)} ~ {formatTime(reservationInfo?.end_time)}</p>
)}
<p>인원: {reservationInfo?.numberOfPeople}</p>
{reservationInfo?.requirements && (
<p>요청사항: {reservationInfo.requirements}</p>
)}
</div>
<div>
<h3 className="booking_step4-booking-people">예약자 정보</h3>
<p>이름: {bookingData.name}</p>
<p>연락처: {bookingData.phone}</p>
<p>이메일: {bookingData.email}</p>
<p>이름: {bookingData?.name}</p>
<p>연락처: {bookingData?.phone}</p>
<p>이메일: {bookingData?.email}</p>
</div>
<div>
<h3 className="booking_step4-booking-payment">결제 정보</h3>
<p>결제 금액: {price.toLocaleString()}</p>
<p>결제 수단: {PAYMENT_METHODS[bookingData.paymentMethod]}</p>
<p>결제 금액: {price?.toLocaleString()}</p>
<p>결제 수단: {PAYMENT_METHODS[reservationInfo?.paymentMethod]}</p>
</div>
</div>
</div>
Expand Down
20 changes: 19 additions & 1 deletion src/pages/booking.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,25 @@ export default function BookingForm() {
sessionStorage.setItem('currentBookingData', JSON.stringify({
bookingData,
bookingInfo,
totalPrice
totalPrice,
spaceInfo: {
id: bookingInfo.spaceId,
title: bookingInfo.title,
usageUnit: usageUnit,
price: bookingInfo.price
},
reservationInfo: {
...(usageUnit === 'DAY'
? { date: bookingData.date }
: {
start_time: bookingData.start_time,
end_time: bookingData.end_time
}
),
numberOfPeople: bookingData.numberOfPeople,
requirements: bookingData.requirements,
paymentMethod: bookingData.paymentMethod
}
}));
window.location.href = response.next_redirect_pc_url;
}
Expand Down

0 comments on commit becdb41

Please sign in to comment.