@@ -44,6 +51,11 @@ const Admin = () => {
>
배송 가능 날짜
+
+
+
+ 로그아웃
+
diff --git a/src/pages/Admin/page/AdminPage/DeliveryCheck/DeliveryCheck.tsx b/src/pages/Admin/page/AdminPage/DeliveryCheck/DeliveryCheck.tsx
index fab2318..84671bd 100644
--- a/src/pages/Admin/page/AdminPage/DeliveryCheck/DeliveryCheck.tsx
+++ b/src/pages/Admin/page/AdminPage/DeliveryCheck/DeliveryCheck.tsx
@@ -13,23 +13,24 @@ import { usePatchDeliveryDate } from "@apis/domains/admin/usePatchDeliveryDate";
const DeliveryCheck = () => {
const { data: currentDeliveryDate, isSuccess } = useFetchDeliveryDate();
const { mutate } = usePatchDeliveryDate();
- const [deliveryDate, setDeliveryDate] = useState(0);
+ const [deliveryDate, setDeliveryDate] = useState("");
const handleInputChange = (e: React.ChangeEvent) => {
- const value = Number(e.target.value);
-
- if (value > 1) {
- setDeliveryDate(value);
- }
+ const value = e.target.value;
+ setDeliveryDate(value);
};
const handleButtonClick = () => {
- mutate(deliveryDate);
+ if (Number(deliveryDate) > 1) {
+ mutate(deliveryDate);
+ } else {
+ alert("최소 2일 이상으로 설정해주세요.");
+ }
};
useEffect(() => {
if (isSuccess && currentDeliveryDate) {
- setDeliveryDate(currentDeliveryDate);
+ setDeliveryDate(currentDeliveryDate.toString());
}
}, [currentDeliveryDate, isSuccess]);
@@ -58,7 +59,7 @@ const DeliveryCheck = () => {
일
- {currentDeliveryDate !== deliveryDate && (
+ {currentDeliveryDate?.toString() !== deliveryDate && (
diff --git a/src/pages/orderCheck/components/OrderInfoSection/OrderInfoSection.style.ts b/src/pages/orderCheck/components/OrderInfoSection/OrderInfoSection.style.ts
index 50a92fe..1d36685 100644
--- a/src/pages/orderCheck/components/OrderInfoSection/OrderInfoSection.style.ts
+++ b/src/pages/orderCheck/components/OrderInfoSection/OrderInfoSection.style.ts
@@ -25,6 +25,15 @@ export const blackSpan = (theme: Theme) => css`
${theme.font["orderCheck-36"]}
`;
+export const statusStyle = (statusStyle: string) => (theme: Theme) =>
+ css`
+ color: ${statusStyle === "결제완료"
+ ? theme.color.green
+ : statusStyle === "결제취소"
+ ? theme.color.red
+ : theme.color.orange};
+ `;
+
export const buttonWrapper = css`
${flexGenerator("row", "space-between", "center")};
width: 100%;
diff --git a/src/pages/orderCheck/components/OrderInfoSection/OrderInfoSection.tsx b/src/pages/orderCheck/components/OrderInfoSection/OrderInfoSection.tsx
index e2d5f40..ff0863e 100644
--- a/src/pages/orderCheck/components/OrderInfoSection/OrderInfoSection.tsx
+++ b/src/pages/orderCheck/components/OrderInfoSection/OrderInfoSection.tsx
@@ -7,6 +7,7 @@ import {
section3Container,
section3Div,
section3InfoWrapper,
+ statusStyle,
} from "./OrderInfoSection.style";
import { useAtom } from "jotai";
import { usePatchPayComplete } from "@apis/domains/orderCheck/usePatchPayComplete";
@@ -15,6 +16,7 @@ import { usePatchPayCancel } from "@apis/domains/orderCheck/usePatchPayCancel";
const OrderInfoSection = () => {
const [previousOrderNumber] = useAtom(previousOrderNumberAtom);
const [orderInfo] = useAtom(orderInfoAtom);
+ const orderStatus = orderInfo?.orderList[0].deliveryStatus;
const { mutate: mutatePayComplete } = usePatchPayComplete();
const { mutate: mutatePayCancel } = usePatchPayCancel();
@@ -32,6 +34,12 @@ const OrderInfoSection = () => {
주문번호
{previousOrderNumber}
+
+ 주문상태
+
+ {orderStatus}
+
+
이름
{orderInfo?.senderName}
@@ -47,7 +55,9 @@ const OrderInfoSection = () => {
총 금액
- {orderInfo?.totalPrice}원
+
+ {orderInfo?.totalPrice.toLocaleString()}원
+
diff --git a/src/pages/orderCheck/components/OrderNumberSearchSection/OrderNumberSearchSection.tsx b/src/pages/orderCheck/components/OrderNumberSearchSection/OrderNumberSearchSection.tsx
index dbbe213..83f645a 100644
--- a/src/pages/orderCheck/components/OrderNumberSearchSection/OrderNumberSearchSection.tsx
+++ b/src/pages/orderCheck/components/OrderNumberSearchSection/OrderNumberSearchSection.tsx
@@ -70,6 +70,7 @@ const OrderNumberSearchSection = ({
key={i}
orderNumber={order.orderNumber}
senderName={order.senderName}
+ deliveryStatus={order.deliveryStatus}
onClick={() => handleRecentOrderClick(order.orderNumber.toString())}
/>
))}
diff --git a/src/pages/orderCheck/components/RecentOrderCard/RecentOrderCard.style.ts b/src/pages/orderCheck/components/RecentOrderCard/RecentOrderCard.style.ts
index a9b8d83..5808a21 100644
--- a/src/pages/orderCheck/components/RecentOrderCard/RecentOrderCard.style.ts
+++ b/src/pages/orderCheck/components/RecentOrderCard/RecentOrderCard.style.ts
@@ -1,19 +1,29 @@
import { css, Theme } from "@emotion/react";
import { flexGenerator } from "@styles/generator";
-export const cardWrapper = (theme: Theme) => css`
- ${flexGenerator("row", "space-between", "center")};
- gap: 1rem;
- width: 100%;
- padding: 1.5rem 1.2rem;
- border-radius: 10px;
- background-color: ${theme.color.lightorange};
-`;
+export const cardWrapper = (deliveryStatus: string) => (theme: Theme) =>
+ css`
+ ${flexGenerator("row", "space-between", "center")};
+ gap: 1rem;
+ width: 100%;
+ padding: 1.5rem 1.2rem;
+ border-radius: 10px;
+ background-color: ${deliveryStatus === "결제완료"
+ ? theme.color.lightgreen
+ : deliveryStatus === "결제취소"
+ ? theme.color.red2
+ : theme.color.lightorange};
+ `;
-export const numberStyle = (theme: Theme) => css`
- color: ${theme.color.orange};
- ${theme.font["orderCheck-32"]}
-`;
+export const numberStyle = (deliveryStatus: string) => (theme: Theme) =>
+ css`
+ color: ${deliveryStatus === "결제완료"
+ ? theme.color.green
+ : deliveryStatus === "결제취소"
+ ? theme.color.red
+ : theme.color.orange};
+ ${theme.font["orderCheck-32"]}
+ `;
export const nameStyle = (theme: Theme) => css`
color: ${theme.color.black};
diff --git a/src/pages/orderCheck/components/RecentOrderCard/RecentOrderCard.tsx b/src/pages/orderCheck/components/RecentOrderCard/RecentOrderCard.tsx
index 82820bd..2edcc42 100644
--- a/src/pages/orderCheck/components/RecentOrderCard/RecentOrderCard.tsx
+++ b/src/pages/orderCheck/components/RecentOrderCard/RecentOrderCard.tsx
@@ -3,17 +3,19 @@ import { cardWrapper, nameStyle, numberStyle } from "./RecentOrderCard.style";
interface RecentOrderCardProps {
orderNumber: number;
senderName: string;
+ deliveryStatus: string;
onClick: () => void;
}
const RecentOrderCard = ({
orderNumber,
senderName,
+ deliveryStatus,
onClick,
}: RecentOrderCardProps) => {
return (
-
-
{orderNumber}번
+
+ {orderNumber}번
{senderName}
);
diff --git a/src/pages/orderCheck/page/OrderCheckPage.tsx b/src/pages/orderCheck/page/OrderCheckPage.tsx
index 2bd5d72..a2999f2 100644
--- a/src/pages/orderCheck/page/OrderCheckPage.tsx
+++ b/src/pages/orderCheck/page/OrderCheckPage.tsx
@@ -3,11 +3,7 @@ import {
orderCheckLayout,
refreshButton,
} from "./OrderCheckPage.style";
-import {
- // OrderTrackingSection,
- OrderNumberSearchSection,
- OrderInfoSection,
-} from "../components";
+import { OrderNumberSearchSection, OrderInfoSection } from "../components";
import { IcRefresh } from "@svg";
import { useFetchRecentOrderNumber } from "@apis/domains/orderCheck/useFetchRecentOrderNumber";
@@ -20,7 +16,6 @@ const OrderCheckPage = () => {
return (
- {/*
*/}
diff --git a/src/styles/theme.ts b/src/styles/theme.ts
index 068da0d..3b4d223 100644
--- a/src/styles/theme.ts
+++ b/src/styles/theme.ts
@@ -12,6 +12,7 @@ const theme = {
white: "#FFFFFF",
black: "#000000",
red: "#ff2c2c",
+ red2: "#FFD0D0",
lightgray1: "#DFE2E7",
lightgray2: "#D9D9D9",
lightgray3: "#C4C4C4",
@@ -26,6 +27,7 @@ const theme = {
orange: "#EC6732",
lightorange: "#FFEDE7",
green: "#3CA178",
+ lightgreen: "#D1F2E4",
},
font: {
"head01-b-24": css`
diff --git a/src/types/commonType.ts b/src/types/commonType.ts
index 58250f3..03d7bbe 100644
--- a/src/types/commonType.ts
+++ b/src/types/commonType.ts
@@ -35,4 +35,7 @@ export interface OrderNumberType {
export interface CodeResponseType {
code: string;
+ data: {
+ token: string;
+ };
}
diff --git a/src/types/orderInfoWithOrderNumber.ts b/src/types/orderInfoWithOrderNumber.ts
index 22caaee..34a9325 100644
--- a/src/types/orderInfoWithOrderNumber.ts
+++ b/src/types/orderInfoWithOrderNumber.ts
@@ -1,7 +1,7 @@
export interface OrderInfo {
productName: string;
productCount: number;
- orderState: string;
+ deliveryStatus: string;
price: number;
}
diff --git a/src/types/recentOrderType.ts b/src/types/recentOrderType.ts
index 8acfda9..b121cd4 100644
--- a/src/types/recentOrderType.ts
+++ b/src/types/recentOrderType.ts
@@ -1,4 +1,5 @@
export interface RecentOrderType {
orderNumber: number;
senderName: string;
+ deliveryStatus: string;
}