From 05f5bf4d332c6d6d1d798b5b9ac8fe17175d3780 Mon Sep 17 00:00:00 2001 From: optrader Date: Thu, 11 Dec 2025 09:07:19 +0900 Subject: [PATCH] [251211] feat: FeaturedBrandsPanel , See More Products - 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ• ์ปค๋ฐ‹ ์‹œ๊ฐ„: 2025. 12. 11. 09:07:19 ๐Ÿ“Š ๋ณ€๊ฒฝ ํ†ต๊ณ„: โ€ข ์ด ํŒŒ์ผ: 1๊ฐœ โ€ข ์ถ”๊ฐ€: +93์ค„ โ€ข ์‚ญ์ œ: -4์ค„ ๐Ÿ“ ์ˆ˜์ •๋œ ํŒŒ์ผ: ~ com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx ๐Ÿ”ง ์ฃผ์š” ๋ณ€๊ฒฝ ๋‚ด์šฉ: โ€ข ์†Œ๊ทœ๋ชจ ๊ธฐ๋Šฅ ๊ฐœ์„  --- .../ProductAllSection/ProductAllSection.jsx | 97 ++++++++++++++++++- 1 file changed, 93 insertions(+), 4 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 87c4fa64..87eee2fd 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx +++ b/com.twin.app.shoptime/src/views/DetailPanel/ProductAllSection/ProductAllSection.jsx @@ -267,6 +267,10 @@ export default function ProductAllSection({ const { userNumber } = useSelector((state) => state.common.appStatus.loginUserData); const { popupVisible, activePopup } = useSelector((state) => state.common.popup); const cursorVisible = useSelector((state) => state.common.appStatus.cursorVisible); + // ๐Ÿ†• [251210] patnrId=21 ์นดํ…Œ๊ณ ๋ฆฌ ๊ทธ๋ฃน ๋ฐ์ดํ„ฐ + const brandShopByShowCategoryGroups = useSelector( + (state) => state.brand.brandShopByShowCategoryGroups + ); // ProductVideo ๋ฒ„์ „ ๊ด€๋ฆฌ (1: ๊ธฐ์กด modal ๋ฐฉ์‹, 2: ๋‚ด์žฅ ๋ฐฉ์‹ , 3: ๋น„๋””์˜ค ์ƒ๋žต) const [productVideoVersion, setProductVideoVersion] = useState(1); // ๋น„๋””์˜ค ์žฌ์ƒ ์—ฌ๋ถ€ flag (์žฌ์ƒ ์ „์—๋Š” minimize/restore ๋กœ์ง ๋น„ํ™œ์„ฑํ™”) @@ -999,6 +1003,8 @@ export default function ProductAllSection({ const [mobileSendPopupOpen, setMobileSendPopupOpen] = useState(false); const [isShowUserReviewsFocused, setIsShowUserReviewsFocused] = useState(false); + // ๐Ÿ†• [251210] patnrId=21 SEE MORE PRODUCTS ๋ฒ„ํŠผ ํ‘œ์‹œ ์—ฌ๋ถ€ + const [hasSeeMoreProducts, setHasSeeMoreProducts] = useState(false); const reviewTotalCount = stats.totalReviews; @@ -1267,13 +1273,96 @@ export default function ProductAllSection({ }, [scrollToSection, dispatch]); const handleSeeMoreProductsClick = useCallback(() => { - console.log('[SEE MORE PRODUCTS] Button clicked - currently no action'); - // TODO: ๋‚˜์ค‘์— ๊ทธ๋ฃน ์ƒํ’ˆ ํ‘œ์‹œ ๋กœ์ง ์ถ”๊ฐ€ + console.log('[SEE MORE PRODUCTS] Button clicked - just scroll to section'); + // ๋ฒ„ํŠผ ํด๋ฆญ ์‹œ ์Šคํฌ๋กค๋งŒ ์ฒ˜๋ฆฌ (๋ฐ์ดํ„ฐ๋Š” useEffect์—์„œ ์ฒ˜๋ฆฌ) scrollToSection('scroll-marker-see-more-products'); setTimeout(() => { Spotlight.focus("see-more-products-area"); }, 100); }, [scrollToSection]); + + // ๐Ÿ†• [251210] patnrId=21์ธ ๊ฒฝ์šฐ ๊ทธ๋ฃน ์ƒํ’ˆ ๋ฐ์ดํ„ฐ ๋ฏธ๋ฆฌ ์ฒ˜๋ฆฌ + useEffect(() => { + if (panelInfo?.patnrId === 21 || panelInfo?.patnrId === "21") { + console.log('[SEE MORE PRODUCTS] patnrId=21 detected - processing group data on panel mount'); + console.log('[SEE MORE PRODUCTS] panelInfo:', panelInfo); + console.log('[SEE MORE PRODUCTS] brandShopByShowCategoryGroups:', brandShopByShowCategoryGroups); + + const patnrIdString = String(panelInfo.patnrId); + const currentPrdtId = panelInfo.prdtId; + const categoryGroups = brandShopByShowCategoryGroups[patnrIdString]; + + console.log('[SEE MORE PRODUCTS] patnrIdString:', patnrIdString); + console.log('[SEE MORE PRODUCTS] currentPrdtId:', currentPrdtId); + console.log('[SEE MORE PRODUCTS] categoryGroups:', categoryGroups); + + let shouldShowButton = false; // ๋ฒ„ํŠผ ํ‘œ์‹œ ์—ฌ๋ถ€ + + if (categoryGroups) { + let foundGroup = null; + let foundConts = null; + + // ๋ชจ๋“  contsId์—์„œ ํ˜„์žฌ ์ƒํ’ˆ์ด ์†ํ•œ ๊ทธ๋ฃน ์ฐพ๊ธฐ + for (const contsId in categoryGroups) { + const contsInfo = categoryGroups[contsId]; + console.log(`[SEE MORE PRODUCTS] Checking contsId: ${contsId}, contsNm: ${contsInfo.contsNm}`); + + if (contsInfo.brandShopByShowClctInfos) { + for (const group of contsInfo.brandShopByShowClctInfos) { + console.log(`[SEE MORE PRODUCTS] Checking group: ${group.clctNm} (${group.clctId})`); + + if (group.brandProductInfos) { + const foundProduct = group.brandProductInfos.find(p => p.prdtId === currentPrdtId); + if (foundProduct) { + console.log('[SEE MORE PRODUCTS] ๐ŸŽฏ Found current product:', foundProduct); + foundGroup = group; + foundConts = contsInfo; + break; + } + } + } + + if (foundGroup) break; + } + } + + if (foundGroup && foundConts) { + console.log('[SEE MORE PRODUCTS] โœ… Found group info:'); + console.log(' - Category:', foundConts.contsNm); + console.log(' - Group:', foundGroup.clctNm); + console.log(' - Group ID:', foundGroup.clctId); + + // ํ˜„์žฌ ์ƒํ’ˆ์„ ์ œ์™ธํ•œ ๋‹ค๋ฅธ ์ƒํ’ˆ๋“ค ํ™•์ธ + const otherProducts = foundGroup.brandProductInfos.filter(p => p.prdtId !== currentPrdtId); + console.log(' - Other products count:', otherProducts.length); + + if (otherProducts.length > 0) { + // ๋‹ค๋ฅธ ์ƒํ’ˆ์ด ์žˆ์„ ๋•Œ๋งŒ ๋ฒ„ํŠผ ํ‘œ์‹œ + shouldShowButton = true; + + console.log('[SEE MORE PRODUCTS] ๐Ÿ“ฆ Showing button - group has other products:'); + otherProducts.forEach((product, index) => { + console.log(` ${index + 1}. ${product.prdtNm} (${product.prdtId})`); + console.log(` - Price: ${product.priceInfo}`); + console.log(` - Brand: ${product.brndNm || 'N/A'}`); + }); + } else { + console.log('[SEE MORE PRODUCTS] โŒ No other products in group - hiding button'); + } + } else { + console.log('[SEE MORE PRODUCTS] โŒ No group found for current product - hiding button'); + } + } else { + console.log('[SEE MORE PRODUCTS] โŒ No category groups found for patnrId 21 - hiding button'); + } + + // ๋ฒ„ํŠผ ํ‘œ์‹œ ์—ฌ๋ถ€ ์ƒํƒœ ์„ค์ • + setHasSeeMoreProducts(shouldShowButton); + } else { + // patnrId=21์ด ์•„๋‹Œ ๊ฒฝ์šฐ ๋ฒ„ํŠผ ์ˆจ๊น€ + setHasSeeMoreProducts(false); + } + }, [panelInfo, brandShopByShowCategoryGroups]); // ํ—ค๋” Back ์•„์ด์ฝ˜์—์„œ ์•„๋ž˜๋กœ ๋‚ด๋ ค์˜ฌ ๋•Œ ์ฒซ ๋ฒˆ์งธ ๋ฒ„ํŠผ์„ ๋ฐ”๋ผ๋ณด๋„๋ก ์„ค์ • useEffect(() => { const firstId = stackOrder[0]; @@ -1768,7 +1857,7 @@ export default function ProductAllSection({ )} {/* ๐Ÿ†• [251210] patnrId=21์ธ ๊ฒฝ์šฐ SEE MORE PRODUCTS ๋ฒ„ํŠผ */} - {(panelInfo?.patnrId === 21 || panelInfo?.patnrId === "21") && ( + {(panelInfo?.patnrId === 21 || panelInfo?.patnrId === "21") && hasSeeMoreProducts && ( {/* ๐Ÿ†• [251210] patnrId=21์ธ ๊ฒฝ์šฐ SEE MORE PRODUCTS ์„น์…˜ */} - {(panelInfo?.patnrId === 21 || panelInfo?.patnrId === "21") && ( + {(panelInfo?.patnrId === 21 || panelInfo?.patnrId === "21") && hasSeeMoreProducts && (