Skip to content

Commit

Permalink
Merge pull request #178 from hhbb0081/test
Browse files Browse the repository at this point in the history
Feat: 수령방식 추가
  • Loading branch information
hhbb0081 authored Dec 8, 2023
2 parents 5d55833 + ca84a7f commit 78ae4cd
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 24 deletions.
18 changes: 12 additions & 6 deletions src/components/views/PageComponent/OrderStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,18 @@ function OrderStatus() {
<span className="status-history">{statusList?.orderName}</span>
</div>
</div>
<div className="status-content-wrapper">
<span className="status-content-subtitle">수령방식</span>
<div className="status-content">
<span className="status-history">{statusList?.inout ? "매장" : "픽업"}</span>
</div>
</div>
{degree === 4 && (
<div className="status-content-wrapper">
<span className="status-content-subtitle">취소사유</span>
<span className="status-content">{statusList?.cancels?.split(",")[1]?.split("=")[1]}</span>
</div>
)}
<div className="status-detail__wrapper">
<div className="status-detail">
<Link
Expand All @@ -195,12 +207,6 @@ function OrderStatus() {
</Link>
</div>
</div>
{degree === 4 && (
<div className="status-content-wrapper">
<span className="status-content-subtitle">취소사유</span>
<span className="status-content">매장 사정</span>
</div>
)}
</div>
)}
{degree === 0 && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/PageComponent/OrderStorage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function OrderStorage() {

axios.get(`${apiUrl}/api/v1/order/history/old`, config)
.then((res) => {
setOldStorageList(res.data.receipts);
setOldStorageList(res.data.receipts?.reverse());
})
.catch((err) => {});

Expand Down
2 changes: 1 addition & 1 deletion src/components/views/Quickorder/QuickOrder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const QuickOrderComponent = ({ isAuth }) => {
`${apiRoot}/api/v1/order/history/fast`,
config
);
setQuickOrder(response1.data.receipts);
setQuickOrder(response1.data.receipts?.reverse());
} catch (error) {
console.error("quickOrder Error fetching data:", error);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/StateBox/StateBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const StateBox = ({ id, date, name, menu, imgUrl, amount, isLast, state }) => {
<Link
to={`/orderDetail?orderId=${id}`}
state={{ returnTo: "/ready" }}
style={{ textDecoration: "none" }}
style={{ textDecoration: "none", color: "#000" }}
>
상세보기
</Link>
Expand Down
1 change: 1 addition & 0 deletions src/pages/OrderDetail/OrderDetail.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
.detail-order-menu-option__wrapper{
display: flex;
margin-top: 0.25rem;
flex-wrap: wrap;
}

.detail-order-menu-option{
Expand Down
35 changes: 21 additions & 14 deletions src/pages/OrderDetail/OrderDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const OrderDetail = () => {
{detailData?.orderStatus === "CANCEL" ? (
<span className="detail-order-status fail">
주문 취소
{/* {detailData?.cancelReason === null ? <span></span> : <span>({detailData?.cancelReason})</span>} */}
{detailData?.cancelReason === null ? <span></span> : <span>({detailData?.cancelReason?.split(",")[1]?.split("=")[1]})</span>}
</span>
) : (
<span className="detail-order-status">주문 완료</span>
Expand All @@ -54,6 +54,7 @@ const OrderDetail = () => {
<span>주문일시: {detailData?.orderTime}</span>
<span>주문번호: {detailData?.orderId}</span>
<span>가게전화: {detailData?.storePhone}</span>
<span>수령방식: {detailData?.inout ? "매장" : "픽업"}</span>
</div>
</div>
<div className="detail-line"></div>
Expand All @@ -69,16 +70,9 @@ const OrderDetail = () => {
<div className="detail-order-menu-option__wrapper">
{e.options?.map((option, idx) => (
<>
{!option.required ?
(
<span className="detail-order-menu-option">
[{option.categoryName}] {option.name}
</span>
) : (
<span className="detail-order-menu-option">
{option.name}
</span>
)}
{idx !== e.options?.length - 1 && (<span className="detail-order-menu-option">/</span>)}
</>
)
Expand All @@ -104,17 +98,30 @@ const OrderDetail = () => {
<div className="detail-line"></div>
<div className="detail-bottom__wrapper">
<div className="detail-payment__box">
<span className="detail-payment__title">총 결제금액</span>
<span className="detail-payment__title">상품금액</span>
<span className="detail-payment-price">{
(detailData?.cart?.totalPrice - detailData?.salePrice).toString()
detailData?.cart?.totalPrice?.toString()
.replace(/\B(?=(\d{3})+(?!\d))/g, ",")
}</span>
</div>
<div className="detail-payment__box">
<span className="detail-payment__title">결제방법</span>
<span className="detail-payment__txt">
{detailData?.method}
</span>
<span className="detail-payment__title">할인금액</span>
<span className="detail-payment-price">{
detailData?.salePrice &&
(detailData?.salePrice === 0 ?
0 :
`(-) ${detailData?.salePrice !== undefined && !isNaN(detailData?.salePrice) &&
detailData?.salePrice?.toString()
.replace(/\B(?=(\d{3})+(?!\d))/g, ",")}`)
}</span>
</div>
<div className="detail-payment__box">
<span className="detail-payment__title">총 결제금액</span>
<span className="detail-payment-price">{
detailData?.salePrice !== undefined && !isNaN(detailData?.salePrice) &&
(detailData?.cart?.totalPrice - detailData?.salePrice).toString()
.replace(/\B(?=(\d{3})+(?!\d))/g, ",")
}</span>
</div>
</div>
<div className="detail-line"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReadyPage/ReadyPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function ReadyPage() {

axios.get(`${apiUrl}/api/v1/order/history/fast`, config)
.then((res) => {
setStorageList(res.data.receipts);
setStorageList(res.data.receipts?.reverse());
})
.catch((err) => {});
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down

0 comments on commit 78ae4cd

Please sign in to comment.