show 시청화면 카테고리 내 정보 수집

This commit is contained in:
Dev TWIN0906
2025-05-14 15:36:18 +09:00
parent 2cf04c43a7
commit e9b909963e
5 changed files with 92 additions and 7 deletions

View File

@@ -1599,6 +1599,8 @@ export const sendLogTotalRecommend = (params) => (dispatch, getState) => {
const logCreateTime = new Date().toISOString(); const logCreateTime = new Date().toISOString();
console.log("#entryMenu", entryMenu);
const newParams = { const newParams = {
...params, ...params,
userNumber: userNumber, userNumber: userNumber,

View File

@@ -121,6 +121,7 @@ export default function TabContainer({
{tab === 0 && ( {tab === 0 && (
<ShopNowContents <ShopNowContents
tabTitle = {tabList}
shopNowInfo={shopNowInfo} shopNowInfo={shopNowInfo}
playListInfo={playListInfo && playListInfo[selectedIndex]} playListInfo={playListInfo && playListInfo[selectedIndex]}
videoVerticalVisible={videoVerticalVisible} videoVerticalVisible={videoVerticalVisible}
@@ -131,6 +132,7 @@ export default function TabContainer({
)} )}
{panelInfo?.shptmBanrTpNm === "VOD" && tab === 1 && ( {panelInfo?.shptmBanrTpNm === "VOD" && tab === 1 && (
<FeaturedShowContents <FeaturedShowContents
tabTitle = {tabList}
featuredShowsInfos={playListInfo} featuredShowsInfos={playListInfo}
currentVideoInfo={playListInfo[selectedIndex]} currentVideoInfo={playListInfo[selectedIndex]}
setSelectedIndex={setSelectedIndex} setSelectedIndex={setSelectedIndex}
@@ -138,11 +140,13 @@ export default function TabContainer({
videoVerticalVisible={videoVerticalVisible} videoVerticalVisible={videoVerticalVisible}
currentVideoShowId={playListInfo[selectedIndex]?.showId} currentVideoShowId={playListInfo[selectedIndex]?.showId}
tabIndex={tab} tabIndex={tab}
panelInfo={panelInfo}
handleItemFocus={_handleItemFocus} handleItemFocus={_handleItemFocus}
/> />
)} )}
{panelInfo?.shptmBanrTpNm === "LIVE" && tab === 1 && liveChannelInfos && ( {panelInfo?.shptmBanrTpNm === "LIVE" && tab === 1 && liveChannelInfos && (
<LiveChannelContents <LiveChannelContents
tabTitle = {tabList}
selectedIndex={selectedIndex} selectedIndex={selectedIndex}
setSelectedIndex={setSelectedIndex} setSelectedIndex={setSelectedIndex}
videoVerticalVisible={videoVerticalVisible} videoVerticalVisible={videoVerticalVisible}
@@ -150,6 +154,7 @@ export default function TabContainer({
liveInfos={playListInfo} liveInfos={playListInfo}
tabIndex={tab} tabIndex={tab}
handleItemFocus={_handleItemFocus} handleItemFocus={_handleItemFocus}
panelInfo={panelInfo}
currentTime={currentTime} currentTime={currentTime}
/> />
)} )}

View File

@@ -7,12 +7,13 @@ import Spotlight from "@enact/spotlight";
import defaultImage from "../../../../../assets/images/img-thumb-empty-144@3x.png"; import defaultImage from "../../../../../assets/images/img-thumb-empty-144@3x.png";
import { updatePanel } from "../../../../actions/panelActions"; import { updatePanel } from "../../../../actions/panelActions";
import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList"; 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 { $L, removeSpecificTags } from "../../../../utils/helperMethods";
import PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard"; import PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard";
import ListEmptyContents from "../TabContents/ListEmptyContents/ListEmptyContents"; import ListEmptyContents from "../TabContents/ListEmptyContents/ListEmptyContents";
import css from "./LiveChannelContents.module.less"; import css from "./LiveChannelContents.module.less";
import { getMainCategoryShowDetail } from "../../../../actions/mainActions"; import { getMainCategoryShowDetail } from "../../../../actions/mainActions";
import { sendLogTotalRecommend } from "../../../../actions/logActions";
export default function FeaturedShowContents({ export default function FeaturedShowContents({
featuredShowsInfos, featuredShowsInfos,
@@ -23,6 +24,8 @@ export default function FeaturedShowContents({
selectedIndex, selectedIndex,
tabIndex, tabIndex,
handleItemFocus, handleItemFocus,
tabTitle,
panelInfo
}) { }) {
const dispatch = useDispatch(); const dispatch = useDispatch();
const isClickBlocked = useRef(false); const isClickBlocked = useRef(false);
@@ -45,10 +48,22 @@ export default function FeaturedShowContents({
prdtId, prdtId,
patncNm, patncNm,
showNm, showNm,
catNm,
lgCatCd, lgCatCd,
} = featuredShowsInfos[index]; } = featuredShowsInfos[index];
const handleItemClick = () => { 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) { if (isClickBlocked.current) {
return; return;

View File

@@ -6,11 +6,12 @@ import Spotlight from "@enact/spotlight";
import { updatePanel } from "../../../../actions/panelActions"; import { updatePanel } from "../../../../actions/panelActions";
import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList"; 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 { $L } from "../../../../utils/helperMethods";
import PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard"; import PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard";
import ListEmptyContents from "../TabContents/ListEmptyContents/ListEmptyContents"; import ListEmptyContents from "../TabContents/ListEmptyContents/ListEmptyContents";
import css from "./LiveChannelContents.module.less"; import css from "./LiveChannelContents.module.less";
import { sendLogTotalRecommend } from "../../../../actions/logActions";
export default function LiveChannelContents({ export default function LiveChannelContents({
liveInfos, liveInfos,
@@ -20,6 +21,8 @@ export default function LiveChannelContents({
currentVideoShowId, currentVideoShowId,
tabIndex, tabIndex,
handleItemFocus, handleItemFocus,
tabTitle,
panelInfo
}) { }) {
const dispatch = useDispatch(); const dispatch = useDispatch();
const isClickBlocked = useRef(false); const isClickBlocked = useRef(false);
@@ -46,11 +49,23 @@ export default function LiveChannelContents({
catCd, catCd,
strtDt, strtDt,
endDt, endDt,
catNm,
timezone, timezone,
thumbnailUrl, thumbnailUrl,
} = liveInfos[index]; } = liveInfos[index];
const handleItemClick = () => { 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) { if (isClickBlocked.current) {
return; return;

View File

@@ -19,10 +19,24 @@ import { pushPanel } from "../../../../actions/panelActions";
import TItemCard, { TYPES } from "../../../../components/TItemCard/TItemCard"; import TItemCard, { TYPES } from "../../../../components/TItemCard/TItemCard";
import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList"; import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList";
import useScrollTo from "../../../../hooks/useScrollTo"; 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 { scaleH } from "../../../../utils/helperMethods";
import ListEmptyContents from "../TabContents/ListEmptyContents/ListEmptyContents"; import ListEmptyContents from "../TabContents/ListEmptyContents/ListEmptyContents";
import css from "./ShopNowContents.module.less"; 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( const Container = SpotlightContainerDecorator(
{ enterTo: "last-focused" }, { enterTo: "last-focused" },
@@ -35,15 +49,28 @@ export default function ShopNowContents({
tabIndex, tabIndex,
handleItemFocus, handleItemFocus,
panelInfo, panelInfo,
tabTitle
}) { }) {
const { getScrollTo, scrollTop } = useScrollTo(); const { getScrollTo, scrollTop } = useScrollTo();
const dispatch = useDispatch(); 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 scrollTopJob = useRef(new Job((func) => func(), 0));
const [height, setHeight] = useState(); const [height, setHeight] = useState();
const gridStyle = useMemo(() => ({ height: `${height}px` }), [height]); 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(() => { useEffect(() => {
return () => { return () => {
const gridListId = "playVideoShopNowBox"; const gridListId = "playVideoShopNowBox";
@@ -93,9 +120,30 @@ export default function ShopNowContents({
priceInfo, priceInfo,
offerInfo, offerInfo,
soldoutFlag, soldoutFlag,
patncNm,
brndNm,
catNm
} = shopNowInfo[index]; } = shopNowInfo[index];
// 미리 계산된 가격 정보를 사용
const { originalPrice, discountedPrice, discountRate } = priceInfoMap[index] || {};
const handleItemClick = () => { 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( dispatch(
pushPanel({ pushPanel({
name: panel_names.DETAIL_PANEL, 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 ( return (