From 34e038cd2f6990d31527526e9537aca71c84df9b Mon Sep 17 00:00:00 2001 From: dongyoungKo Date: Thu, 15 May 2025 18:14:47 +0900 Subject: [PATCH] =?UTF-8?q?[=ED=86=B5=ED=95=A9=EB=A1=9C=EA=B7=B8API=20No.5?= =?UTF-8?q?]=20Home=20Category=20Item=20Click=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/TItemCard/TItemCard.jsx | 90 ++++++++----------- com.twin.app.shoptime/src/utils/Config.js | 1 + .../src/views/HomePanel/HomePanel.jsx | 4 + .../HomePanel/SubCategory/SubCategory.jsx | 29 +++++- 4 files changed, 70 insertions(+), 54 deletions(-) diff --git a/com.twin.app.shoptime/src/components/TItemCard/TItemCard.jsx b/com.twin.app.shoptime/src/components/TItemCard/TItemCard.jsx index c91deb2e..ed43ba60 100644 --- a/com.twin.app.shoptime/src/components/TItemCard/TItemCard.jsx +++ b/com.twin.app.shoptime/src/components/TItemCard/TItemCard.jsx @@ -1,32 +1,19 @@ -import React, { - memo, - useCallback, - useEffect, - useMemo, - useState, -} from 'react'; +import React, { memo, useCallback, useEffect, useMemo, useState } from "react"; -import classNames from 'classnames'; -import { useDispatch, useSelector } from 'react-redux'; +import classNames from "classnames"; +import { useDispatch, useSelector } from "react-redux"; -import Spottable from '@enact/spotlight/Spottable'; +import Spottable from "@enact/spotlight/Spottable"; -import defaultLogoImg - from '../../../assets/images/ic-tab-partners-default@3x.png'; -import defaultimgHorizontal - from '../../../assets/images/img-thumb-empty-hor@3x.png'; -import defaultImageItem - from '../../../assets/images/img-thumb-empty-product@3x.png'; -import defaultimgVertical - from '../../../assets/images/img-thumb-empty-ver@3x.png'; -import IcLiveShow from '../../../assets/images/tag/tag-liveshow.png'; -import usePriceInfo from '../../hooks/usePriceInfo'; -import { - $L, - removeSpecificTags, -} from '../../utils/helperMethods'; -import CustomImage from '../CustomImage/CustomImage'; -import css from './TItemCard.module.less'; +import defaultLogoImg from "../../../assets/images/ic-tab-partners-default@3x.png"; +import defaultimgHorizontal from "../../../assets/images/img-thumb-empty-hor@3x.png"; +import defaultImageItem from "../../../assets/images/img-thumb-empty-product@3x.png"; +import defaultimgVertical from "../../../assets/images/img-thumb-empty-ver@3x.png"; +import IcLiveShow from "../../../assets/images/tag/tag-liveshow.png"; +import usePriceInfo from "../../hooks/usePriceInfo"; +import { $L, removeSpecificTags } from "../../utils/helperMethods"; +import CustomImage from "../CustomImage/CustomImage"; +import css from "./TItemCard.module.less"; import { sendLogTotalRecommend } from "../../actions/logActions"; const SpottableComponent = Spottable("div"); @@ -78,6 +65,14 @@ export default memo(function TItemCard({ firstLabel, label, lastLabel, + contextName, + messageId, + location, + patnerName, + brandName, + shelfId, + shelfLocation, + shelfTitle, ...rest }) { const dispatch = useDispatch(); @@ -117,34 +112,25 @@ export default memo(function TItemCard({ if (onClick) { onClick(e); - // const params = { - // contextName: "", - // messageId: "", - // shelfLocation: "", - // shelfId: "", - // shelfTitle: "", - // productId: productId, - // productTitle: productName, - // partner: "", - // brand: "", - // price: originalPrice, - // discount: discountRate, - // locaiton: "", - // category: catNm, - // } - - // dispatch(sendLogTotalRecommend( - // ...params - // )) + const params = { + contextName: contextName, + messageId: messageId, + shelfLocation: shelfLocation, + shelfId: shelfId, + shelfTitle: shelfTitle, + productId: productId, + productTitle: productName, + partner: patnerName, + brand: brandName, + price: originalPrice, + discount: discountRate, + locaiton: location, + category: catNm, + }; + dispatch(sendLogTotalRecommend(params)); + console.log("#params", params); } - - - - - - - }, [onClick, disabled] ); diff --git a/com.twin.app.shoptime/src/utils/Config.js b/com.twin.app.shoptime/src/utils/Config.js index f9a1ec0b..0300ca38 100644 --- a/com.twin.app.shoptime/src/utils/Config.js +++ b/com.twin.app.shoptime/src/utils/Config.js @@ -601,6 +601,7 @@ export const LOG_MESSAGE_ID = { CONTENTCLICK: "AL_PAGE_CONTENT_CLICK", SHOWVIEW: "AL_SHOW_VIEW_CHANGE", SHELF: "AL_SHELF_LIST_SHOWN", + SHELF_CLICK: "AL_SHELF_CONTENT_CLICK", SMB: "AL_SBM", GNB: "AL_GNB_CLICK", BUTTONCLICK: "AL_BUTTON_CLICK", diff --git a/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx b/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx index c85ac2da..5571f709 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx @@ -315,6 +315,8 @@ const HomePanel = ({ isOnTop }) => { el.shptmApphmDspyOptNm )} handleItemFocus={handleItemFocus(el.shptmApphmDspyOptCd)} + shelfLocation={el.expsOrd} + shelfTitle={el.shptmApphmDspyOptNm} /> ); } else break; @@ -331,6 +333,8 @@ const HomePanel = ({ isOnTop }) => { el.shptmApphmDspyOptNm )} handleItemFocus={handleItemFocus(el.shptmApphmDspyOptCd)} + shelfLocation={el.expsOrd} + shelfTitle={el.shptmApphmDspyOptNm} /> ); } else break; diff --git a/com.twin.app.shoptime/src/views/HomePanel/SubCategory/SubCategory.jsx b/com.twin.app.shoptime/src/views/HomePanel/SubCategory/SubCategory.jsx index 4f4092c5..a38cabe4 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/SubCategory/SubCategory.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/SubCategory/SubCategory.jsx @@ -14,7 +14,12 @@ import TScroller from "../../../components/TScroller/TScroller"; import usePrevious from "../../../hooks/usePrevious"; import useScrollReset from "../../../hooks/useScrollReset"; import useScrollTo from "../../../hooks/useScrollTo"; -import { LOG_TP_NO, panel_names } from "../../../utils/Config"; +import { + LOG_CONTEXT_NAME, + LOG_MESSAGE_ID, + LOG_TP_NO, + panel_names, +} from "../../../utils/Config"; import { SpotlightIds } from "../../../utils/SpotlightIds"; import CategoryNav from "../../HomePanel/SubCategory/CategoryNav/CategoryNav"; import css from "../../HomePanel/SubCategory/SubCategory.module.less"; @@ -37,6 +42,8 @@ export default memo(function SubCategory({ cateNm, handleItemFocus, handleShelfFocus, + shelfLocation, + shelfTitle, }) { const dispatch = useDispatch(); const { getScrollTo, scrollLeft } = useScrollTo(); @@ -227,12 +234,30 @@ export default memo(function SubCategory({ {categoryItemInfos && categoryItemInfos?.subCatItemList.map( ( - { prdtId, imgUrl, priceInfo, prdtNm, patnrId, offerInfo }, + { + prdtId, + imgUrl, + priceInfo, + prdtNm, + patnrId, + offerInfo, + brndNm, + patncNm, + }, itemIndex ) => { return (