From bc8317483f5c5b830ac20fb3e8ad1b5d3c491544 Mon Sep 17 00:00:00 2001 From: optrader Date: Wed, 10 Dec 2025 16:49:51 +0900 Subject: [PATCH] =?UTF-8?q?[251210]=20fix:=20DetailPanel,ProductAllSection?= =?UTF-8?q?=20API=EC=B5=9C=EC=A0=81=ED=99=94-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ• ์ปค๋ฐ‹ ์‹œ๊ฐ„: 2025. 12. 10. 16:49:51 ๐Ÿ“Š ๋ณ€๊ฒฝ ํ†ต๊ณ„: โ€ข ์ด ํŒŒ์ผ: 1๊ฐœ โ€ข ์ถ”๊ฐ€: +49์ค„ โ€ข ์‚ญ์ œ: -43์ค„ ๐Ÿ“ ์ˆ˜์ •๋œ ํŒŒ์ผ: ~ com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx ๐Ÿ”ง ์ฃผ์š” ๋ณ€๊ฒฝ ๋‚ด์šฉ: โ€ข ์†Œ๊ทœ๋ชจ ๊ธฐ๋Šฅ ๊ฐœ์„  โ€ข ์ฝ”๋“œ ์ •๋ฆฌ ๋ฐ ์ตœ์ ํ™” --- .../ProductAllSection/ProductAllSection.jsx | 90 ++++++++++--------- 1 file changed, 48 insertions(+), 42 deletions(-) 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 ace5daf3..837ffdc2 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx +++ b/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx @@ -335,7 +335,7 @@ export default function ProductAllSection({ hasVideo ]); - useEffect(() => { + const fetchCouponData = useCallback(() => { dispatch( getProductCouponSearch({ patnrId: selectedPatnrId, @@ -343,7 +343,14 @@ export default function ProductAllSection({ mbrNo: userNumber, }) ); - }, [dispatch]); + }, [selectedPatnrId, selectedPrdtId, userNumber, dispatch]); + + useEffect(() => { + // ํ•„์ˆ˜ ๊ฐ’์ด ๋ชจ๋‘ ์žˆ์„ ๋•Œ๋งŒ ํ˜ธ์ถœ + if (selectedPatnrId && selectedPrdtId) { + fetchCouponData(); + } + }, [fetchCouponData]); const getCouponCode = () => { const snoArray = []; @@ -383,7 +390,7 @@ export default function ProductAllSection({ setCouponTypes(idx); dispatch(setShowPopup(Config.ACTIVE_POPUP.couponPopup)); }, - [dispatch, popupVisible, promotions, userNumber] + [dispatch, userNumber, partnerCoupon] ); const handleCouponTotDownload = useCallback(() => { @@ -748,20 +755,22 @@ export default function ProductAllSection({ : baseMenu; dispatch(sendLogGNB(menu)); + }, [isBillingProductVisible, isGroupProductVisible, isTravelProductVisible, fromPanel?.fromYouMayLike]); // sendLogGNB ์ „์†ก ํ›„ ํ”Œ๋ž˜๊ทธ ์ดˆ๊ธฐํ™” (1ํšŒ ์‚ฌ์šฉ ํ›„ ๋น„ํ™œ์„ฑํ™”) - if (fromPanel?.fromYouMayLike === true) { - dispatch(updatePanel({ - name: panel_names.DETAIL_PANEL, - panelInfo: { - ...panelInfo, - fromPanel: { - fromYouMayLike: false // ํ”Œ๋ž˜๊ทธ ์ดˆ๊ธฐํ™” + useEffect(() => { + if (fromPanel?.fromYouMayLike === true) { + dispatch(updatePanel({ + name: panel_names.DETAIL_PANEL, + panelInfo: { + ...panelInfo, + fromPanel: { + fromYouMayLike: false // ํ”Œ๋ž˜๊ทธ ์ดˆ๊ธฐํ™” + } } - } - })); - } -}, [fromPanel?.fromYouMayLike, isBillingProductVisible, isUnavailableProductVisible, isGroupProductVisible, isTravelProductVisible]); // BUY NOW ์ƒํƒœ ๋ณ€๊ฒฝ ์‹œ ์žฌ์‹คํ–‰ + })); + } + }, [fromPanel?.fromYouMayLike, dispatch, panelInfo]); // sendLogProductDetail ๋กœ๊น… - Source์˜ productData ๋ณ€๊ฒฝ ๊ฐ์ง€์™€ ๋™์ผํ•œ ํŒจํ„ด useEffect(() => { @@ -793,9 +802,9 @@ export default function ProductAllSection({ tsvFlag: productData?.todaySpclFlag ?? "", }; - return () => dispatch(sendLogProductDetail(params)); + dispatch(sendLogProductDetail(params)); } - }, [productData, entryMenuRef.current, panelInfo?.linkTpCd, isBillingProductVisible, isGroupProductVisible, isTravelProductVisible]); // productData ๋ณ€๊ฒฝ ์‹œ ์žฌ์‹คํ–‰ + }, [productData, panelInfo?.linkTpCd, isBillingProductVisible, isGroupProductVisible, isTravelProductVisible, dispatch]); // productData ๋ณ€๊ฒฝ ์‹œ ์žฌ์‹คํ–‰ // [251115] ์ฃผ์„ ์ฒ˜๋ฆฌ: MediaPanel์—์„œ ์ด๋ฏธ ํฌ์ปค์Šค ์ด๋™์„ ์ฒ˜๋ฆฌํ•˜๋ฏ€๋กœ // ProductAllSection์˜ ์ž๋™ ํฌ์ปค์Šค๋Š” ํฌ์ปค์Šค ํƒˆ์ทจ๋ฅผ ์ผ์œผํ‚ฌ ์ˆ˜ ์žˆ์Œ @@ -1111,35 +1120,32 @@ export default function ProductAllSection({ return hasVideo && productVideoVersion === 1; }, [hasVideo, productVideoVersion]); - const handleShopByMobileOpen = useCallback( - pipe(() => { - // sendLogShopByMobile - Source์™€ ๋™์ผํ•œ ๋กœ๊น… ์ถ”๊ฐ€ - if (productData && Object.keys(productData).length > 0) { - const { priceInfo, patncNm, patnrId, prdtId, prdtNm, brndNm, catNm } = productData; - const regularPrice = priceInfo?.split("|")[0]; - const discountPrice = priceInfo?.split("|")[1]; - const discountRate = priceInfo?.split("|")[4]; + const handleShopByMobileOpen = useCallback(() => { + // sendLogShopByMobile - Source์™€ ๋™์ผํ•œ ๋กœ๊น… ์ถ”๊ฐ€ + if (productData && Object.keys(productData).length > 0) { + const { priceInfo, patncNm, patnrId, prdtId, prdtNm, brndNm, catNm } = productData; + const regularPrice = priceInfo?.split("|")[0]; + const discountPrice = priceInfo?.split("|")[1]; + const discountRate = priceInfo?.split("|")[4]; - const logParams = { - prdtId, - patnrId, - prdtNm, - patncNm, - brndNm, - catNm, - regularPrice, - discountPrice, - discountRate, - shopByMobileTime: new Date().toISOString(), - }; + const logParams = { + prdtId, + patnrId, + prdtNm, + patncNm, + brndNm, + catNm, + regularPrice, + discountPrice, + discountRate, + shopByMobileTime: new Date().toISOString(), + }; - dispatch(sendLogShopByMobile(logParams)); - } + dispatch(sendLogShopByMobile(logParams)); + } - setMobileSendPopupOpen(true); // ํŒ์—… ์—ด๊ธฐ - }), - [setMobileSendPopupOpen] - ); + setMobileSendPopupOpen(true); // ํŒ์—… ์—ด๊ธฐ + }, [productData, dispatch]); const shopByMobileId = useMemo( () => SpotlightIds?.DETAIL_SHOPBYMOBILE || 'detail_shop_by_mobile',