136 lines
3.6 KiB
Vue
136 lines
3.6 KiB
Vue
<script setup lang="ts">
|
|
import { getSitemapPageGroups } from '~/data/sitemap-pages'
|
|
|
|
const { locale } = useSiteLocale()
|
|
|
|
const { data: mediaResponse } = await useAsyncData(
|
|
() => `sitemap-media-${locale.value}`,
|
|
() => $fetch<{ code: number; data: { items: import('~/data/news-content').MediaPublicItem[] } }>('/api/news', {
|
|
query: { locale: locale.value },
|
|
}),
|
|
{ watch: [locale] }
|
|
)
|
|
|
|
const groups = computed(() => {
|
|
const mediaItems =
|
|
mediaResponse.value?.code === 200 ? (mediaResponse.value.data?.items ?? []) : []
|
|
return getSitemapPageGroups(locale.value, mediaItems)
|
|
})
|
|
|
|
usePageSeo({
|
|
title: () => formatPageTitle(locale.value === 'zh' ? '站点地图' : 'Sitemap', locale.value),
|
|
description: () =>
|
|
locale.value === 'zh'
|
|
? '优医官网站点地图:浏览全部主要页面、媒体中心、健康体检套餐与患者指南。'
|
|
: 'UMedGlobal sitemap: browse all main pages, media center, health screening packages, and patient guides.',
|
|
path: '/sitemap',
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<div class="sitemap-page">
|
|
<section class="sitemap-hero" :aria-label="locale === 'zh' ? '站点地图' : 'Sitemap'">
|
|
<div class="container sitemap-hero__inner">
|
|
<h1 class="sitemap-hero__title">{{ locale === 'zh' ? '站点地图' : 'Sitemap' }}</h1>
|
|
<p class="sitemap-hero__desc">
|
|
{{
|
|
locale === 'zh'
|
|
? '浏览优医官网全部主要页面,按分类整理如下。媒体中心内容随后台发布自动更新。'
|
|
: 'Browse all main pages on the UMedGlobal website, organized by section below. Media Center entries update automatically when new content is published.'
|
|
}}
|
|
</p>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="sitemap-body" aria-label="Sitemap links">
|
|
<div class="container sitemap-body__inner">
|
|
<div v-for="group in groups" :key="group.title" class="sitemap-group">
|
|
<h2 class="sitemap-group__title">{{ group.title }}</h2>
|
|
<ul class="sitemap-group__list">
|
|
<li v-for="item in group.items" :key="item.path + item.label">
|
|
<a
|
|
v-if="item.external"
|
|
:href="item.href"
|
|
class="sitemap-group__link"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
>
|
|
{{ item.label }}
|
|
</a>
|
|
<NuxtLink v-else :to="item.href" class="sitemap-group__link">{{ item.label }}</NuxtLink>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.sitemap-page {
|
|
background: #fff;
|
|
}
|
|
|
|
.sitemap-hero {
|
|
padding: 56px 0 32px;
|
|
background: linear-gradient(180deg, #f4fafb 0%, #fff 100%);
|
|
}
|
|
|
|
.sitemap-hero__title {
|
|
margin: 0 0 12px;
|
|
font-size: clamp(1.75rem, 4vw, 2.25rem);
|
|
color: var(--ink);
|
|
}
|
|
|
|
.sitemap-hero__desc {
|
|
margin: 0;
|
|
max-width: 42rem;
|
|
color: var(--muted);
|
|
line-height: 1.7;
|
|
}
|
|
|
|
.sitemap-body {
|
|
padding: 24px 0 72px;
|
|
}
|
|
|
|
.sitemap-body__inner {
|
|
display: grid;
|
|
gap: 32px;
|
|
}
|
|
|
|
@media (min-width: 900px) {
|
|
.sitemap-body__inner {
|
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
}
|
|
}
|
|
|
|
.sitemap-group__title {
|
|
margin: 0 0 16px;
|
|
padding-bottom: 10px;
|
|
border-bottom: 2px solid rgba(13, 148, 136, 0.2);
|
|
font-size: 1.125rem;
|
|
color: var(--ink);
|
|
}
|
|
|
|
.sitemap-group__list {
|
|
margin: 0;
|
|
padding: 0;
|
|
list-style: none;
|
|
}
|
|
|
|
.sitemap-group__list li + li {
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.sitemap-group__link {
|
|
color: var(--teal);
|
|
text-decoration: none;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.sitemap-group__link:hover {
|
|
text-decoration: underline;
|
|
text-underline-offset: 2px;
|
|
}
|
|
</style>
|