diff --git a/com.twin.app.shoptime/src/actions/logActions.js b/com.twin.app.shoptime/src/actions/logActions.js index f93bdeee..d7323e74 100644 --- a/com.twin.app.shoptime/src/actions/logActions.js +++ b/com.twin.app.shoptime/src/actions/logActions.js @@ -1600,6 +1600,9 @@ export const sendLogTotalRecommend = (params) => (dispatch, getState) => { const logCreateTime = new Date().toISOString(); // console.log("#params", params); + + console.log("#entryMenu", entryMenu); + const newParams = { ...params, userNumber: userNumber, diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContainer.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContainer.jsx index 6e6096da..e86a9add 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContainer.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContainer.jsx @@ -121,6 +121,7 @@ export default function TabContainer({ {tab === 0 && ( )} {panelInfo?.shptmBanrTpNm === "LIVE" && tab === 1 && liveChannelInfos && ( )} diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/FeaturedShowContents.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/FeaturedShowContents.jsx index b2ee77eb..e246dce9 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/FeaturedShowContents.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/FeaturedShowContents.jsx @@ -7,12 +7,13 @@ import Spotlight from "@enact/spotlight"; import defaultImage from "../../../../../assets/images/img-thumb-empty-144@3x.png"; import { updatePanel } from "../../../../actions/panelActions"; import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList"; -import { LOG_MENU, panel_names } from "../../../../utils/Config"; +import { LOG_CONTEXT_NAME, LOG_MENU, LOG_MESSAGE_ID, panel_names } from "../../../../utils/Config"; import { $L, removeSpecificTags } from "../../../../utils/helperMethods"; import PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard"; import ListEmptyContents from "../TabContents/ListEmptyContents/ListEmptyContents"; import css from "./LiveChannelContents.module.less"; import { getMainCategoryShowDetail } from "../../../../actions/mainActions"; +import { sendLogTotalRecommend } from "../../../../actions/logActions"; export default function FeaturedShowContents({ featuredShowsInfos, @@ -23,6 +24,8 @@ export default function FeaturedShowContents({ selectedIndex, tabIndex, handleItemFocus, + tabTitle, + panelInfo }) { const dispatch = useDispatch(); const isClickBlocked = useRef(false); @@ -45,10 +48,22 @@ export default function FeaturedShowContents({ prdtId, patncNm, showNm, + catNm, lgCatCd, } = featuredShowsInfos[index]; const handleItemClick = () => { + const params = { + tabTitle: tabTitle[tabIndex], + showId: showId, + showTitle: showNm, + showType: panelInfo?.shptmBanrTpNm, + category: catNm, + partner: patncNm, + contextName: LOG_CONTEXT_NAME.SHOW, + messageId: LOG_MESSAGE_ID.CONTENTCLICK + } + dispatch(sendLogTotalRecommend(params)); //중복클릭방지 if (isClickBlocked.current) { return; diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/LiveChannelContents.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/LiveChannelContents.jsx index 96ee6460..336fa0b3 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/LiveChannelContents.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/LiveChannelContents.jsx @@ -6,11 +6,12 @@ import Spotlight from "@enact/spotlight"; import { updatePanel } from "../../../../actions/panelActions"; import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList"; -import { LOG_MENU, panel_names } from "../../../../utils/Config"; +import { LOG_CONTEXT_NAME, LOG_MENU, LOG_MESSAGE_ID, panel_names } from "../../../../utils/Config"; import { $L } from "../../../../utils/helperMethods"; import PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard"; import ListEmptyContents from "../TabContents/ListEmptyContents/ListEmptyContents"; import css from "./LiveChannelContents.module.less"; +import { sendLogTotalRecommend } from "../../../../actions/logActions"; export default function LiveChannelContents({ liveInfos, @@ -20,6 +21,8 @@ export default function LiveChannelContents({ currentVideoShowId, tabIndex, handleItemFocus, + tabTitle, + panelInfo }) { const dispatch = useDispatch(); const isClickBlocked = useRef(false); @@ -46,11 +49,23 @@ export default function LiveChannelContents({ catCd, strtDt, endDt, + catNm, timezone, thumbnailUrl, } = liveInfos[index]; const handleItemClick = () => { + const params = { + tabTitle: tabTitle[tabIndex], + showId: showId, + showTitle: showNm, + showType: panelInfo?.shptmBanrTpNm, + category: catNm, + partner: patncNm, + contextName: LOG_CONTEXT_NAME.SHOW, + messageId: LOG_MESSAGE_ID.CONTENTCLICK + } + dispatch(sendLogTotalRecommend(params)); //중복클릭방지 if (isClickBlocked.current) { return; diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.jsx index 7727bbf5..885aa3c0 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContents/ShopNowContents.jsx @@ -19,10 +19,24 @@ import { pushPanel } from "../../../../actions/panelActions"; import TItemCard, { TYPES } from "../../../../components/TItemCard/TItemCard"; import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList"; import useScrollTo from "../../../../hooks/useScrollTo"; -import { LOG_MENU, panel_names } from "../../../../utils/Config"; +import { LOG_CONTEXT_NAME, LOG_MENU, LOG_MESSAGE_ID, panel_names } from "../../../../utils/Config"; import { scaleH } from "../../../../utils/helperMethods"; import ListEmptyContents from "../TabContents/ListEmptyContents/ListEmptyContents"; import css from "./ShopNowContents.module.less"; +import { sendLogTotalRecommend } from "../../../../actions/logActions"; + + +const extractPriceInfo = (priceInfo) => { + if (!priceInfo) return { originalPrice: "", discountedPrice: "", discountRate: "" }; + + const parts = priceInfo.split("|").map(part => part.trim()); + + return { + originalPrice: parts[0] || "", + discountedPrice: parts[1] || "", + discountRate: parts[4] || "" + }; +}; const Container = SpotlightContainerDecorator( { enterTo: "last-focused" }, @@ -35,15 +49,28 @@ export default function ShopNowContents({ tabIndex, handleItemFocus, panelInfo, + tabTitle }) { const { getScrollTo, scrollTop } = useScrollTo(); const dispatch = useDispatch(); - const paenls = useSelector((state) => state.panels.panels[1]?.panelInfo); + const paenls = useSelector((state) => state.panels.panels[1]?.panelInfo); const scrollTopJob = useRef(new Job((func) => func(), 0)); const [height, setHeight] = useState(); - const gridStyle = useMemo(() => ({ height: `${height}px` }), [height]); + // 각 상품별 가격 정보를 미리 계산 + const priceInfoMap = useMemo(() => { + if (!shopNowInfo) return {}; + + const map = {}; + shopNowInfo.forEach((item, index) => { + if (item.priceInfo) { + map[index] = extractPriceInfo(item.priceInfo); + } + }); + return map; + }, [shopNowInfo]); + useEffect(() => { return () => { const gridListId = "playVideoShopNowBox"; @@ -93,9 +120,30 @@ export default function ShopNowContents({ priceInfo, offerInfo, soldoutFlag, + patncNm, + brndNm, + catNm } = shopNowInfo[index]; - + + // 미리 계산된 가격 정보를 사용 + const { originalPrice, discountedPrice, discountRate } = priceInfoMap[index] || {}; + const handleItemClick = () => { + const params = { + tabTitle: tabTitle[tabIndex], + productId: prdtId, + productTitle: prdtNm, + partner: patncNm, + brand: brndNm, + price: discountRate ? discountedPrice : originalPrice, + showType: panelInfo?.shptmBanrTpNm, + category: catNm, + discount: discountRate, + contextName: LOG_CONTEXT_NAME.SHOW, + messageId: LOG_MESSAGE_ID.CONTENTCLICK + } + dispatch(sendLogTotalRecommend(params)) + dispatch( pushPanel({ name: panel_names.DETAIL_PANEL, @@ -130,7 +178,7 @@ export default function ShopNowContents({ /> ); }, - [shopNowInfo, videoVerticalVisible, panelInfo?.shptmBanrTpNm] + [shopNowInfo, videoVerticalVisible, panelInfo?.shptmBanrTpNm, priceInfoMap, tabTitle, tabIndex, playListInfo, dispatch] ); return (