[상품 상세]

- price 파트너사 붙는쪽에 nbcu일 경우 peacoke | ******* 로 들어오는 부분때문에 변경.
This commit is contained in:
junghoon86.park
2025-12-10 12:53:48 +09:00
parent 39d1b42ec4
commit d545a4de0c

View File

@@ -9,6 +9,12 @@ import usePriceInfo from '../../../../../hooks/usePriceInfo';
import { $L } from '../../../../../utils/helperMethods'; import { $L } from '../../../../../utils/helperMethods';
import css from './ShopByMobilePriceDisplay.module.less'; import css from './ShopByMobilePriceDisplay.module.less';
// 파트너명에서 "Peacock | Shop The Moment" 형식일 때 "Peacock"만 추출
const extractPartnerName = (name) => {
if (!name) return name;
return name.includes(' | ') ? name.split(' | ')[0].trim() : name;
};
export default function ShopByMobilePriceDisplay({ export default function ShopByMobilePriceDisplay({
priceData, priceData,
priceInfo, priceInfo,
@@ -26,6 +32,10 @@ export default function ShopByMobilePriceDisplay({
orderPhnNo, orderPhnNo,
} = priceData; } = priceData;
// 파트너명 정규화
const cleanPatncNm = useMemo(() => extractPartnerName(patncNm), [patncNm]);
const cleanPatnrName = useMemo(() => extractPartnerName(patnrName), [patnrName]);
const { const {
discountRate, discountRate,
rewardFlag, rewardFlag,
@@ -50,6 +60,8 @@ export default function ShopByMobilePriceDisplay({
[isOriginalPriceEmpty, isDiscountedPriceEmpty, price5, offerInfo] [isOriginalPriceEmpty, isDiscountedPriceEmpty, price5, offerInfo]
); );
const renderPriceItem = useCallback(() => { const renderPriceItem = useCallback(() => {
if (priceData && !promotionCode) { if (priceData && !promotionCode) {
if (rewd) { if (rewd) {
@@ -57,9 +69,9 @@ export default function ShopByMobilePriceDisplay({
<div className={css.wrapper}> <div className={css.wrapper}>
<div className={css.rewdTopLayer}> <div className={css.rewdTopLayer}>
<span> <span>
{patncNm {cleanPatncNm
? patncNm + " " + $L("Price") + " " ? cleanPatncNm + " " + $L("Price") + " "
: patnrName + " " + $L("Price") + " "} : cleanPatnrName + " " + $L("Price") + " "}
</span> </span>
<span className={css.partnerPrc}> <span className={css.partnerPrc}>
{TYPE_CASE.case5 || TYPE_CASE.case8 {TYPE_CASE.case5 || TYPE_CASE.case8
@@ -95,9 +107,9 @@ export default function ShopByMobilePriceDisplay({
return ( return (
<div className={css.wrapper}> <div className={css.wrapper}>
<span className={css.name}> <span className={css.name}>
{patncNm {cleanPatncNm
? patncNm + " " + $L("Price") ? cleanPatncNm + " " + $L("Price")
: patnrName + " " + $L("Price")} : cleanPatnrName + " " + $L("Price")}
</span> </span>
<div className={css.btmLayer}> <div className={css.btmLayer}>
<span className={classNames(css.price, css.case01)}> <span className={classNames(css.price, css.case01)}>
@@ -111,9 +123,9 @@ export default function ShopByMobilePriceDisplay({
<div className={css.wrapper}> <div className={css.wrapper}>
<div className={css.topLayer}> <div className={css.topLayer}>
<span className={css.name}> <span className={css.name}>
{patncNm {cleanPatncNm
? patncNm + " " + $L("Price") ? cleanPatncNm + " " + $L("Price")
: patnrName + $L("Price")} : cleanPatnrName + $L("Price")}
</span> </span>
</div> </div>
{discountRate && Number(discountRate.replace("%", "")) > 4 && ( {discountRate && Number(discountRate.replace("%", "")) > 4 && (
@@ -140,9 +152,9 @@ export default function ShopByMobilePriceDisplay({
<div className={css.wrapper}> <div className={css.wrapper}>
<div className={css.topLayer}> <div className={css.topLayer}>
<span className={css.name}> <span className={css.name}>
{patncNm {cleanPatncNm
? patncNm + " " + $L("Price") ? cleanPatncNm + " " + $L("Price")
: patnrName + " " + $L("Price")} : cleanPatnrName + " " + $L("Price")}
</span> </span>
</div> </div>
{discountRate && Number(discountRate.replace("%", "")) > 4 && ( {discountRate && Number(discountRate.replace("%", "")) > 4 && (
@@ -194,7 +206,7 @@ export default function ShopByMobilePriceDisplay({
return ( return (
<div className={css.wrapper}> <div className={css.wrapper}>
<span className={css.partnerName}> <span className={css.partnerName}>
{patncNm ? patncNm + " " + $L("Price") : patnrName + $L("Price")} {cleanPatncNm ? cleanPatncNm + " " + $L("Price") : cleanPatnrName + $L("Price")}
</span> </span>
<span <span
className={css.offerInfo} className={css.offerInfo}
@@ -204,7 +216,8 @@ export default function ShopByMobilePriceDisplay({
); );
} }
}, [ }, [
patnrName, cleanPatnrName,
cleanPatncNm,
priceInfo, priceInfo,
isOriginalPriceEmpty, isOriginalPriceEmpty,
isDiscountedPriceEmpty, isDiscountedPriceEmpty,
@@ -214,4 +227,4 @@ export default function ShopByMobilePriceDisplay({
]); ]);
return <div>{renderPriceItem()}</div>; return <div>{renderPriceItem()}</div>;
} }