[EventPopUpBanner]

- click 정보 저장 처리로 인한 사이드 에러 수정작업중
This commit is contained in:
jiwon93.son
2024-06-13 11:29:47 +09:00
parent b9f341e388
commit babde94662
2 changed files with 33 additions and 44 deletions

View File

@@ -56,7 +56,6 @@ export default function MobileSendPopUp({
patnrId, patnrId,
evntId, evntId,
evntTpCd, evntTpCd,
isCurationEvnt,
hotelId, hotelId,
hotelNm, hotelNm,
hotelDtlUrl, hotelDtlUrl,
@@ -284,16 +283,6 @@ export default function MobileSendPopUp({
); );
} }
if (isCurationEvnt) {
// EVT00102 CURATION EVENT : 원하는 페이지로 이동(앱 내 모든 페이지) 미완
dispatch(
setEventIssueReq({
evntTpCd,
evntId,
mbphNo: naturalNumber,
})
);
}
if (deviceInfo && smsTpCd) { if (deviceInfo && smsTpCd) {
let params = { let params = {
dvcIndex: deviceInfo.dvcIndex, dvcIndex: deviceInfo.dvcIndex,
@@ -361,7 +350,7 @@ export default function MobileSendPopUp({
sendLogShopByMobile(params); sendLogShopByMobile(params);
shopByMobileLogRef.current = null; shopByMobileLogRef.current = null;
} }
}, 2000); }, 3000);
return () => clearTimeout(timer); return () => clearTimeout(timer);
} }

View File

