yomaylike 요청 수정

This commit is contained in:
Dev TWIN0906
2025-05-12 14:35:38 +09:00
parent e2b45bc08b
commit 84bc71f5b0
7 changed files with 95 additions and 40 deletions

View File

@@ -1,3 +1,4 @@
import { URLS } from "../api/apiConfig"; import { URLS } from "../api/apiConfig";
import { TAxios } from "../api/TAxios"; import { TAxios } from "../api/TAxios";
import { convertUtcToLocal } from "../components/MediaPlayer/util"; import { convertUtcToLocal } from "../components/MediaPlayer/util";
@@ -9,8 +10,12 @@ import {
changeAppStatus, changeAppStatus,
deleteReservation, deleteReservation,
} from "./commonActions"; } from "./commonActions";
import { sendLogTotalRecommend } from "./logActions";
export const getMainLiveShow = (props) => (dispatch, getState) => { export const getMainLiveShow = (props) => (dispatch, getState) => {
const onSuccess = (response) => { const onSuccess = (response) => {
console.log("@@ getMainLiveShow onSuccess", response.data); console.log("@@ getMainLiveShow onSuccess", response.data);
@@ -114,7 +119,7 @@ export const getMainCategoryDetail = (props) => (dispatch, getState) => {
const onSuccess = (response) => { const onSuccess = (response) => {
console.log("getMainCategoryDetail onSuccess ", response.data); console.log("getMainCategoryDetail onSuccess ", response.data);
dispatch({ dispatch({
type: types.GET_PRODUCT_DETAIL, type: types.GET_PRODUCT_DETAIL,
payload: response.data.data, payload: response.data.data,
@@ -144,8 +149,20 @@ export const getMainCategoryDetail = (props) => (dispatch, getState) => {
export const getMainCategoryShowDetail = (props) => (dispatch, getState) => { export const getMainCategoryShowDetail = (props) => (dispatch, getState) => {
const { patnrId, showId, curationId } = props; const { patnrId, showId, curationId } = props;
const onSuccess = (response) => { const onSuccess = (response) => {
console.log("getMainCategoryShowDetail onSuccess ", response.data);
console.log("getMainCategoryShowDetail onSuccess ", response.data);
console.log("#메인카테고리쇼 영상시청", props);
const showInfos = response.data.data.showInfos;
dispatch(sendLogTotalRecommend({
visible: 'true',
showType: "",
player: "",
contentId:showId,
contentTitle:showInfos[0].showNm,
partner:showInfos[0].patncNm,
brand:showInfos[0].productInfos[0]?.brandNm,
category:showInfos[0].showCatNm,
}))
dispatch({ dispatch({
type: types.GET_MAIN_CATEGORY_SHOW_DETAIL, type: types.GET_MAIN_CATEGORY_SHOW_DETAIL,
payload: response.data.data, payload: response.data.data,
@@ -386,8 +403,8 @@ export const getHomeFullVideoInfo =
({ lgCatCd }) => ({ lgCatCd }) =>
(dispatch, getState) => { (dispatch, getState) => {
const onSuccess = (response) => { const onSuccess = (response) => {
console.log("getHomeFullVideoInfo onSuccess", response.data); console.log("getHomeFullVideoInfo onSuccess", response.data.data.showInfos);
console.log("#홈풀비디오 영상시청");
dispatch({ dispatch({
type: types.GET_HOME_FULL_VIDEO_INFO, type: types.GET_HOME_FULL_VIDEO_INFO,
payload: { data: response.data.data, lgCatCd }, payload: { data: response.data.data, lgCatCd },
@@ -416,7 +433,7 @@ export const getMainLiveShowNowProduct =
(dispatch, getState) => { (dispatch, getState) => {
const onSuccess = (response) => { const onSuccess = (response) => {
console.log("getMainLiveShowNowProduct onSuccess", response.data); console.log("getMainLiveShowNowProduct onSuccess", response.data);
console.log("#메인라이브쇼 영상시청");
dispatch({ dispatch({
type: types.GET_MAIN_LIVE_SHOW_NOW_PRODUCT, type: types.GET_MAIN_LIVE_SHOW_NOW_PRODUCT,
payload: response.data.data, payload: response.data.data,
@@ -438,6 +455,11 @@ export const getMainLiveShowNowProduct =
onFail onFail
); );
}; };
export const clearShopNowInfo = () => ({
type: types.CLEAR_SHOPNOW_INFO, export const clearShopNowInfo = () => {
}); console.log("#영상시청 종료");
return {
type: types.CLEAR_SHOPNOW_INFO,
};
};

View File

@@ -584,9 +584,14 @@ export const ERROR_MESSAGES_GROUPS = [
export const LOG_CONTEXT_NAME = { export const LOG_CONTEXT_NAME = {
HOME: "shoptime.home", HOME: "shoptime.home",
CHECKOUT: "shoptime.checkout",
PINCODE: "shoptime.pincode",
YOUMAYLIKE: "shoptime.youmayalsolike",
}; };
export const LOG_MESSAGE_ID = { export const LOG_MESSAGE_ID = {
HOME: "AL_HOME_SHOWN", HOME: "AL_HOME_SHOWN",
BANNER: "AL_BANNER_SHOWN", BANNER: "AL_BANNER_SHOWN",
PINCODE: "AL_PINCODE_BUTTON",
CONTENTCLICK: "AL_PAGE_CONTENT_CLICK",
}; };

View File

@@ -203,7 +203,9 @@ export default function CheckOutPanel({ panelInfo }) {
dispatch(sendLogCheckOutBtnClick({ btnNm: "ORDER ITEMS" })); dispatch(sendLogCheckOutBtnClick({ btnNm: "ORDER ITEMS" }));
dispatch(sendLogTotalRecommend({ dispatch(sendLogTotalRecommend({
buttonTitle: "ORDER ITEMS", buttonTitle: "ORDER ITEMS",
buttonId: "checkout_order_items_view" buttonId: "checkout_order_items_view",
contextName: Config.LOG_CONTEXT_NAME.CHECKOUT,
messageId: Config.LOG_MESSAGE_ID.PINCODE
})); }));
console.log('oder items') console.log('oder items')
} }
@@ -217,7 +219,9 @@ export default function CheckOutPanel({ panelInfo }) {
dispatch(sendLogCheckOutBtnClick({ btnNm: "OFFERS & PROMOTION" })); dispatch(sendLogCheckOutBtnClick({ btnNm: "OFFERS & PROMOTION" }));
dispatch(sendLogTotalRecommend({ dispatch(sendLogTotalRecommend({
buttonTitle: "OFFERS & PROMOTION", buttonTitle: "OFFERS & PROMOTION",
buttonId: "checkout_offers_promotion_view" buttonId: "checkout_offers_promotion_view",
contextName: Config.LOG_CONTEXT_NAME.CHECKOUT,
messageId: Config.LOG_MESSAGE_ID.PINCODE
})); }));
} }
@@ -248,7 +252,9 @@ export default function CheckOutPanel({ panelInfo }) {
dispatch(sendLogTotalRecommend({ dispatch(sendLogTotalRecommend({
buttonTitle: selectedTerms.termsTypeName, buttonTitle: selectedTerms.termsTypeName,
buttonId: `checkout_terms_${selectedTerms.termsTypeName.toLowerCase().replace(/\s+/g, '_')}` buttonId: `checkout_terms_${selectedTerms.termsTypeName.toLowerCase().replace(/\s+/g, '_')}`,
contextName: Config.LOG_CONTEXT_NAME.CHECKOUT,
messageId: Config.LOG_MESSAGE_ID.PINCODE
})) }))
setCurrentTerms(selectedTerms); setCurrentTerms(selectedTerms);
dispatch(setShowPopup(Config.ACTIVE_POPUP.termsPopup)); dispatch(setShowPopup(Config.ACTIVE_POPUP.termsPopup));

View File

@@ -170,7 +170,11 @@ export default function PinCodeInput({
const onClickForgetPinCode = useCallback(() => { const onClickForgetPinCode = useCallback(() => {
setPin(["", "", "", ""]); setPin(["", "", "", ""]);
dispatch(sendLogTotalRecommend({buttonTitle:"ForgetPINcode"})) dispatch(sendLogTotalRecommend({
buttonTitle:"ForgetPINcode",
contextName:Config.LOG_CONTEXT_NAME.PINCODE,
messageId: Config.LOG_MESSAGE_ID.PINCODE
}))
dispatch(setShowPopup(Config.ACTIVE_POPUP.qrPopup2)); dispatch(setShowPopup(Config.ACTIVE_POPUP.qrPopup2));
}, [dispatch]); }, [dispatch]);
@@ -179,7 +183,11 @@ export default function PinCodeInput({
setErrorMsg($L("Please enter a PIN CODE.")); setErrorMsg($L("Please enter a PIN CODE."));
return; return;
} }
dispatch(sendLogTotalRecommend({buttonTitle:"OK"})) dispatch(sendLogTotalRecommend({
buttonTitle:"OK",
contextName:Config.LOG_CONTEXT_NAME.PINCODE,
messageId: Config.LOG_MESSAGE_ID.PINCODE
}))
setOkClicked(true); setOkClicked(true);
const pinString = pin.join(""); const pinString = pin.join("");

View File

@@ -146,7 +146,9 @@ export default function InformationContainer({
dispatch(setShowPopup(Config.ACTIVE_POPUP.qrPopup)); dispatch(setShowPopup(Config.ACTIVE_POPUP.qrPopup));
dispatch(sendLogTotalRecommend({ dispatch(sendLogTotalRecommend({
buttonTitle: `${btnNm} ADD/EDIT`, buttonTitle: `${btnNm} ADD/EDIT`,
buttonId: `checkout_info_${btnNm.toLowerCase().replace(/\s+/g, '_')}` buttonId: `checkout_info_${btnNm.toLowerCase().replace(/\s+/g, '_')}`,
contextName:Config.LOG_CONTEXT_NAME.CHECKOUT,
messageId: Config.LOG_MESSAGE_ID.PINCODE
})) }))
}, },

View File

@@ -105,7 +105,9 @@ export default function SummaryContainer({
} }
dispatch(sendLogTotalRecommend({ dispatch(sendLogTotalRecommend({
buttonTitle: "PLACE ORDER", buttonTitle: "PLACE ORDER",
buttonId: "checkout_place_order_view" buttonId: "checkout_place_order_view",
contextName: Config.LOG_CONTEXT_NAME.CHECKOUT,
messageId: Config.LOG_MESSAGE_ID.PINCODE
})) }))
setPlaceOrderPopup(true); setPlaceOrderPopup(true);

View File

@@ -28,6 +28,8 @@ import { $L } from "../../../utils/helperMethods";
import { SpotlightIds } from "../../../utils/SpotlightIds"; import { SpotlightIds } from "../../../utils/SpotlightIds";
import css from "./YouMayLike.module.less"; import css from "./YouMayLike.module.less";
import { sendLogTotalRecommend } from "../../../actions/logActions"; import { sendLogTotalRecommend } from "../../../actions/logActions";
import * as Config from "../../../utils/Config";
import usePriceInfo from "../../../hooks/usePriceInfo";
const Container = SpotlightContainerDecorator( const Container = SpotlightContainerDecorator(
{ enterTo: "default-element" }, { enterTo: "default-element" },
@@ -55,6 +57,9 @@ export default memo(function YouMayLike({
const themeProductInfos = useSelector( const themeProductInfos = useSelector(
(state) => state.home.themeCurationDetailInfoData (state) => state.home.themeCurationDetailInfoData
); );
const cursorOpen = useRef(new Job((func) => func(), 1000)); const cursorOpen = useRef(new Job((func) => func(), 1000));
const launchedFromPlayer = useMemo(() => { const launchedFromPlayer = useMemo(() => {
@@ -124,34 +129,39 @@ export default memo(function YouMayLike({
setExpanded((prev) => !prev); setExpanded((prev) => !prev);
}, []); }, []);
const renderItem = useCallback( const renderItem = useCallback(
({ index, ...rest }) => { ({ index, ...rest }) => {
const { imgUrl, patnrId, prdtId, prdtNm, priceInfo, offerInfo, price3, catNm, price2, brandNm} = const { imgUrl, patnrId, prdtId, prdtNm, priceInfo, offerInfo, patncNm, brndNm, lgCatCd} =
youmaylikeData[index]; youmaylikeData[index];
const handleItemClick = () => {
const handleItemClick = () => {
const logParams = { console.log('priceInfo', priceInfo);
productId: productInfo?.prdtId, const splittedPriceInfo = priceInfo.split("|").map((item) => item.trim());
productTitle:productInfo?.prdtNm, const discountRate = splittedPriceInfo[4];
category: productInfo?.catNm, const logParams = {
nowProductId: prdtId, productId: patnrId,
nowProductTitle: prdtNm, productTitle: prdtNm,
nowCategory: catNm, category: lgCatCd,
discount: price3, nowProductId: productInfo?.prdtId,
price: price2, //할인가 nowProductTitle: productInfo?.prdtNm,
partner: patnrId, nowCategory: productInfo?.catNm,
brand: brandNm discount: discountRate,
}; price: priceInfo,
setExpanded(false); partner: patncNm,
setSelectedIndex(0); brand: brndNm,
dispatch(finishVideoPreview()); contextName: Config.LOG_CONTEXT_NAME.YOUMAYLIKE,
dispatch(popPanel(panel_names.DETAIL_PANEL)); messageId: Config.LOG_MESSAGE_ID.CONTENTCLICK
dispatch( };
sendLogTotalRecommend(logParams) setExpanded(false);
); setSelectedIndex(0);
console.log(logParams) dispatch(finishVideoPreview());
dispatch(popPanel(panel_names.DETAIL_PANEL));
dispatch(
sendLogTotalRecommend(logParams)
);
console.log(logParams);
setContainerLastFocusedElement(null, ["indicator-GridListContainer"]); setContainerLastFocusedElement(null, ["indicator-GridListContainer"]);
if (themeProductInfos && themeProductInfos.length > 0) { if (themeProductInfos && themeProductInfos.length > 0) {
dispatch(clearThemeDetail()); dispatch(clearThemeDetail());