[SHOPTIME-3553] 구매불가상품 price 원복
This commit is contained in:
@@ -46,7 +46,7 @@ export default function usePriceInfo(priceInfo) {
|
|||||||
);
|
);
|
||||||
let discountRateNumeric = parseFloat(discountRate.replace("%", ""));
|
let discountRateNumeric = parseFloat(discountRate.replace("%", ""));
|
||||||
|
|
||||||
if (originalPriceNum === 0 || discountedPriceNum >= originalPriceNum) {
|
if (discountedPriceNum >= originalPriceNum) {
|
||||||
originalPrice = discountedPrice;
|
originalPrice = discountedPrice;
|
||||||
discountRateNumeric = null;
|
discountRateNumeric = null;
|
||||||
discountRate = null;
|
discountRate = null;
|
||||||
|
|||||||
@@ -68,8 +68,13 @@ export default function UnableOption({
|
|||||||
"popupVisible",
|
"popupVisible",
|
||||||
(state) => state.common.popup?.popupVisible
|
(state) => state.common.popup?.popupVisible
|
||||||
);
|
);
|
||||||
|
|
||||||
const TYPE_CASE = {
|
const TYPE_CASE = {
|
||||||
// (기획서참고) 상품 상세 가격 노출 유형
|
// (기획서참고) 상품 상세 가격 노출 유형
|
||||||
|
|
||||||
|
// price2 : 할인전 금액
|
||||||
|
// price3 : 할인후 금액
|
||||||
|
// price5 : 할부 금액
|
||||||
case1: price2 && !price3 && !price5,
|
case1: price2 && !price3 && !price5,
|
||||||
case2: price2 && price3 && !price5,
|
case2: price2 && price3 && !price5,
|
||||||
case3: price2 && price3 && price5,
|
case3: price2 && price3 && price5,
|
||||||
@@ -151,16 +156,25 @@ export default function UnableOption({
|
|||||||
: patnrName + " " + $L("Price") + " "}
|
: patnrName + " " + $L("Price") + " "}
|
||||||
</span>
|
</span>
|
||||||
<span className={css.partnerPrc}>
|
<span className={css.partnerPrc}>
|
||||||
{originalPrice !== discountedPrice
|
{TYPE_CASE.case5 || TYPE_CASE.case8
|
||||||
? originalPrice
|
? parseFloat(originalPrice.replace(/[^0-9.-]+/g, "")) === 0
|
||||||
: discountedPrice}
|
? offerInfo
|
||||||
|
: price2
|
||||||
|
: price3}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={css.rewdBtmLayer}>
|
<div className={css.rewdBtmLayer}>
|
||||||
<span className={css.rewdNm}>{$L("Shop Time Price")}</span>
|
<span className={css.rewdNm}>{$L("Shop Time Price")}</span>
|
||||||
<div className={css.btmPrc}>
|
<div className={css.btmPrc}>
|
||||||
<span className={css.rewdRate}>{discountedPrice}</span>
|
{/* TODO : rewd data*/}
|
||||||
{discountRate && discountAmount && (
|
{/* 분할금액 조건문처리 케이스별로 */}
|
||||||
|
|
||||||
|
<span className={css.rewdRate}>{discountedPrice} </span>
|
||||||
|
{/* 리워드 금액 */}
|
||||||
|
{(TYPE_CASE.case7 ||
|
||||||
|
TYPE_CASE.case5 ||
|
||||||
|
TYPE_CASE.case6 ||
|
||||||
|
TYPE_CASE.case8) && (
|
||||||
<span className={css.rewdPrc}>
|
<span className={css.rewdPrc}>
|
||||||
{$L("Save") + discountAmount + discountRate}
|
{$L("Save") + discountAmount + discountRate}
|
||||||
</span>
|
</span>
|
||||||
@@ -170,7 +184,6 @@ export default function UnableOption({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// case1 또는 case4
|
|
||||||
if (TYPE_CASE.case1 || TYPE_CASE.case4) {
|
if (TYPE_CASE.case1 || TYPE_CASE.case4) {
|
||||||
return (
|
return (
|
||||||
<div className={css.wrapper}>
|
<div className={css.wrapper}>
|
||||||
@@ -181,16 +194,15 @@ export default function UnableOption({
|
|||||||
</span>
|
</span>
|
||||||
<div className={css.btmLayer}>
|
<div className={css.btmLayer}>
|
||||||
<span className={classNames(css.price, css.case01)}>
|
<span className={classNames(css.price, css.case01)}>
|
||||||
{originalPrice !== discountedPrice
|
{parseFloat(originalPrice.replace(/[^0-9.-]+/g, "")) === 0
|
||||||
? originalPrice
|
? offerInfo
|
||||||
: discountedPrice}
|
: price2}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// case2
|
|
||||||
if (TYPE_CASE.case2) {
|
if (TYPE_CASE.case2) {
|
||||||
return (
|
return (
|
||||||
<div className={css.wrapper}>
|
<div className={css.wrapper}>
|
||||||
@@ -205,16 +217,18 @@ export default function UnableOption({
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={css.btmLayer}>
|
<div className={css.btmLayer}>
|
||||||
<span className={css.price}>{discountedPrice}</span>
|
<span className={css.price}>{price3}</span>
|
||||||
{originalPrice !== discountedPrice && (
|
<span className={css.discountedPrc}>
|
||||||
<span className={css.discountedPrc}>{originalPrice}</span>
|
{originalPrice &&
|
||||||
)}
|
parseFloat(originalPrice.replace(/[^0-9.-]+/g, "")) === 0
|
||||||
|
? offerInfo
|
||||||
|
: price2}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// case3
|
|
||||||
if (TYPE_CASE.case3) {
|
if (TYPE_CASE.case3) {
|
||||||
return (
|
return (
|
||||||
<div className={css.wrapper}>
|
<div className={css.wrapper}>
|
||||||
@@ -227,11 +241,14 @@ export default function UnableOption({
|
|||||||
{discountRate && Number(discountRate.replace("%", "")) > 4 && (
|
{discountRate && Number(discountRate.replace("%", "")) > 4 && (
|
||||||
<div className={css.rateTag}>{discountRate}</div>
|
<div className={css.rateTag}>{discountRate}</div>
|
||||||
)}
|
)}
|
||||||
<span className={css.price}>{discountedPrice}</span>
|
<span className={css.price}>{price3}</span>
|
||||||
{originalPrice !== discountedPrice && (
|
<span className={css.discountedPrc}>
|
||||||
<span className={css.discountedPrc}>{originalPrice}</span>
|
{parseFloat(originalPrice.replace(/[^0-9.-]+/g, "")) === 0
|
||||||
)}
|
? offerInfo
|
||||||
|
: price2}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
{/* 할부 */}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -257,23 +274,18 @@ export default function UnableOption({
|
|||||||
</div>
|
</div>
|
||||||
<div className={css.btmLayer}>
|
<div className={css.btmLayer}>
|
||||||
<span className={css.price}>{discountedPrice}</span>
|
<span className={css.price}>{discountedPrice}</span>
|
||||||
{originalPrice !== discountedPrice && (
|
<span className={css.discountedPrc}>
|
||||||
<span className={css.discountedPrc}>{originalPrice}</span>
|
{originalPrice &&
|
||||||
)}
|
parseFloat(originalPrice.replace(/[^0-9.-]+/g, "")) === 0
|
||||||
|
? offerInfo
|
||||||
|
: price2}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [
|
}, [patnrName, productInfo]);
|
||||||
patnrName,
|
|
||||||
productInfo,
|
|
||||||
originalPrice,
|
|
||||||
discountedPrice,
|
|
||||||
discountRate,
|
|
||||||
discountAmount,
|
|
||||||
promotionCode,
|
|
||||||
]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={css.priceContainer}>
|
<div className={css.priceContainer}>
|
||||||
|
|||||||
Reference in New Issue
Block a user