@@ -52,22 +52,22 @@ export default function EventPopUpBanner() {
const timerRef = useRef(); const timerRef = useRef();
const shopByMobileLogRef = useRef(null); const shopByMobileLogRef = useRef(null);
const shptmLnkInfo = eventPopInfosData?.shptmLnkInfo;
const evntId = eventPopInfosData?.evntId; const evntId = eventPopInfosData?.evntId;
const patnrId = eventPopInfosData?.patnrId;
const evntTpCd = eventPopInfosData?.evntTpCd; const evntTpCd = eventPopInfosData?.evntTpCd;
const evntNm = eventPopInfosData?.evntNm; const evntNm = eventPopInfosData?.evntNm;
const [smsTpCd, setSmsTpCd] = useState(""); const [smsTpCd, setSmsTpCd] = useState("");
const [eventPopData, setEventPopData] = useState({});
useEffect(() => { useEffect(() => {
if (eventPopInfosData) { if (eventPopInfosData) {
setEventPopData(eventPopInfosData);
dispatch(setShowPopup(ACTIVE_POPUP.eventPopup)); dispatch(setShowPopup(ACTIVE_POPUP.eventPopup));
} }
}, [dispatch, eventPopInfosData]); }, [dispatch, eventPopInfosData]);
const handleApply = useCallback(() => { const handleApply = useCallback(() => {
if (eventPopInfosData) { if (eventPopData) {
dispatch(setEventPopClickInfo({ evntApplcnFlag: "Y", evntId })); dispatch(setEventPopClickInfo({ evntApplcnFlag: "Y", evntId }));
switch (evntTpCd) { switch (evntTpCd) {
@@ -80,8 +80,8 @@ export default function EventPopUpBanner() {
pushPanel({ pushPanel({
name: panel_names.HOT_PICKS_PANEL, name: panel_names.HOT_PICKS_PANEL,
panelInfo: { panelInfo: {
curationId: eventPopInfosData?.curationId, curationId: eventPopData?.curationId,
patnrId: eventPopInfosData?.patnrId, patnrId: eventPopData?.patnrId,
}, },
}) })
); );
@@ -94,18 +94,18 @@ export default function EventPopUpBanner() {
const params = { const params = {
befPrice: "", befPrice: "",
curationId: eventPopInfosData?.curationId ?? "", curationId: eventPopData?.curationId ?? "",
curationNm: eventPopInfosData?.curationNm ?? "", curationNm: eventPopData?.curationNm ?? "",
evntId: eventPopInfosData?.evntId ?? "", evntId: eventPopData?.evntId ?? "",
evntNm: eventPopInfosData?.evntNm ?? "", evntNm: eventPopData?.evntNm ?? "",
lastPrice: "", lastPrice: "",
lgCatCd: "", lgCatCd: "",
lgCatNm: "", lgCatNm: "",
liveFlag: "N", liveFlag: "N",
logTpNo: LOG_TP_NO.SHOP_BY_MOBILE.SHOP_BY_MOBILE, logTpNo: LOG_TP_NO.SHOP_BY_MOBILE.SHOP_BY_MOBILE,
mbphNoFlag: "N", mbphNoFlag: "N",
patncNm: eventPopInfosData?.patncNm, patncNm: eventPopData?.patncNm,
patnrId: eventPopInfosData?.patnrId, patnrId: eventPopData?.patnrId,
prdtId: "", prdtId: "",
prdtNm: "", prdtNm: "",
revwGrd: "", revwGrd: "",
@@ -130,7 +130,7 @@ export default function EventPopUpBanner() {
dispatch( dispatch(
getProductCouponDownload({ getProductCouponDownload({
mbrNo: userNumber, mbrNo: userNumber,
cpnSno: eventPopInfosData?.billCpnSno, cpnSno: eventPopData?.billCpnSno,
}) })
); );
} }
@@ -138,17 +138,17 @@ export default function EventPopUpBanner() {
} }
} }
} }
}, [eventPopInfosData, userNumber, dispatch]); }, [eventPopData, userNumber, dispatch]);
useEffect(() => { useEffect(() => {
if (couponDownloadSuccess === 0) { if (couponDownloadSuccess === 0) {
dispatch(alertToast($L("Downloading coupon complete."))); dispatch(alertToast($L("Downloading coupon complete.")));
if (shptmLnkInfo?.shptmLnkTpCd) { if (eventPopData && eventPopData?.shptmLnkInfo?.shptmLnkTpCd) {
dispatch(setHidePopup()); dispatch(setHidePopup());
navigateToLinkByTypeCode(); navigateToLinkByTypeCode();
} }
} }
}, [couponDownloadSuccess, shptmLnkInfo]); }, [couponDownloadSuccess, eventPopData]);
useEffect(() => { useEffect(() => {
if (smsSuccess === 0) { if (smsSuccess === 0) {
@@ -183,15 +183,16 @@ export default function EventPopUpBanner() {
const navigateToLinkByTypeCode = useCallback(() => { const navigateToLinkByTypeCode = useCallback(() => {
dispatch(setHidePopup()); dispatch(setHidePopup());
if (shptmLnkInfo) {
switch (shptmLnkInfo.shptmLnkTpCd) { if (eventPopData && eventPopData.shptmLnkInfo) {
switch (eventPopData.shptmLnkInfo.shptmLnkTpCd) {
case "EVT00201": case "EVT00201":
break; break;
case "EVT00202": case "EVT00202":
dispatch( dispatch(
pushPanel({ pushPanel({
name: panel_names.FEATURED_BRANDS_PANEL, name: panel_names.FEATURED_BRANDS_PANEL,
panelInfo: { patnrId: shptmLnkInfo?.lnkPatnrId }, panelInfo: { patnrId: eventPopData.shptmLnkInfo?.lnkPatnrId },
}) })
); );
break; break;
@@ -202,8 +203,8 @@ export default function EventPopUpBanner() {
pushPanel({ pushPanel({
name: panel_names.HOT_PICKS_PANEL, name: panel_names.HOT_PICKS_PANEL,
panelInfo: { panelInfo: {
curationId: shptmLnkInfo?.lnkCurationId, curationId: eventPopData.shptmLnkInfo?.lnkCurationId,
patnrId: shptmLnkInfo?.lnkPatnrId, patnrId: eventPopData.shptmLnkInfo?.lnkPatnrId,
}, },
}); });
break; break;
@@ -211,7 +212,7 @@ export default function EventPopUpBanner() {
dispatch( dispatch(
pushPanel({ pushPanel({
name: panel_names.ON_SALE_PANEL, name: panel_names.ON_SALE_PANEL,
panelInfo: { lgCatCd: shptmLnkInfo?.lnkLgCatCd }, panelInfo: { lgCatCd: eventPopData.shptmLnkInfo?.lnkLgCatCd },
}) })
); );
break; break;
@@ -220,7 +221,7 @@ export default function EventPopUpBanner() {
pushPanel({ pushPanel({
name: panel_names.CATEGORY_PANEL, name: panel_names.CATEGORY_PANEL,
panelInfo: { panelInfo: {
lgCatCd: shptmLnkInfo?.lnkLgCatCd, lgCatCd: eventPopData.shptmLnkInfo?.lnkLgCatCd,
}, },
}) })
); );
@@ -230,8 +231,8 @@ export default function EventPopUpBanner() {
pushPanel({ pushPanel({
name: panel_names.DETAIL_PANEL, name: panel_names.DETAIL_PANEL,
panelInfo: { panelInfo: {
patnrId: shptmLnkInfo?.lnkPatnrId, patnrId: eventPopData.shptmLnkInfo?.lnkPatnrId,
prdtId: shptmLnkInfo?.lnkPrdtId, prdtId: eventPopData.shptmLnkInfo?.lnkPrdtId,
}, },
}) })
); );
@@ -240,8 +241,8 @@ export default function EventPopUpBanner() {
dispatch( dispatch(
startVideoPlayer({ startVideoPlayer({
modal: false, modal: false,
patnrId: shptmLnkInfo?.lnkPatnrId, patnrId: eventPopData.shptmLnkInfo?.lnkPatnrId,
showId: shptmLnkInfo?.lnkBrdcId, showId: eventPopData.shptmLnkInfo?.lnkBrdcId,
shptmBanrTpNm: "VOD", shptmBanrTpNm: "VOD",
}) })
); );
@@ -251,7 +252,7 @@ export default function EventPopUpBanner() {
pushPanel({ pushPanel({
name: panel_names.THEME_CURATION_PANEL, name: panel_names.THEME_CURATION_PANEL,
panelInfo: { panelInfo: {
curationId: shptmLnkInfo?.lnkCurationId, curationId: eventPopData.shptmLnkInfo?.lnkCurationId,
}, },
}) })
); );
@@ -267,7 +268,7 @@ export default function EventPopUpBanner() {
} }
} }
return; return;
}, [shptmLnkInfo, dispatch]); }, [eventPopData.shptmLnkInfo, dispatch]);
useEffect(() => { useEffect(() => {
return () => { return () => {
@@ -296,7 +297,7 @@ export default function EventPopUpBanner() {
)} )}
</TPopUp> </TPopUp>
)} )}
{activePopup === ACTIVE_POPUP.smsPopup && ( {eventPopData && activePopup === ACTIVE_POPUP.smsPopup && (
<MobileSendPopUp <MobileSendPopUp
open={popupVisible} open={popupVisible}
onClose={onClose} onClose={onClose}
@@ -305,9 +306,8 @@ export default function EventPopUpBanner() {
"Enter your mobile number to receive detailed information via SMS" "Enter your mobile number to receive detailed information via SMS"
)} )}
smsTpCd={smsTpCd} smsTpCd={smsTpCd}
evntId={evntId} evntId={eventPopData.evntId}
patnrId={patnrId} patnrId={eventPopData.patnrId}
isCurationEvnt={evntTpCd === "EVT00102"}
shopByMobileLogRef={shopByMobileLogRef} shopByMobileLogRef={shopByMobileLogRef}
/> />
)} )}