[checkout panel]

- 배송정보, 주문정보, 카드정보 없을시 qr팝업 노출되도록 수정.
 - qr팝업 닫혔을때 상품 상세페이지로 이동하도록 처리.
This commit is contained in:
junghoon86.park
2025-12-10 12:39:31 +09:00
parent db7bc4b2ed
commit 53aa879ee5

View File

@@ -20,7 +20,10 @@ import {
setShowPopup,
} from '../../../actions/commonActions';
import { sendLogTotalRecommend } from '../../../actions/logActions';
import { popPanel } from '../../../actions/panelActions';
import {
popPanel,
pushPanel,
} from '../../../actions/panelActions';
import TButton from '../../../components/TButton/TButton';
import TPopUp from '../../../components/TPopUp/TPopUp';
import TQRCode from '../../../components/TQRCode/TQRCode';
@@ -249,13 +252,25 @@ export default function InformationContainer({
);
const handleCancel = useCallback(() => {
dispatch(setHidePopup());
}, [dispatch]);
const handleDone = useCallback(() => {
dispatch(setHidePopup());
// dispatch(setHidePopup());
const { patnrId, prdtId } = checkoutData.productList[0];
dispatch(popPanel());
}, [dispatch]);
dispatch(
pushPanel({
name: Config.panel_names.DETAIL_PANEL,
panelInfo: { patnrId, prdtId },
})
);
}, [dispatch, checkoutData]);
const { shippingAddressList, billingAddressList, cardInfo } = checkoutData || {};
useEffect(() => {
if (!shippingAddressList || !billingAddressList || !cardInfo) {
// if (shippingAddressList || billingAddressList || cardInfo) { //확인용도로 반대로 테스트중.
dispatch(setShowPopup(Config.ACTIVE_POPUP.qrPopup));
}
}, [shippingAddressList, billingAddressList, cardInfo, dispatch])
return (
<>
@@ -282,8 +297,8 @@ export default function InformationContainer({
>
ADD/EDIT
</TButton>
{checkoutData?.shippingAddressList && (
<ShippingAddressCard list={checkoutData.shippingAddressList} onFocus={handleFocus} />
{shippingAddressList && (
<ShippingAddressCard list={shippingAddressList} onFocus={handleFocus} />
)}
</div>
<div className={css.listBox}>
@@ -300,8 +315,8 @@ export default function InformationContainer({
{/* <div style={{ padding: '10px', textAlign: 'center', color: '#999' }}>
Mock Billing Address
</div> */}
{checkoutData?.billingAddressList && (
<BillingAddressCard list={checkoutData.billingAddressList} onFocus={handleFocus} />
{billingAddressList && (
<BillingAddressCard list={billingAddressList} onFocus={handleFocus} />
)}
</div>
<div className={css.listBox}>
@@ -314,7 +329,7 @@ export default function InformationContainer({
>
ADD/EDIT
</TButton>
{checkoutData?.cardInfo && <PaymentCard list={checkoutData.cardInfo} />}
{cardInfo && <PaymentCard list={cardInfo} />}
</div>
<div className={css.listBox}>
<Subject title="OFFERS & PROMOTION" />
@@ -355,7 +370,7 @@ export default function InformationContainer({
'Please update your information and complete the payment on your mobile. By clicking the OK button, you will be redirected to the product details page'
)}
</h3>
<TButton className={css.popupBtn} onClick={handleDone}>
<TButton className={css.popupBtn} onClick={handleCancel}>
{$L('OK')}
</TButton>
</div>