핫픽스 쿠폰관련 확인용V1

This commit is contained in:
junghoon86.park
2024-05-20 14:27:17 +09:00
parent 0df2b14ef1
commit b5c2e566ff

View File

@@ -8,11 +8,19 @@ import Spotlight from "@enact/spotlight";
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
import Spottable from "@enact/spotlight/Spottable";
import { setHidePopup, setShowPopup } from "../../actions/commonActions";
/* test */
// import { getWelcomeEventInfo } from "../../actions/eventActions";
import {
alertToast,
setHidePopup,
setShowPopup,
} from "../../actions/commonActions";
import { getProductCouponDownload } from "../../actions/couponActions";
import { getThemeCurationInfo } from "../../actions/homeActions";
import { resetPanels, updatePanel } from "../../actions/panelActions";
import {
pushPanel,
resetPanels,
updatePanel,
} from "../../actions/panelActions";
import { startVideoPlayer } from "../../actions/playActions";
import MobileSendPopUp from "../../components/MobileSend/MobileSendPopUp";
import TBody from "../../components/TBody/TBody";
import TPanel from "../../components/TPanel/TPanel";
@@ -57,6 +65,9 @@ export default function HotPicksPanel({ panelInfo }) {
const { popupVisible, activePopup } = useSelector(
(state) => state.common.popup
);
const userInfo = useSelector(
(state) => state.common?.appStatus.loginUserData.userInfo
);
const [movingPage, setMovingPage] = useState(false);
const [currentPage, setCurrentPage] = useState(
@@ -201,18 +212,39 @@ export default function HotPicksPanel({ panelInfo }) {
Spotlight.focus("hotpicks-data-spot" + (currentPage * 1 + 1));
}, [dispatch, currentPage]);
// 토스트 메세지
const handlePopupOpen = useCallback(
(patnrId, curationId, evntId, evntTpCd, eventInfoV2) => {
setPopPatnrId(patnrId);
setPopCurationId(curationId);
setPopEvntId(evntId);
setIsCurationEvnt(evntTpCd);
setPopEventInfo(eventInfoV2);
dispatch(setShowPopup(Config.ACTIVE_POPUP.smsPopup));
if (evntTpCd === "EVT00107") {
dispatch(
getProductCouponDownload({
mbrNo: userInfo,
cpnSno: eventInfoV2.billCpnSno,
})
);
dispatch(alertToast($L("Your coupon download is complete.")));
} else {
setPopPatnrId(patnrId);
setPopCurationId(curationId);
setPopEvntId(evntId);
setIsCurationEvnt(evntTpCd);
setPopEventInfo(eventInfoV2);
dispatch(setShowPopup(Config.ACTIVE_POPUP.smsPopup));
}
},
[]
);
// useEffect(
// (evntTpCd) => {
// if (evntTpCd === "EVT00107") {
// if (smsRetCode === 0) {
// }
// }
// },
// [handlePopupOpen, smsRetCode]
// );
const themeCurationType = useCallback(
(
data,
@@ -373,6 +405,92 @@ export default function HotPicksPanel({ panelInfo }) {
}
}, [popupVisible]);
useEffect(() => {
if (smsRetCode === 0) {
const eventInfoV2 = themeCurationInfoData[currentPage]?.eventInfoV2;
if (eventInfoV2) {
switch (eventInfoV2.shptmLnkInfo.shptmLnkTpCd) {
case "EVT00201": //HOME
break;
case "EVT00202": //Featured Brands
dispatch(resetPanels());
dispatch(
pushPanel({
name: Config.panel_names.FEATURED_BRANDS_PANEL,
panelInfo: { patnrId: eventInfoV2.shptmLnkInfo.lnkPatnrId },
})
);
break;
case "EVT00203": //Trending Now
dispatch(resetPanels());
dispatch(
pushPanel({ name: Config.panel_names.TRENDING_NOW_PANEL })
);
break;
case "EVT00204": //Hot Picks
break;
case "EVT00205": //On Sale
dispatch(resetPanels());
dispatch(pushPanel({ name: Config.panel_names.ON_SALE_PANEL }));
break;
case "EVT00206": //Category
dispatch(resetPanels());
dispatch(
pushPanel({
name: Config.panel_names.CATEGORY_PANEL,
panelInfo: {
lgCatCd: eventInfoV2.shptmLnkInfo.lnkLgCatCd,
},
})
);
break;
case "EVT00207": //Product Detail
dispatch(resetPanels());
dispatch(
pushPanel({
name: Config.panel_names.DETAIL_PANEL,
panelInfo: {
patnrId: eventInfoV2.shptmLnkInfo.lnkPatnrId,
prdtId: eventInfoV2.shptmLnkInfo.lnkPrdtId,
},
})
);
break;
case "EVT00208": //VOD
dispatch(resetPanels());
dispatch(
startVideoPlayer({
modal: false,
patnrId: eventInfoV2.shptmLnkInfo.lnkPatnrId,
showId: eventInfoV2.shptmLnkInfo.lnkBrdcId,
shptmBanrTpNm: "VOD",
})
);
break;
case "EVT00209": //Theme Page
dispatch(resetPanels());
dispatch(
pushPanel({
name: Config.panel_names.THEME_CURATION_PANEL,
panelInfo: {
curationId: eventInfoV2.shptmLnkInfo.lnkCurationId,
},
})
);
break;
case "EVT00210": //My Page (My Coupon)
dispatch(
pushPanel({
name: Config.panel_names.MY_PAGE_PANEL,
panelInfo: { menuNm: "My Info", menuOrd: 3 },
})
);
break;
}
}
}
}, [smsRetCode]);
const [oneStart, setOneStart] = useState(false);
const onSpotlightUp = (ev) => {
if (Spotlight.focus()) {
@@ -455,6 +573,7 @@ export default function HotPicksPanel({ panelInfo }) {
patnrId={popPatnrId}
curationId={popCurationId}
evntId={popEvntId}
evntTpCd={themeCurationInfoData[currentPage]?.eventInfoV2?.evntTpCd}
smsTpCd={"APP00212"}
data={themeCurationInfoData[currentPage]}
isCurationEvnt={isCurationEvnt}
@@ -463,37 +582,3 @@ export default function HotPicksPanel({ panelInfo }) {
</TPanel>
);
}
// if (data.eventInfoV2) {
// let billCpnMappProdCntNum = data.eventInfoV2.billCpnMappProdCnt * 1;
// if (billCpnMappProdCntNum === 1) {
// dispatch(setHidePopup());
// dispatch(
// pushPanel({
// name: panel_names.MY_PAGE_PANEL,
// panelInfo: { menuNm: "My Info", menuOrd: 3 },
// })
// );
// } else if (billCpnMappProdCntNum > 1) {
// dispatch(setHidePopup());
// dispatch(
// pushPanel({
// name: panel_names.DETAIL_PANEL,
// panelInfo: {
// patnrId: data.patnrId,
// curationId: data.curationId,
// curationNm: data.curationNm,
// type: "theme",
// },
// })
// );
// }
// }
// APP00201: Shop By Mobile
// APP00202: Overlay Shop By Mobile
// APP00203: Partners SMS Send
// APP00204: General Theme SMS Send
// APP00205: Hotel Theme SMS Send
// APP00206: Main AD SMS Send
// APP00210: Certification Number Send
// APP00211: Main Curation+Prizes Event (EVT00104)
// APP00212: Coupon Only Event (EVT00105)