[Log] Log, IF-LGSP-LOG-003, IF-LGSP-LOG-005, CateogryPanel 반영

This commit is contained in:
younghoon100.park
2024-05-24 12:44:33 +09:00
parent 42a5f3b590
commit b451a74c7d
2 changed files with 55 additions and 23 deletions

View File

@@ -155,10 +155,10 @@ export const LOG_MENU = {
SEARCH_RESULT: "Search/Search Result", // completed
SEARCH_BEST_SELLER: "Search/Best Sellers", // completed
// pyh ** 문의 **
CATEGORY: "Category",
CATEGORY_POPULAR_SHOWS: "Category/Popular Shows",
CATEGORY_BEST_SELLER: "Category/Best Sellers",
CATEGORY_SHOWS: "Category/Shows", // completed
CATEGORY_ITEM: "Ctegory/Item", // completed
CATEGORY_POPULAR_SHOWS: "Category/Popular Shows", // completed
CATEGORY_BEST_SELLER: "Category/Best Sellers", // completed
FEATURED_BRANDS_QUICK_MENU: "Featured Brands/Quick Menu", // completed
FEATURED_BRANDS_LIVE_CHANNELS: "Featured Brands/Live Channels", // completed
@@ -184,16 +184,16 @@ export const LOG_MENU = {
THEME_PAGE: "Theme Page", // completed
// SingleOption
DETAIL_PAGE_BILLING_PRODUCT_DETAIL: "Detail Page/Billing Product Detail",
DETAIL_PAGE_BILLING_PRODUCT_DETAIL: "Detail Page/Billing Product Detail", // completed
// UnableOption
DETAIL_PAGE_PRODUCT_DETAIL: "Detail Page/Product Detail",
DETAIL_PAGE_PRODUCT_DETAIL: "Detail Page/Product Detail", // completed
// ThemeProduct, themeType = "hotel" = HotelProduct(HotelOption)
DETAIL_PAGE_TRAVEL_THEME_DETAIL: "Detail Page/Travel Theme Detail",
// HotelProduct(HotelOption)
DETAIL_PAGE_TRAVEL_THEME_DETAIL: "Detail Page/Travel Theme Detail", // completed
// GroupProduct
DETAIL_PAGE_GROUP_DETAIL: "Detail Page/Group Detail",
// GroupOption
DETAIL_PAGE_GROUP_DETAIL: "Detail Page/Group Detail", // completed
FULL_SHOP_NOW: "Full/Shop Now",
FULL_YOU_MAY_LIKE: "Full/You May Like",

View File

@@ -31,6 +31,7 @@ import usePrevious from "../../hooks/usePrevious";
import useScrollTo from "../../hooks/useScrollTo";
import {
CATEGORY_DATA_MAX_RESULTS_LIMIT,
LOG_MENU,
LOG_TP_NO,
panel_names,
} from "../../utils/Config";
@@ -60,7 +61,7 @@ export default function CategoryPanel({ panelInfo, isOnTop }) {
buttonTabList = getButtonTabList();
}
const { sendLogCuration } = useLogService();
const { sendLogCuration, sendLogGNB } = useLogService();
const dispatch = useDispatch();
const dataAppendJob = useRef(new Job((func) => func(), 1000));
@@ -91,6 +92,48 @@ export default function CategoryPanel({ panelInfo, isOnTop }) {
const [filterMethods, setFilterMethods] = useState([]);
const [styleChange, setStyleChange] = useState(false);
const spotYoffsetRef = useRef(null);
const logTimerRef = useRef(null);
useEffect(() => {
let nowMenu;
if (tab === 0) {
if (categoryShowInfos) {
nowMenu =
categoryShowInfos?.subCatShowList.length === 0
? LOG_MENU.CATEGORY_POPULAR_SHOWS
: LOG_MENU.CATEGORY_SHOWS;
}
}
if (tab === 1) {
if (categoryItemInfos) {
nowMenu =
categoryItemInfos?.subCatItemList.length === 0
? LOG_MENU.CATEGORY_BEST_SELLER
: LOG_MENU.CATEGORY_ITEM;
}
}
sendLogGNB(nowMenu);
}, [categoryItemInfos, categoryShowInfos, sendLogGNB, tab]);
useEffect(() => {
const cnttTpNm = tab === 0 ? "Show" : "Item";
const sortTpNm = dropDownTab === 0 ? "New" : "Popular";
logTimerRef.current = setTimeout(() => {
sendLogCuration({
cnttTpNm,
lgCatCd,
lgCatNm,
logTpNo: LOG_TP_NO.CURATION.CATEGORY,
sortTpNm,
});
}, 300);
return () => clearTimeout(logTimerRef.current);
}, [dropDownTab, lgCatCd, lgCatNm, sendLogCuration, tab]);
const reload = useCallback(() => {
const tabType = tabRef.current === 0 ? "CAT00101" : "CAT00102";
@@ -172,20 +215,9 @@ export default function CategoryPanel({ panelInfo, isOnTop }) {
return;
}
const cnttTpNm = tab === 0 ? "item" : "show";
const sortTpNm = dropDownTab === 0 ? "new" : "popular";
sendLogCuration({
cnttTpNm,
lgCatCd,
lgCatNm,
logTpNo: LOG_TP_NO.CURATION.CATEGORY,
sortTpNm,
});
setTab(index);
},
[dropDownTab, lgCatCd, lgCatNm, sendLogCuration, tab]
[tab]
);
const handleItemClick = useCallback(