From 81f212f5ec2d4ff7b70b019bd2147d37edaa1433 Mon Sep 17 00:00:00 2001 From: Dev TWIN0906 Date: Tue, 20 May 2025 17:32:40 +0900 Subject: [PATCH] =?UTF-8?q?search=20=EC=83=81=ED=92=88=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=20=ED=81=B4=EB=A6=AD=20=EC=A0=95=EB=B3=B4=EC=88=98?= =?UTF-8?q?=EC=A7=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- com.twin.app.shoptime/src/utils/Config.js | 1 + .../src/views/CategoryPanel/CategoryPanel.jsx | 2 +- .../SearchCard/SearchItemCard.jsx | 26 +++++++++- .../SearchCard/SearchShowCard.jsx | 27 +++++++++- .../SearchCard/SearchThemeCard.jsx | 50 +++++++++++++------ 5 files changed, 85 insertions(+), 21 deletions(-) diff --git a/com.twin.app.shoptime/src/utils/Config.js b/com.twin.app.shoptime/src/utils/Config.js index 4f249502..c454ebd4 100644 --- a/com.twin.app.shoptime/src/utils/Config.js +++ b/com.twin.app.shoptime/src/utils/Config.js @@ -616,4 +616,5 @@ export const LOG_MESSAGE_ID = { MYPAGE_CLICK: "AL_MYPAGE_CLICK", HOTPICKS_SHOWN: "AL_HOTPCIKS_SHOWN", HOTPICKS_CLICK: "AL_HOTPICKS_CLICK", + SEARCH_RESULT_CLICK: "AL_SEARCH_RESULT_CLICK", }; diff --git a/com.twin.app.shoptime/src/views/CategoryPanel/CategoryPanel.jsx b/com.twin.app.shoptime/src/views/CategoryPanel/CategoryPanel.jsx index 50d874b7..0a5503ad 100644 --- a/com.twin.app.shoptime/src/views/CategoryPanel/CategoryPanel.jsx +++ b/com.twin.app.shoptime/src/views/CategoryPanel/CategoryPanel.jsx @@ -325,7 +325,7 @@ const CategoryPanel = ({ panelInfo, isOnTop, spotlightId }) => { const params = { tabTitle: tabRef.current === 0 ? "ITEM" : "SHOWS", - sortType: dropDownTabRef.current === 0 ? "NEW" : "POPULAR", + sortType: dropDownTabRef.current === 0 ? "NEW" : "MOST POPULAR", contextName: LOG_CONTEXT_NAME.CATEGORY, messageId: LOG_MESSAGE_ID.CONTENTCLICK, }; diff --git a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchItemCard.jsx b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchItemCard.jsx index 8e540b58..ba202b9d 100644 --- a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchItemCard.jsx +++ b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchItemCard.jsx @@ -6,10 +6,17 @@ import Spotlight from "@enact/spotlight"; import Spottable from "@enact/spotlight/Spottable"; import defaultImageItem from "../../../../../assets/images/img-thumb-empty-product@3x.png"; -import { sendLogSearchClick } from "../../../../actions/logActions"; +import { + sendLogSearchClick, + sendLogTotalRecommend, +} from "../../../../actions/logActions"; import { pushPanel, updatePanel } from "../../../../actions/panelActions"; import CustomImage from "../../../../components/CustomImage/CustomImage"; -import { panel_names } from "../../../../utils/Config"; +import { + LOG_CONTEXT_NAME, + LOG_MESSAGE_ID, + panel_names, +} from "../../../../utils/Config"; import { getTranslate3dValueByDirection } from "../../../../utils/helperMethods"; import { SpotlightIds } from "../../../../utils/SpotlightIds"; import css from "./SearchItemCard.module.less"; @@ -47,6 +54,18 @@ export default memo(function SearchItemCard({ ...rest }) { const dispatch = useDispatch(); + const sendLog = (newParams) => { + const logParams = { + ...newParams, + productId: contentId, + productTitle: title, + partner: patncNm, + price: dcPrice ? dcPrice : price, + contextName: LOG_CONTEXT_NAME.SEARCH, + messageId: LOG_MESSAGE_ID.SEARCH_RESULT_CLICK, + }; + dispatch(sendLogTotalRecommend(logParams)); + }; const [firstChk, setFirstChk] = useState(0); @@ -55,6 +74,9 @@ export default memo(function SearchItemCard({ const handleItemClick = useCallback( (e) => { + sendLog({ + resultType: "item", + }); const tokkens = contentId && contentId.split("_"); const patnrId = tokkens[4] || ""; const prdtId = tokkens[5] || ""; diff --git a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchShowCard.jsx b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchShowCard.jsx index 97c09c1f..57d96faf 100644 --- a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchShowCard.jsx +++ b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchShowCard.jsx @@ -7,10 +7,18 @@ import Spottable from "@enact/spotlight/Spottable"; import defaultShowImage from "../../../../../assets/images/img-thumb-empty-product@3x.png"; import IcLiveShow from "../../../../../assets/images/tag/tag-liveshow.svg"; -import { sendLogSearchClick } from "../../../../actions/logActions"; +import { + sendLogSearchClick, + sendLogTotalRecommend, +} from "../../../../actions/logActions"; import { pushPanel, updatePanel } from "../../../../actions/panelActions"; import CustomImage from "../../../../components/CustomImage/CustomImage"; -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 { getTranslate3dValueByDirection } from "../../../../utils/helperMethods"; import { SpotlightIds } from "../../../../utils/SpotlightIds"; import css from "./SearchShowCard.module.less"; @@ -32,8 +40,23 @@ export default memo(function SearchShowCard({ const dispatch = useDispatch(); + const sendLog = (newParams) => { + const logParams = { + ...newParams, + contentId: contentId, + contentTitle: title, + partner: patncNm, + contextName: LOG_CONTEXT_NAME.SEARCH, + messageId: LOG_MESSAGE_ID.SEARCH_RESULT_CLICK, + }; + dispatch(sendLogTotalRecommend(logParams)); + }; + const handleShowClick = useCallback( (e) => { + sendLog({ + resultType: "show", + }); const tokkens = contentId && contentId.split("_"); const linkTpCd = tokkens[1] || ""; const patnrId = tokkens[4] || ""; diff --git a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchThemeCard.jsx b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchThemeCard.jsx index 238d9c9d..4fdd70a5 100644 --- a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchThemeCard.jsx +++ b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchThemeCard.jsx @@ -6,11 +6,18 @@ import Spotlight from "@enact/spotlight"; import Spottable from "@enact/spotlight/Spottable"; import { pushPanel, updatePanel } from "../../../../actions/panelActions"; -import { panel_names } from "../../../../utils/Config"; +import { + LOG_CONTEXT_NAME, + LOG_MESSAGE_ID, + panel_names, +} from "../../../../utils/Config"; import { getTranslate3dValueByDirection } from "../../../../utils/helperMethods"; import { SpotlightIds } from "../../../../utils/SpotlightIds"; import css from "./SearchThemeCard.module.less"; -import { sendLogSearchClick } from "../../../../actions/logActions"; +import { + sendLogSearchClick, + sendLogTotalRecommend, +} from "../../../../actions/logActions"; const ThemeContainer = Spottable("div"); @@ -27,6 +34,17 @@ export default memo(function SearchThemeCard({ }) { const dispatch = useDispatch(); + const sendLog = (newParams) => { + const logParams = { + ...newParams, + contentId: contentId, + contentTitle: title, + partner: patncNm, + contextName: LOG_CONTEXT_NAME.SEARCH, + messageId: LOG_MESSAGE_ID.SEARCH_RESULT_CLICK, + }; + dispatch(sendLogTotalRecommend(logParams)); + }; const [firstChk, setFirstChk] = useState(0); const handleThemeClick = useCallback( @@ -43,6 +61,10 @@ export default memo(function SearchThemeCard({ const xContainer = tItemCard?.parentNode?.parentNode; const yContainer = tBody?.children[0]?.children[0]?.children[0]; + sendLog({ + resultType: type, + }); + if (xContainer && yContainer) { const section = "search-theme"; const x = getTranslate3dValueByDirection(xContainer); @@ -79,21 +101,17 @@ export default memo(function SearchThemeCard({ }) ); - dispatch(sendLogSearchClick({ - curationId, - curationNm: title, - keyword: searchQueryRef.current, - patncNm, - patnrId, - })); + dispatch( + sendLogSearchClick({ + curationId, + curationNm: title, + keyword: searchQueryRef.current, + patncNm, + patnrId, + }) + ); }, - [ - contentId, - dispatch, - idx, - patncNm, - title, - ] + [contentId, dispatch, idx, patncNm, title] ); const keywordText = (keyword) => { let text = "";