feat. 일반 템플릿 로그 추가
This commit is contained in:
@@ -9,15 +9,16 @@ import type {
|
||||
} from '#layers/types/api/gameData'
|
||||
|
||||
const MORE_WIDTH = 72
|
||||
const START_WIDTH_MARGIN = 40
|
||||
const START_MARGIN = 40
|
||||
|
||||
const route = useRoute()
|
||||
const { tm } = useI18n()
|
||||
const { locale, tm } = useI18n()
|
||||
const { width } = useWindowSize()
|
||||
const gameDataStore = useGameDataStore()
|
||||
const pageDataStore = usePageDataStore()
|
||||
const scrollStore = useScrollStore()
|
||||
const breakpoints = useResponsiveBreakpoints()
|
||||
const { sendLog, useAnalyticsData } = useAnalytics()
|
||||
|
||||
const { gameData } = storeToRefs(gameDataStore)
|
||||
const { pageLayoutType } = storeToRefs(pageDataStore)
|
||||
@@ -95,7 +96,7 @@ const calculateOverflow = () => {
|
||||
}
|
||||
|
||||
const screenWidth = width.value
|
||||
const totalNavWidth = navWidth.value + startWidth.value + START_WIDTH_MARGIN
|
||||
const totalNavWidth = navWidth.value + startWidth.value + START_MARGIN
|
||||
|
||||
// 해상도가 navWidth + startWidth보다 작은 경우
|
||||
if (screenWidth < totalNavWidth) {
|
||||
@@ -120,18 +121,6 @@ const calculateOverflow = () => {
|
||||
// 100ms마다 최대 1회 실행
|
||||
const throttledCalculateOverflow = useThrottleFn(calculateOverflow, 100)
|
||||
|
||||
const handleMenuOpen = () => {
|
||||
isMenuOpen.value = true
|
||||
scrollStore.controlScrollLock(true)
|
||||
}
|
||||
|
||||
const handleMenuClose = (isPassing: boolean = false) => {
|
||||
if (isPassing) return
|
||||
|
||||
isMenuOpen.value = false
|
||||
scrollStore.controlScrollLock(false)
|
||||
}
|
||||
|
||||
const isNotClickable = (gnbItem: GameDataMenu) => {
|
||||
return gnbItem.click_action_type === 0
|
||||
}
|
||||
@@ -140,6 +129,32 @@ const has2depthButton = (gnbItem: GameDataMenu) => {
|
||||
return gnbItem.children && Object.keys(gnbItem.children).length > 0
|
||||
}
|
||||
|
||||
const handleMenuOpen = () => {
|
||||
isMenuOpen.value = true
|
||||
scrollStore.controlScrollLock(true)
|
||||
}
|
||||
|
||||
const handleMenuClose = () => {
|
||||
isMenuOpen.value = false
|
||||
scrollStore.controlScrollLock(false)
|
||||
}
|
||||
|
||||
const handleSendLog = (item: string) => {
|
||||
const analytics = {
|
||||
action_type: 'click',
|
||||
click_item: item,
|
||||
click_sarea: 'GNB',
|
||||
}
|
||||
sendLog(locale.value, useAnalyticsData(analytics))
|
||||
}
|
||||
|
||||
const handleGnbItemClick = (gnbItem: GameDataMenu) => {
|
||||
if (isNotClickable(gnbItem)) return
|
||||
|
||||
handleMenuClose()
|
||||
sendLog(locale.value, useAnalyticsData(gnbItem.tracking_json))
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
overflowCount.value = 0
|
||||
isMounted.value = true
|
||||
@@ -170,7 +185,11 @@ onMounted(() => {
|
||||
v-if="gnbData"
|
||||
:class="['game-wrap', { 'is-fixed': isPassedStoveGnb }]"
|
||||
>
|
||||
<AtomsLocaleLink to="/home" class="mx-auto md:hidden">
|
||||
<AtomsLocaleLink
|
||||
to="/home"
|
||||
class="mx-auto md:hidden"
|
||||
@click="handleSendLog('BI')"
|
||||
>
|
||||
<img
|
||||
:src="formatPathHost(gnbData?.bi_path)"
|
||||
:alt="gameData?.game_name"
|
||||
@@ -183,11 +202,14 @@ onMounted(() => {
|
||||
</button>
|
||||
<div
|
||||
:class="['nav-wrap', { 'is-open': isMenuOpen }]"
|
||||
@click="handleMenuClose()"
|
||||
@click="handleMenuClose"
|
||||
>
|
||||
<div ref="navAreaRef" class="nav-area" @click.stop>
|
||||
<div class="nav-logo">
|
||||
<AtomsLocaleLink to="/home" @click="handleMenuClose">
|
||||
<AtomsLocaleLink
|
||||
to="/home"
|
||||
@click="[handleMenuClose(), handleSendLog('BI')]"
|
||||
>
|
||||
<img
|
||||
:src="formatPathHost(gnbData?.bi_path)"
|
||||
:alt="gameData?.game_name"
|
||||
@@ -219,7 +241,7 @@ onMounted(() => {
|
||||
'router-link-active': hasActiveChild(gnbItem.children),
|
||||
},
|
||||
]"
|
||||
@click="handleMenuClose(isNotClickable(gnbItem))"
|
||||
@click="handleGnbItemClick(gnbItem)"
|
||||
>
|
||||
<span>{{ gnbItem.menu_name }}</span>
|
||||
<AtomsIconsWebLinkLine
|
||||
@@ -248,7 +270,7 @@ onMounted(() => {
|
||||
:to="child.url_path"
|
||||
:target="child.link_target"
|
||||
class="item-link"
|
||||
@click="handleMenuClose(isNotClickable(child))"
|
||||
@click="handleGnbItemClick(child)"
|
||||
>
|
||||
<span>{{ child.menu_name }}</span>
|
||||
<AtomsIconsWebLinkLine
|
||||
@@ -293,7 +315,7 @@ onMounted(() => {
|
||||
),
|
||||
},
|
||||
]"
|
||||
@click="handleMenuClose(isNotClickable(gnbItem))"
|
||||
@click="handleGnbItemClick(gnbItem)"
|
||||
>
|
||||
<span>{{ gnbItem.menu_name }}</span>
|
||||
</component>
|
||||
@@ -340,7 +362,7 @@ onMounted(() => {
|
||||
'nav-1depth',
|
||||
{ 'router-link-active': pageLayoutType === 'promotion' },
|
||||
]"
|
||||
@click="handleMenuClose"
|
||||
@click="[handleMenuClose(), handleSendLog('이벤트')]"
|
||||
>
|
||||
<span
|
||||
class="flex items-center gap-1 flex-1 text-gradient-pink"
|
||||
@@ -367,6 +389,9 @@ onMounted(() => {
|
||||
:text-color="
|
||||
getColorCodeFromData(start1depthData?.btn_info, 'txt')
|
||||
"
|
||||
@click="
|
||||
sendLog(locale, useAnalyticsData(start1depthData.tracking))
|
||||
"
|
||||
>
|
||||
{{ start1depthData?.btn_info?.txt_btn_name }}
|
||||
</BlocksButtonLauncher>
|
||||
@@ -376,7 +401,13 @@ onMounted(() => {
|
||||
>
|
||||
<ul>
|
||||
<li v-for="(item, key) in start2depthData" :key="key">
|
||||
<BlocksButtonLauncher type="custom" :platform="key">
|
||||
<BlocksButtonLauncher
|
||||
type="custom"
|
||||
:platform="key"
|
||||
@click="
|
||||
sendLog(locale, useAnalyticsData(item.tracking))
|
||||
"
|
||||
>
|
||||
{{ item.btn_info?.txt_btn_name }}
|
||||
</BlocksButtonLauncher>
|
||||
</li>
|
||||
@@ -385,7 +416,7 @@ onMounted(() => {
|
||||
</template>
|
||||
</div>
|
||||
</ClientOnly>
|
||||
<button class="btn-close" @click="handleMenuClose()">
|
||||
<button class="btn-close" @click="handleMenuClose">
|
||||
<AtomsIconsCloseLine
|
||||
size="24"
|
||||
color="var(--foreground-reversal)"
|
||||
|
||||
@@ -75,7 +75,7 @@ watch(isPAssApiLoading, newVal => {
|
||||
|
||||
onMounted(() => {
|
||||
const { sendLog } = useAnalytics()
|
||||
sendLog(locale.value, useAnalyticsLogDataDirect('view', 1))
|
||||
sendLog(locale.value, useAnalyticsData('view'))
|
||||
|
||||
if (!hasApiCallStarted.value) {
|
||||
loadingStore.stopFullLoading()
|
||||
@@ -94,6 +94,7 @@ onMounted(() => {
|
||||
:id="template.page_ver_tmpl_name_en"
|
||||
:components="template.page_ver_tmpl_json"
|
||||
:page-ver-tmpl-seq="template.page_ver_tmpl_seq"
|
||||
:page-ver-tmpl-name-en="template.page_ver_tmpl_name_en"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user