fix. 게임스타드 platform_type 별 분리

This commit is contained in:
clkim
2025-12-09 15:14:36 +09:00
parent 5acd43af95
commit 67295a112c
3 changed files with 47 additions and 42 deletions

View File

@@ -45,25 +45,26 @@ const overflowCount = ref<number>(0)
const gnbData = computed(() => gameData.value?.gnb)
const hasGnbMenus = computed(() => {
const menus = gnbData.value?.menus
if (!menus) return false
if (typeof menus !== 'object') return false
if (!menus || typeof menus !== 'object') return false
return Object.keys(menus).length > 0
})
const currentPath = computed(() => formatPathWithoutLocale(route.path))
const gnb1depthButtonData = computed(
const start1depthData = computed(
() => gnbData.value?.buttons[0]?.button_json as GameDataResourceGroup
)
const gnb2depthButtonData = computed(
const start2depthData = computed(
() => gnbData.value?.buttons[1]?.button_json as GameDataResourceGroupSet
)
const supportedPlatforms = computed(
() =>
getSupportedPlatforms(
gameData.value?.os_type,
gameData.value?.platform_type
gameData.value?.platform_type,
gameData.value?.os_type
) as PlatformTransformType[]
)
const isStartPCVisible = computed(() => {
return device.isDesktop && gameData.value?.platform_type !== '2'
})
// 자식 중 활성 링크 존재 여부 확인
const hasActiveChild = (children?: GameDataMenuChildren) => {
@@ -184,7 +185,7 @@ const showNotSupportedOSAlert = () => {
}
const handleStartClick = () => {
if (device.isDesktop) return
if (isStartPCVisible.value) return
const target = device.isAndroid
? 'google_play'
@@ -262,14 +263,14 @@ onMounted(() => {
<template v-if="hasGnbMenus">
<div class="official custom-theme-scrollbar">
<div
v-for="(gnbItem, key) in gnbData?.menus"
:key="key"
v-for="(gnbItem, index) in gnbData?.menus"
:key="index"
class="nav-item group"
:class="{
'is-hidden':
breakpoints.isDesktop &&
overflowCount > 0 &&
Number(key) >=
Number(index) >=
Object.keys(gnbData?.menus).length - overflowCount,
}"
>
@@ -333,13 +334,13 @@ onMounted(() => {
<div class="more-list">
<div class="list-inner">
<div
v-for="(gnbItem, key) in gnbData?.menus"
:key="key"
v-for="(gnbItem, index) in gnbData?.menus"
:key="index"
:class="{
'is-hidden':
breakpoints.isDesktop &&
overflowCount > 0 &&
Number(key) >=
Number(index) >=
Object.keys(gnbData?.menus).length - overflowCount,
}"
>
@@ -422,30 +423,30 @@ onMounted(() => {
</nav>
<ClientOnly>
<div ref="startRef" class="btn-start">
<template v-if="gnb1depthButtonData">
<template v-if="start1depthData">
<component
:is="
device.isDesktop ? 'BlocksButtonLauncher' : 'AtomsButton'
isStartPCVisible ? 'BlocksButtonLauncher' : 'AtomsButton'
"
type="custom"
platform="pc"
:background-color="
getColorCodeFromData(gnb1depthButtonData?.btn_info, 'btn')
getColorCodeFromData(start1depthData?.btn_info, 'btn')
"
:text-color="
getColorCodeFromData(gnb1depthButtonData?.btn_info, 'txt')
getColorCodeFromData(start1depthData?.btn_info, 'txt')
"
@click="handleStartClick"
>
{{ gnb1depthButtonData?.btn_info?.txt_btn_name }}
{{ start1depthData?.btn_info?.txt_btn_name }}
</component>
<div
v-if="breakpoints.isDesktop && gnb2depthButtonData"
v-if="breakpoints.isDesktop && start2depthData"
class="nav-2depth"
>
<ul>
<li v-for="(item, key) in gnb2depthButtonData" :key="key">
<BlocksButtonLauncher type="custom" :platform="key">
<li v-for="(item, index) in start2depthData" :key="index">
<BlocksButtonLauncher type="custom" :platform="index">
{{ item.btn_info?.txt_btn_name }}
</BlocksButtonLauncher>
</li>