From 8cce06bcc3462ec5f973c5efb7fefa62c50d05d8 Mon Sep 17 00:00:00 2001 From: "junghoon86.park" Date: Fri, 21 Nov 2025 18:22:07 +0900 Subject: [PATCH] =?UTF-8?q?[=EB=94=94=ED=85=8C=EC=9D=BC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 현재 매직마우스로는 팝업및 노출 정상적으로 가능하지만 4방향키 수정진행해야함. - 토스트가 유지가 안됌에 따른 수정이 더 필요함. --- com.twin.app.shoptime/src/utils/Config.js | 1 + .../src/views/CartPanel/CartPanel.jsx | 6 ++ .../ProductAllSection/ProductAllSection.jsx | 17 +++-- .../DetailPanel/components/BuyOption.jsx | 70 ++++++++++++++----- .../components/BuyOption.module.less | 8 +++ 5 files changed, 80 insertions(+), 22 deletions(-) diff --git a/com.twin.app.shoptime/src/utils/Config.js b/com.twin.app.shoptime/src/utils/Config.js index 8d7bd238..b0371e58 100644 --- a/com.twin.app.shoptime/src/utils/Config.js +++ b/com.twin.app.shoptime/src/utils/Config.js @@ -113,6 +113,7 @@ export const ACTIVE_POPUP = { toast: 'toast', optionalConfirm: 'optionalConfirm', energyPopup: 'energyPopup', + addCartPopup: 'addCartPopup', }; export const DEBUG_VIDEO_SUBTITLE_TEST = false; export const AUTO_SCROLL_DELAY = 600; diff --git a/com.twin.app.shoptime/src/views/CartPanel/CartPanel.jsx b/com.twin.app.shoptime/src/views/CartPanel/CartPanel.jsx index 6209aec9..6ca3cdba 100644 --- a/com.twin.app.shoptime/src/views/CartPanel/CartPanel.jsx +++ b/com.twin.app.shoptime/src/views/CartPanel/CartPanel.jsx @@ -22,6 +22,7 @@ import { popPanel, updatePanel, } from '../../actions/panelActions'; +import { clearAllToasts } from '../../actions/toastActions'; import TBody from '../../components/TBody/TBody'; import THeader from '../../components/THeader/THeader'; import TPanel from '../../components/TPanel/TPanel'; @@ -207,6 +208,11 @@ export default function CartPanel({ spotlightId, scrollOptions = [], panelInfo } } },[userNumber, dispatch]) + useEffect(()=>{ + dispatch(clearAllToasts()); + //혹시라도 넘어올 토스트 제거. + },[]) + return ( diff --git a/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx b/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx index 48830183..77f4a530 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx +++ b/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx @@ -431,8 +431,11 @@ export default function ProductAllSection({ > {downloadCouponArr.length > 0 && downloadCouponArr.includes(cpnSno) - ? $L("DOWNLOAD COMPLETED") - : $L("DOWNLOAD")} + ? + $L("DOWNLOAD COMPLETED") + : + $L("DOWNLOAD") + } )} @@ -663,9 +666,13 @@ export default function ProductAllSection({ //닫히도록 const handleCloseToast = useCallback(() => { - dispatch(clearAllToasts()); - setOpenToast(false); - }, [dispatch]); + // 팝업이 열려있으면 닫지 않음 + if (popupVisible) { + return; // 팝업이 활성이면 무시 + } + dispatch(clearAllToasts()); + setOpenToast(false); +}, [dispatch, popupVisible]); // 스크롤 컨테이너의 클릭 이벤트 추적용 로깅 const handleScrollContainerClick = useCallback((e) => { diff --git a/com.twin.app.shoptime/src/views/DetailPanel/components/BuyOption.jsx b/com.twin.app.shoptime/src/views/DetailPanel/components/BuyOption.jsx index 717e9f11..9c8a163a 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/components/BuyOption.jsx +++ b/com.twin.app.shoptime/src/views/DetailPanel/components/BuyOption.jsx @@ -639,7 +639,8 @@ const BuyOption = ({ Spotlight.focus('buy-option-buy-now-button'); } - const handleBuyNowClick = useCallback(() => { + const handleBuyNowClick = useCallback((e) => { + e.stopPropagation() console.log('%c🔥🔥🔥 BUY NOW CLICKED! FUNCTION CALLED! 🔥🔥🔥', 'background: red; color: white; font-size: 16px; font-weight: bold; padding: 5px;'); console.log('%cproductInfo exists:', 'background: red; color: white; padding: 3px;', !!productInfo); console.log('%cuserNumber exists:', 'background: red; color: white; padding: 3px;', !!userNumber); @@ -1013,7 +1014,7 @@ const BuyOption = ({ console.log('%c[BuyOption] ✅ AFTER pushPanel dispatch', 'background: orange; color: white; font-weight: bold; padding: 5px;'); // Toast 정리는 성공적으로 패널 이동 후에만 실행 - dispatch(clearAllToasts()); + // dispatch(clearAllToasts()); } } }, [ @@ -1035,7 +1036,8 @@ const BuyOption = ({ ]); // ADD TO CART 버튼 클릭 핸들러 - const handleAddToCartClick = useCallback(() => { + const handleAddToCartClick = useCallback((e) => { + e.stopPropagation(); console.log('[BuyOption] ADD TO CART clicked'); const isMock = isMockMode; @@ -1180,17 +1182,18 @@ const BuyOption = ({ name: optionLabel, price: optionForUse?.optPrc || '0.00', }; - - dispatch( - pushPanel({ - name: Config.panel_names.CART_PANEL, - panelInfo: { - productInfo: productInfoForCart, - optionInfo: optionInfoForCart, - quantity: effectiveQuantity, - }, - }) - ); + dispatch(setShowPopup(Config.ACTIVE_POPUP.addCartPopup)); + return; + // dispatch( + // pushPanel({ + // name: Config.panel_names.CART_PANEL, + // panelInfo: { + // productInfo: productInfoForCart, + // optionInfo: optionInfoForCart, + // quantity: effectiveQuantity, + // }, + // }) + // ); } else { console.log('[BuyOption] Mock Mode - Adding to cart (Mock)'); @@ -1241,7 +1244,7 @@ const BuyOption = ({ optionInfo, quantity: effectiveQuantity, }, - }) + }) ); } dispatch(clearAllToasts()); @@ -1403,7 +1406,7 @@ const BuyOption = ({ if (typeof spotlightId === 'string') { currentSpot = spotlightId; } else { - currentSpot = 'buy-option-buy-now-button'; + currentSpot = 'buy-option-add-to-cart-button'; } if (currentSpot) { @@ -1447,8 +1450,25 @@ const BuyOption = ({ } }, [dispatch, hasOnClose, isOptionValue, webOSVersion, userNumber]); + useEffect(()=>{ + return(()=>{ + dispatch(clearAllToasts()); + }) + },[]) + +const handleCartMove = useCallback(() => { + dispatch(setHidePopup()); + dispatch( + pushPanel({ + name: Config.panel_names.CART_PANEL, + }) + ) +},[dispatch]) + return ( - +
{/* 동적 옵션 렌더링 */} {productOptionInfos && @@ -1582,8 +1602,24 @@ const BuyOption = ({ onClose={onClose} /> )} + {activePopup === Config.ACTIVE_POPUP.addCartPopup && ( + + )} ); }; + + export default BuyOption; diff --git a/com.twin.app.shoptime/src/views/DetailPanel/components/BuyOption.module.less b/com.twin.app.shoptime/src/views/DetailPanel/components/BuyOption.module.less index 6720f414..8a54b64d 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/components/BuyOption.module.less +++ b/com.twin.app.shoptime/src/views/DetailPanel/components/BuyOption.module.less @@ -133,3 +133,11 @@ text-align: center; } } + + + +[id="floatLayer"] > div:not([id]) > div > div:nth-child(2) { + bottom: 54%; + transform: translateY(50%); + overflow: initial; +} \ No newline at end of file