+
import { globalDateFormat } from '@seed-next/date'
-import { useCheckGameStart } from '#layers/composables/useGameStart'
const config = useRuntimeConfig()
@@ -208,6 +236,7 @@ const launchingStatus = computed(() => {
//gameData.value.market_json 값 중 use_yn === 1 인 항목만 배열로 변환
const enabledMarkets = computed(() => {
+ const platformType = Number(gameData.value.platform_type)
const markets = Object.entries(gameData.value.market_json)
// return Object.entries(market_json)
.filter(([, info]: [string, any]) => info && info.use_yn === 1)
@@ -216,8 +245,26 @@ const enabledMarkets = computed(() => {
url: info.url as string,
}))
+ // platform_type이 1이면 app_store, google_play 제외하고 pc 추가
+ if (platformType === 1) {
+ const filteredMarkets = markets.filter(m => m.platform !== 'app_store' && m.platform !== 'google_play')
+ const hasPc = filteredMarkets.some(m => m.platform === 'pc')
+ if (!hasPc) {
+ filteredMarkets.unshift({
+ platform: 'pc',
+ url: '',
+ })
+ }
+ return filteredMarkets
+ }
+
+ // platform_type이 2이면 pc 제외
+ if (platformType === 2) {
+ return markets.filter(m => m.platform !== 'pc')
+ }
+
// platform_type이 3이면 pc 항목 추가
- if (Number(gameData.value.platform_type) === 3) {
+ if (platformType === 3) {
const hasPc = markets.some(m => m.platform === 'pc')
if (!hasPc) {
markets.unshift({
@@ -248,7 +295,13 @@ const handleCommunityClick = () => {
// 버튼 클래스 결정 함수
const getButtonClass = (platform: string) => {
// pc가 있으면 pc만 flex-1, 나머지는 기본
- return `flex-1 btn-platform-${platform}`
+
+ // platform_type이 3일 때 조건 추가
+ if (Number(gameData.value.platform_type) !== 2 && platform === 'pc') {
+ return `flex-1 btn-platform-${platform}`
+ }
+
+ return `btn-platform-${platform}`
}
const getButtonText = (platform: string) => {
@@ -262,21 +315,21 @@ const getButtonText = (platform: string) => {
return key ? tm(key) : ''
}
-const { validateLauncher } = useCheckGameStart()
const handleGameStart = () => {
- if (device.isDesktop) {
- validateLauncher()
- } else if (device.isIos) {
- window.open(gameData.value.market_json.app_store.url, '_blank')
- } else if (device.isAndroid) {
- window.open(gameData.value.market_json.google_play.url, '_blank')
- }
+
+ const os = device.isAndroid ? 'google_play' : device.isApple ? 'app_store' : 'google_play'
+
+ //const os = device.isAndroid ? 'google_play' : device.isApple ? 'app_store' : 'pc'
+
+ // platform_type이 2이면서 device.isDesktop이면 window.open(gameData.value.market_json[os].url, '_blank')
+
+ window.open(gameData.value.market_json[os].url, '_blank')
}
onMounted(() => {
loadingStore.stopFullLoading()
- console.log("🚀 ~ 3333 onMounted ~ device:", device)
+ console.log("🚀 ~ 3333 onMounted ~ enabledMarkets:", enabledMarkets.value)
})
@@ -359,7 +412,7 @@ definePageMeta({
}
.inspection-btn {
- @apply flex items-center justify-center gap-1 px-2 md:px-8 w-auto h-10 md:h-12 rounded-lg;
+ @apply flex items-center justify-center gap-1 px-2 md:px-4 h-10 md:h-12 rounded-lg;
cursor: pointer;
transition: all 0.2s;
}
@@ -421,20 +474,34 @@ definePageMeta({
@apply bg-gray-50;
}
.inspection-download-card .btn-platform-pc {
- @apply w-auto hidden md:block flex-1;
+ @apply w-auto flex-1;
}
-:deep(.inspection-download-card .btn-platform-app_store) {
- @apply px-2 md:px-4;
+.inspection-download-card.platform-type-3 .btn-platform-pc {
+ @apply w-full flex-none hidden md:flex md:flex-1;
+}
+
+
+.inspection-download-card .btn-platform-app_store {
+ @apply flex-1 px-2 md:px-4;
+}
+.inspection-download-card.platform-type-3 .btn-platform-app_store, .inspection-download-card.platform-type-3 .btn-platform-google_play {
+ @apply flex-1 px-2 md:px-4 md:flex-none;
}
:deep(.inspection-download-card .btn-platform-app_store .text) {
@apply block md:hidden;
}
+:deep(.inspection-download-card.platform-type-2 .btn-platform-app_store .text) {
+ @apply block md:block;
+}
:deep(.inspection-download-card .btn-platform-google_play) {
- @apply px-2 md:px-4;
+ @apply flex-1 px-2 md:px-4;
}
:deep(.inspection-download-card .btn-platform-google_play .text) {
@apply block md:hidden;
}
+:deep(.inspection-download-card.platform-type-2 .btn-platform-google_play .text) {
+ @apply block md:block;
+}
:deep(.inspection-download-card .btn-base.single .icon-platform) {
@apply mr-2 md:mr-0;
}
@@ -442,6 +509,17 @@ definePageMeta({
@apply bg-[var(--primary)] border-[var(--primary)] text-[#000];
}
+.inspection-btn-primary.btn-base:deep(.text) {
+ @apply flex flex-1 items-center justify-center gap-1;
+}
+.inspection-btn-primary.btn-base:deep(.icon-platform) {
+ @apply hidden;
+}
+
+.inspection-btn-primary.btn-base {
+ @apply bg-[var(--primary)] border-[var(--primary)] text-[#000];
+}
+
.inspection-btn-primary.btn-base:deep(.text) {
@apply flex flex-1 items-center justify-center gap-1;
}