From 1a3d1bb77c9e625504e951dda41eb6b3d943742f Mon Sep 17 00:00:00 2001 From: "junghoon86.park" Date: Thu, 6 Nov 2025 16:01:24 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=9E=A5=EB=B0=94=EA=B5=AC=EB=8B=88]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 포커스 관련 추가수정 --- .../src/views/CartPanel/CartPanel.jsx | 6 +- .../src/views/CartPanel/CartProduct.jsx | 318 +++++++++--------- .../src/views/CartPanel/CartProductBar.jsx | 9 +- 3 files changed, 165 insertions(+), 168 deletions(-) diff --git a/com.twin.app.shoptime/src/views/CartPanel/CartPanel.jsx b/com.twin.app.shoptime/src/views/CartPanel/CartPanel.jsx index af71f53a..ef78a4c1 100644 --- a/com.twin.app.shoptime/src/views/CartPanel/CartPanel.jsx +++ b/com.twin.app.shoptime/src/views/CartPanel/CartPanel.jsx @@ -167,7 +167,7 @@ export default function CartPanel({ spotlightId, scrollOptions = [], panelInfo } return ( - + -
+
{/* 오른쪽 상품 영역 */} {displayCartData && displayCartData?.length > 0 ? ( diff --git a/com.twin.app.shoptime/src/views/CartPanel/CartProduct.jsx b/com.twin.app.shoptime/src/views/CartPanel/CartProduct.jsx index d1a40beb..299e3195 100644 --- a/com.twin.app.shoptime/src/views/CartPanel/CartProduct.jsx +++ b/com.twin.app.shoptime/src/views/CartPanel/CartProduct.jsx @@ -14,7 +14,6 @@ import { import Spotlight from '@enact/spotlight'; import SpotlightContainerDecorator from '@enact/spotlight/SpotlightContainerDecorator'; -import Spottable from '@enact/spotlight/Spottable'; import logoImage from '../../../assets/images/ic-partners-qvc@3x.png'; import defaultImage from '../../../assets/images/img-thumb-empty-144@3x.png'; @@ -30,7 +29,6 @@ import { import CustomImage from '../../components/CustomImage/CustomImage'; import TButton from '../../components/TButton/TButton'; import TCheckBoxSquare from '../../components/TCheckBox/TCheckBoxSquare'; -import useScrollTo from '../../hooks/useScrollTo'; import store from '../../store/store'; import { BUYNOW_CONFIG } from '../../utils/BuyNowConfig'; import { @@ -93,9 +91,7 @@ const OptimizedImage = ({ src, alt, className, fallbackSrc }) => { }; const Container = SpotlightContainerDecorator("div"); - -const CartProduct = ({ cartInfo, getScrollTo, scrollTop }) => { - +const CartProduct = ({ cartInfo, getScrollTo, scrollTop }) => { const dispatch = useDispatch(); // 항상 호출되어야 하는 Hook들 @@ -268,182 +264,180 @@ const CartProduct = ({ cartInfo, getScrollTo, scrollTop }) => { [scrollTop] ); - return ( <> - {Object.entries(groupedCartData).map(([partnerKey, group],index) => { + {Object.entries(groupedCartData).map(([partnerKey, group], index) => { const totals = calculatePartnerTotal(group.items); - return ( - - {index === 0 && ( + return ( + + {index === 0 && (
- )} -
- {/* 파트너사 정보 - 한 번만 표시 */} -
-
- -
- - {group.partnerInfo.name} - - ({group.items.length} ITEM{group.items.length > 1 ? 'S' : ''}) - + )} +
+ {/* 파트너사 정보 - 한 번만 표시 */} +
+
+ +
+ + {group.partnerInfo.name} + + ({group.items.length} ITEM{group.items.length > 1 ? 'S' : ''}) + + +
+ + {/* 파트너사별 가격 총합 - 한 번만 표시 */} +
+
+ Product Total ${totals.productTotal.toLocaleString('en-US', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} + + + {/* Option ${totals.optionTotal.toLocaleString('en-US', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} + */} + Option $0.00 + + S&H ${totals.shippingTotal.toLocaleString('en-US', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} +
+
+ Total + + $ + {totals.total.toLocaleString('en-US', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} -
+ +
+
- {/* 파트너사별 가격 총합 - 한 번만 표시 */} -
-
- Product Total ${totals.productTotal.toLocaleString('en-US', { - minimumFractionDigits: 2, - maximumFractionDigits: 2 - })} + - - {/* Option ${totals.optionTotal.toLocaleString('en-US', { - minimumFractionDigits: 2, - maximumFractionDigits: 2 - })} + */} - Option $0.00 + - S&H ${totals.shippingTotal.toLocaleString('en-US', { - minimumFractionDigits: 2, - maximumFractionDigits: 2 - })} -
-
- Total - - $ - {totals.total.toLocaleString('en-US', { - minimumFractionDigits: 2, - maximumFractionDigits: 2 - })} - + {/* 해당 파트너사의 상품 리스트 - map으로 반복 */} + {group.items.map((item, groupIndex) => { + // CheckOutPanel과 동일한 이미지 처리 방식 적용 + const normalizedItem = normalizeProductDataForDisplay(item); + + // ✅ 이미지 우선순위: ProductAllSection 고품질 이미지 → 기타 모든 이미지 필드 + const imageSrc = (item.imgUrls600 && item.imgUrls600[0]) || // ✅ ProductAllSection의 고품질 이미지 + (item.thumbnailUrl960) || // ✅ 960px 썸네일 + (normalizedItem.imgUrls && normalizedItem.imgUrls[0]?.imgUrl) || + (item.imgUrls && item.imgUrls[0]?.imgUrl) || + (item.imgList && item.imgList[0]?.imgUrl) || + normalizedItem.imgUrl || + item.imgUrl || + item.thumbnailUrl || + defaultImage; + + return ( +
+
+
+ {handleFocus(index, groupIndex)}} + /> + + ID : {item.prdtId}
-
- - {/* 해당 파트너사의 상품 리스트 - map으로 반복 */} - {group.items.map((item, groupIndex) => { - // CheckOutPanel과 동일한 이미지 처리 방식 적용 - const normalizedItem = normalizeProductDataForDisplay(item); - - // ✅ 이미지 우선순위: ProductAllSection 고품질 이미지 → 기타 모든 이미지 필드 - const imageSrc = (item.imgUrls600 && item.imgUrls600[0]) || // ✅ ProductAllSection의 고품질 이미지 - (item.thumbnailUrl960) || // ✅ 960px 썸네일 - (normalizedItem.imgUrls && normalizedItem.imgUrls[0]?.imgUrl) || - (item.imgUrls && item.imgUrls[0]?.imgUrl) || - (item.imgList && item.imgList[0]?.imgUrl) || - normalizedItem.imgUrl || - item.imgUrl || - item.thumbnailUrl || - defaultImage; - - return ( -
-
-
- {handleFocus(index, groupIndex)}} - /> - - ID : {item.prdtId} - +
+
+ +
+
+
+ {item.prdtNm}
-
-
- -
-
-
- {item.prdtNm} -
- {item.optNm && ( -
{item.optNm}
- )} -
- - ${parseFloat(item.price3 || item.price2 || 0).toLocaleString('en-US', { + {item.optNm && ( +
{item.optNm}
+ )} +
+ + ${parseFloat(item.price3 || item.price2 || 0).toLocaleString('en-US', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} + +
+ {item.price2 && ( + + ${parseFloat(item.price2).toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })} -
- {item.price2 && ( - - ${parseFloat(item.price2).toLocaleString('en-US', { - minimumFractionDigits: 2, - maximumFractionDigits: 2 - })} - - )} - {item.price5 && parseFloat(item.price5) > 0 && ( - - OPTION : ${parseFloat(item.price5).toLocaleString('en-US', { - minimumFractionDigits: 2, - maximumFractionDigits: 2 - })} - - )} - {item.shippingCharge && parseFloat(item.shippingCharge) > 0 && ( - - S&H: ${parseFloat(item.shippingCharge).toLocaleString('en-US', { - minimumFractionDigits: 2, - maximumFractionDigits: 2 - })} - - )} -
-
-
- handleDecreseClick(item.prodSno, item.prodQty)} - spotlightId={"pd_ea_decrese"} - spotlightDisabled={item.prodQty === 1} - /> -
{item.prodQty}
- handleIncreseClick(item.prodSno, item.prodQty)} - className={css.plusBox} - spotlightId={"pd_ea_increse"} - size="cartEa" - /> -
+ )} + {item.price5 && parseFloat(item.price5) > 0 && ( + + OPTION : ${parseFloat(item.price5).toLocaleString('en-US', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} + + )} + {item.shippingCharge && parseFloat(item.shippingCharge) > 0 && ( + + S&H: ${parseFloat(item.shippingCharge).toLocaleString('en-US', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} + + )}
-
-
- handleDeleteClick(item.prodSno)} - /> +
+ handleDecreseClick(item.prodSno, item.prodQty)} + spotlightId={"pd_ea_decrese"} + spotlightDisabled={item.prodQty === 1} + /> +
{item.prodQty}
+ handleIncreseClick(item.prodSno, item.prodQty)} + className={css.plusBox} + spotlightId={"pd_ea_increse"} + size="cartEa" + /> +
- ); - })} +
+
+ handleDeleteClick(item.prodSno)} + /> +
- - + ); + })} +
+ ); })} diff --git a/com.twin.app.shoptime/src/views/CartPanel/CartProductBar.jsx b/com.twin.app.shoptime/src/views/CartPanel/CartProductBar.jsx index 003a6ac8..82b04741 100644 --- a/com.twin.app.shoptime/src/views/CartPanel/CartProductBar.jsx +++ b/com.twin.app.shoptime/src/views/CartPanel/CartProductBar.jsx @@ -6,11 +6,14 @@ import SpotlightContainerDecorator import CartProduct from './CartProduct'; import css from './CartProductBar.module.less'; -const CartProductBar = ({ cartInfo, getScrollTo, scrollTop ,scrollOptions = {} }) => { - const Container = SpotlightContainerDecorator("div"); +const CartProductBar = ({ cartInfo, getScrollTo, scrollTop ,scrollOptions = {} }) => { + const Container = SpotlightContainerDecorator({ + enterTo: "last-focused" + },"div"); + return ( - + ); };