From cbe251670b7080b8cf4a593f2795807dea046a7b Mon Sep 17 00:00:00 2001 From: dongyoungKo Date: Fri, 23 May 2025 16:27:24 +0900 Subject: [PATCH] =?UTF-8?q?[=ED=86=B5=ED=95=A9=EB=A1=9C=EA=B7=B8API=20No.2?= =?UTF-8?q?4]=20MyOrder=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=A3=BC=EB=AC=B8=EC=B7=A8=EC=86=8C=EB=A5=BC=20=ED=95=98?= =?UTF-8?q?=EC=98=80=EC=9D=84=EB=95=8C=20=ED=95=B4=EB=8B=B9=20=EC=82=AC?= =?UTF-8?q?=EC=9C=A0=EC=99=80=20=EC=83=81=ED=92=88=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=EC=88=98=EC=A7=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- com.twin.app.shoptime/src/utils/Config.js | 2 ++ .../MyPageSub/MyOrders/MyOrders.jsx | 23 +++++++++++++++++-- .../MyOrders/components/OrderListCard.jsx | 2 ++ .../components/OrderListCardStatus.jsx | 10 +++++--- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/com.twin.app.shoptime/src/utils/Config.js b/com.twin.app.shoptime/src/utils/Config.js index 04168ab1..2f51aac8 100644 --- a/com.twin.app.shoptime/src/utils/Config.js +++ b/com.twin.app.shoptime/src/utils/Config.js @@ -602,6 +602,7 @@ export const LOG_CONTEXT_NAME = { THEME_CURATION: "shoptime.themeCuration", CATEGORY: "shoptime.category", ENTRY: "shoptime.entry", + MYORDER: "shoptime.myorder", }; export const LOG_MESSAGE_ID = { @@ -616,6 +617,7 @@ export const LOG_MESSAGE_ID = { SMB: "AL_SBM", GNB: "AL_GNB_CLICK", BUTTONCLICK: "AL_BUTTON_CLICK", + BUTTON_CANCEL: "AL_BUTTON_CANCEL", TOGGLE_CLICK: "AL_TOGGLE_CLICK", MYPAGE_DELETE: "AL_MYPAGE_DELETE", MYPAGE_CLICK: "AL_MYPAGE_CLICK", diff --git a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/MyOrders.jsx b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/MyOrders.jsx index 6ae0db87..5d6bffad 100644 --- a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/MyOrders.jsx +++ b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/MyOrders.jsx @@ -144,7 +144,8 @@ export default function MyOrders({ title, panelInfo, isOnTop }) { panelInfo.dropDownTab ? panelInfo.dropDownTab : 0 ); const [styleChange, setStyleChange] = useState(false); - + const [selectedCancelItem, setSelectedCancelItem] = useState(null); + const [cancelReason, setCancelReason] = useState(""); const listContainerRef = useRef(null); const tabRef = usePrevious(selectedTab); const dropDownTabRef = usePrevious(dropDownTab); @@ -440,6 +441,8 @@ export default function MyOrders({ title, panelInfo, isOnTop }) { }) ); + setCancelReason(detailCdNm); + setTimeout(() => { Spotlight.focus("tPopupBtn2"); }, 0); @@ -470,10 +473,24 @@ export default function MyOrders({ title, panelInfo, isOnTop }) { const { reqChngRsn: reqRsn } = params; const reqTpNm = "Cancel"; + const { prdtId, prdtNm, brndNm } = selectedCancelItem; + dispatch(setHidePopup()); dispatch(paymentTotalCancel(params, moveToCancelTab)); dispatch(sendLogOrderChange({ reqRsn, reqTpNm })); - }, [dispatch, popup, moveToCancelTab]); + + if (selectedCancelItem) + dispatch( + sendLogTotalRecommend({ + contextName: Config.LOG_CONTEXT_NAME.MYORDER, + messageId: Config.LOG_MESSAGE_ID.BUTTON_CANCEL, + productId: prdtId, + productTitle: prdtNm, + brand: brndNm, + reason: cancelReason, + }) + ); + }, [dispatch, popup, selectedCancelItem, moveToCancelTab]); useEffect(() => { Spotlight.focus(); @@ -581,6 +598,7 @@ export default function MyOrders({ title, panelInfo, isOnTop }) { key={"order" + index} onClickBuyAgain={onClickBuyAgain} doSendLogOrderBtnClick={doSendLogOrderBtnClick} + setSelectedCancelItem={setSelectedCancelItem} /> )) ) : ( @@ -594,6 +612,7 @@ export default function MyOrders({ title, panelInfo, isOnTop }) { onClickBuyAgain={onClickBuyAgain} cancelItem={true} doSendLogOrderBtnClick={doSendLogOrderBtnClick} + setSelectedCancelItem={setSelectedCancelItem} /> )) ) : ( diff --git a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/components/OrderListCard.jsx b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/components/OrderListCard.jsx index e4ed62a9..de8f26a0 100644 --- a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/components/OrderListCard.jsx +++ b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/components/OrderListCard.jsx @@ -25,6 +25,7 @@ export default memo(function OrderListCard({ onClickBuyAgain, cancelItem = false, doSendLogOrderBtnClick, + setSelectedCancelItem, }) { const { ordNo, @@ -86,6 +87,7 @@ export default memo(function OrderListCard({ doSendLogOrderBtnClick={doSendLogOrderBtnClick} ordNo={ordNo} mbrNo={mbrNo} + setSelectedCancelItem={setSelectedCancelItem} /> ); diff --git a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/components/OrderListCardStatus.jsx b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/components/OrderListCardStatus.jsx index 07d496be..3ed2cce0 100644 --- a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/components/OrderListCardStatus.jsx +++ b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/components/OrderListCardStatus.jsx @@ -42,6 +42,7 @@ export default function OrderListCardStatus({ onClickBuyAgain, cancelItem, doSendLogOrderBtnClick, + setSelectedCancelItem, ordNo, mbrNo, }) { @@ -67,6 +68,7 @@ export default function OrderListCardStatus({ invTrceId, dlvrMeth, deliveryUrl, + brndNm, } = orderProductInfo || {}; const { @@ -117,16 +119,18 @@ export default function OrderListCardStatus({ { reasonTpCd: ITEM_STATUS_TYPE.cancel }, () => { dispatch( - setShowPopup(Config.ACTIVE_POPUP.orderCancelPopup, { data: ordNo }) + setShowPopup(Config.ACTIVE_POPUP.orderCancelPopup, { + data: ordNo, + }) ); } ) ); - + setSelectedCancelItem(orderProductInfo); if (doSendLogOrderBtnClick) { doSendLogOrderBtnClick(LOG_STRING_CONF.CANCEL_ITEM); } - }, [dispatch, doSendLogOrderBtnClick]); + }, [dispatch, doSendLogOrderBtnClick, setSelectedCancelItem]); function showDetailPopup(response) { if (response) {