[통합로그API] contentId value 추가
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -121,6 +121,7 @@ export default function TabContainer({
|
||||
|
||||
{tab === 0 && (
|
||||
<ShopNowContents
|
||||
tabTitle = {tabList}
|
||||
shopNowInfo={shopNowInfo}
|
||||
playListInfo={playListInfo && playListInfo[selectedIndex]}
|
||||
videoVerticalVisible={videoVerticalVisible}
|
||||
@@ -131,6 +132,7 @@ export default function TabContainer({
|
||||
)}
|
||||
{panelInfo?.shptmBanrTpNm === "VOD" && tab === 1 && (
|
||||
<FeaturedShowContents
|
||||
tabTitle = {tabList}
|
||||
featuredShowsInfos={playListInfo}
|
||||
currentVideoInfo={playListInfo[selectedIndex]}
|
||||
setSelectedIndex={setSelectedIndex}
|
||||
@@ -138,11 +140,13 @@ export default function TabContainer({
|
||||
videoVerticalVisible={videoVerticalVisible}
|
||||
currentVideoShowId={playListInfo[selectedIndex]?.showId}
|
||||
tabIndex={tab}
|
||||
panelInfo={panelInfo}
|
||||
handleItemFocus={_handleItemFocus}
|
||||
/>
|
||||
)}
|
||||
{panelInfo?.shptmBanrTpNm === "LIVE" && tab === 1 && liveChannelInfos && (
|
||||
<LiveChannelContents
|
||||
tabTitle = {tabList}
|
||||
selectedIndex={selectedIndex}
|
||||
setSelectedIndex={setSelectedIndex}
|
||||
videoVerticalVisible={videoVerticalVisible}
|
||||
@@ -150,6 +154,7 @@ export default function TabContainer({
|
||||
liveInfos={playListInfo}
|
||||
tabIndex={tab}
|
||||
handleItemFocus={_handleItemFocus}
|
||||
panelInfo={panelInfo}
|
||||
currentTime={currentTime}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 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 (
|
||||
|
||||
Reference in New Issue
Block a user