提交正式官网

This commit is contained in:
parkiss
2026-07-09 14:35:32 +08:00
parent 5efbd6760e
commit e09f0eccda
792 changed files with 91499 additions and 0 deletions
+318
View File
@@ -0,0 +1,318 @@
<script setup lang="ts">
import { officialSocialLinks } from '~/data/social-links'
import { siteVisibility } from '~/data/site-visibility'
const { locale, t } = useSiteLocale()
const localePath = useLocalePath()
const brandName = computed(() => (locale.value === 'zh' ? '优医' : 'UMedGlobal'))
const brandLogoSrc = computed(() => (locale.value === 'zh' ? '/images/logo-zh.png' : '/images/logo-en.png'))
const footerRef = ref<HTMLElement | null>(null)
const brandRef = ref<HTMLElement | null>(null)
const logoRef = ref<HTMLImageElement | null>(null)
function logFooterSpacing(runId = 'pre-fix') {
if (!import.meta.client) return
const footer = footerRef.value
const brand = brandRef.value
const logo = logoRef.value
if (!footer || !brand || !logo) return
const footerStyle = getComputedStyle(footer)
const brandRect = brand.getBoundingClientRect()
const logoRect = logo.getBoundingClientRect()
const nextCol = brand.nextElementSibling as HTMLElement | null
const nextColRect = nextCol?.getBoundingClientRect()
const gapBelowLogo = nextColRect ? nextColRect.top - brandRect.bottom : null
const payload = {
sessionId: '927038',
runId,
hypothesisId: 'H1-H5',
location: 'AppFooter.vue:logFooterSpacing',
message: 'Footer logo spacing metrics',
data: {
viewportWidth: window.innerWidth,
isMobile: window.innerWidth <= 900,
footerPaddingTop: footerStyle.paddingTop,
footerPaddingBottom: footerStyle.paddingBottom,
logoFooterW: footerStyle.getPropertyValue('--logo-footer-w').trim(),
logoFooterH: footerStyle.getPropertyValue('--logo-footer-h').trim(),
brandHeight: brandRect.height,
brandWidth: brandRect.width,
logoHeight: logoRect.height,
logoWidth: logoRect.width,
logoNaturalWidth: logo.naturalWidth,
logoNaturalHeight: logo.naturalHeight,
gapBelowLogo,
logoComputedHeight: getComputedStyle(logo).height
},
timestamp: Date.now()
}
// #region agent log
fetch('http://127.0.0.1:7676/ingest/3b074580-31ab-4fec-9744-9bd165eddda6', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '927038' },
body: JSON.stringify(payload)
}).catch(() => {})
// #endregion
}
onMounted(() => {
nextTick(() => {
logFooterSpacing('pre-fix')
if (logoRef.value?.complete) return
logoRef.value?.addEventListener('load', () => logFooterSpacing('pre-fix-loaded'), { once: true })
})
})
</script>
<template>
<footer id="contact" ref="footerRef" class="ft">
<div class="ft__inner container">
<div ref="brandRef" class="ft__brand">
<div class="ft__logo-box">
<img
ref="logoRef"
:src="brandLogoSrc"
:alt="brandName"
class="ft__logo"
:class="{ 'ft__logo--en': locale === 'en' }"
/>
</div>
</div>
<div id="about" class="ft__col ft__col--brand">
<h3 class="ft__h">{{ t('footer.brandTitle') }}</h3>
<p>{{ t('footer.brandText') }}</p>
<div class="ft__social" :aria-label="t('footer.socialAriaLabel')">
<p class="ft__social-title">{{ t('footer.socialTitle') }}</p>
<div class="ft__social-links">
<a
:href="officialSocialLinks.tiktok"
target="_blank"
rel="noopener noreferrer"
class="ft__social-btn"
:title="t('footer.socialTikTok')"
:aria-label="t('footer.socialTikTok')"
>
<svg viewBox="0 0 24 24" aria-hidden="true">
<path
fill="currentColor"
d="M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-5.2 1.74 2.89 2.89 0 0 1 2.31-4.64 2.93 2.93 0 0 1 .88.13V9.4a6.84 6.84 0 0 0-1-.05A6.33 6.33 0 0 0 5 20.1a6.34 6.34 0 0 0 10.86-4.43v-7a8.16 8.16 0 0 0 4.77 1.52v-3.4a4.85 4.85 0 0 1-1-.1z"
/>
</svg>
</a>
<a
:href="officialSocialLinks.youtube"
target="_blank"
rel="noopener noreferrer"
class="ft__social-btn"
:title="t('footer.socialYouTube')"
:aria-label="t('footer.socialYouTube')"
>
<svg viewBox="0 0 24 24" aria-hidden="true">
<path
fill="currentColor"
d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"
/>
</svg>
</a>
<a
v-if="siteVisibility.showXiaohongshuSocial"
:href="officialSocialLinks.xiaohongshu"
target="_blank"
rel="noopener noreferrer"
class="ft__social-btn"
:title="t('footer.socialXiaohongshu')"
:aria-label="t('footer.socialXiaohongshu')"
>
<svg viewBox="0 0 24 24" aria-hidden="true">
<path
fill="currentColor"
d="M6 2h12a1 1 0 0 1 1 1v18l-2.5-1.5L14 21l-2.5-1.5L9 21l-2.5-1.5L4 21V3a1 1 0 0 1 1-1z"
/>
</svg>
</a>
<a
:href="officialSocialLinks.whatsapp"
target="_blank"
rel="noopener noreferrer"
class="ft__social-btn"
:title="t('footer.socialWhatsApp')"
:aria-label="t('footer.socialWhatsApp')"
>
<svg viewBox="0 0 24 24" aria-hidden="true">
<path
fill="currentColor"
d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.435 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413z"
/>
</svg>
</a>
</div>
</div>
</div>
<div class="ft__col">
<h3 class="ft__h">{{ t('footer.contactTitle') }}</h3>
<p class="ft__line"><strong>{{ t('footer.globalHq') }}</strong></p>
<p class="ft__line">{{ t('footer.location') }}</p>
<p class="ft__line ft__muted">{{ t('footer.tagline') }}</p>
<p class="ft__line" style="margin-top:14px;"><strong>{{ t('footer.emailSupport') }}</strong></p>
<p class="ft__line"><NuxtLink class="ft__link" :to="localePath('/free-assessment')">{{ t('footer.sendInquiry') }}</NuxtLink></p>
<p class="ft__line ft__muted">{{ t('footer.responseTime') }}</p>
</div>
</div>
<div class="ft__bottom container">
<p class="ft__copy">{{ t('footer.copyright') }}</p>
<p class="ft__policies">
<NuxtLink :to="localePath('/privacy-policy')" class="ft__policy-link">{{ t('footer.privacyPolicy') }}</NuxtLink>
<span class="ft__policy-sep" aria-hidden="true">·</span>
<NuxtLink :to="localePath('/terms-of-use')" class="ft__policy-link">{{ t('footer.termsOfUse') }}</NuxtLink>
<span class="ft__policy-sep" aria-hidden="true">·</span>
<NuxtLink :to="localePath('/accessibility-statement')" class="ft__policy-link">{{ t('footer.accessibilityStatement') }}</NuxtLink>
<span class="ft__policy-sep" aria-hidden="true">·</span>
<NuxtLink :to="localePath('/sitemap')" class="ft__policy-link">{{ t('footer.sitemap') }}</NuxtLink>
</p>
<p class="ft__disclaimer">{{ t('footer.disclaimer') }}</p>
</div>
</footer>
</template>
<style scoped>
.ft {
background: var(--teal);
color: #fff;
padding: 56px 0 28px;
}
.ft__inner {
display: grid;
grid-template-columns: 180px 1fr 1fr;
gap: 40px;
align-items: start;
}
.ft__brand {
max-width: none;
}
.ft__logo-box {
width: fit-content;
max-width: 100%;
display: inline-flex;
align-items: center;
background: #fff;
border-radius: 16px;
padding: 12px 16px;
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.ft__logo {
display: block;
height: var(--logo-footer-h);
max-height: var(--logo-footer-h);
width: auto;
max-width: 100%;
object-fit: contain;
object-position: left center;
}
.ft__logo--en {
transform: scale(var(--logo-en-scale));
transform-origin: left center;
}
.ft__h {
font-size: 20px;
font-weight: 800;
margin-bottom: 16px;
}
.ft__col p { font-size: 15px; opacity: .96; }
.ft__col--brand {
margin-top: 8px;
}
.ft__social {
margin-top: 18px;
}
.ft__social-title {
font-size: 15px;
font-weight: 700;
margin-bottom: 10px;
}
.ft__social-links {
display: flex;
align-items: center;
gap: 14px;
}
.ft__social-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.16);
color: #fff;
transition: background 0.2s ease, transform 0.2s ease;
}
.ft__social-btn:hover {
background: rgba(255, 255, 255, 0.28);
transform: translateY(-1px);
}
.ft__social-btn svg {
width: 18px;
height: 18px;
display: block;
}
.ft__line { margin: 2px 0; }
.ft__muted { opacity: .8; font-size: 14px; }
.ft__link { color: #fff; text-decoration: underline; }
.ft__link:hover { opacity: .85; }
.ft__bottom {
margin-top: 44px;
padding-top: 22px;
border-top: 1px solid rgba(255, 255, 255, .35);
}
.ft__copy { text-align: center; font-weight: 600; }
.ft__policies {
text-align: center;
margin: 10px 0 16px;
font-size: 14px;
}
.ft__policy-link {
color: #fff;
text-decoration: underline;
text-underline-offset: 3px;
}
.ft__policy-link:hover { opacity: .85; }
.ft__policy-sep { margin: 0 8px; opacity: .6; }
.ft__disclaimer {
text-align: left;
font-size: 13px;
line-height: 1.55;
opacity: .88;
max-width: 920px;
}
@media (max-width: 900px) {
.ft {
padding: 32px 0 20px;
--logo-footer-w: 120px;
--logo-footer-h: 96px;
}
.ft__inner {
grid-template-columns: 1fr;
gap: 12px;
}
.ft__brand {
margin-bottom: 0;
line-height: 0;
}
.ft__col--brand {
margin-top: 0;
}
.ft__bottom {
margin-top: 28px;
padding-top: 16px;
}
}
</style>
+863
View File
@@ -0,0 +1,863 @@
<script setup lang="ts">
import type { RouteLocationRaw } from 'vue-router'
import {
NavigationMenuRoot,
NavigationMenuList,
NavigationMenuItem,
NavigationMenuTrigger,
NavigationMenuContent,
NavigationMenuLink
} from 'reka-ui'
import { getPatientGuideDropdown } from '~/data/patient-guide-nav'
import {
getHealthScreeningsDropdown,
healthScreeningsOverviewPath
} from '~/data/health-screenings-nav'
import { siteVisibility } from '~/data/site-visibility'
import { stripLocalePrefix } from '~/utils/locale-path'
type NavLabelLines = readonly [string, string]
type NavLinkItem = {
kind: 'link'
label: string
/** 两行展示,减轻顶栏横向挤压 */
lines?: NavLabelLines
to: RouteLocationRaw
navKey: string
}
type NavDropdownItem = {
kind: 'dropdown'
label: string
lines?: NavLabelLines
items: readonly { label: string; to: string }[]
/** 点击主标签进入的页面(如 Health Screenings 总览) */
to?: RouteLocationRaw
navKey: string
}
type NavItem = NavLinkItem | NavDropdownItem
function navLines(item: { label: string; lines?: NavLabelLines }): readonly string[] {
return item.lines ?? [item.label]
}
const route = useRoute()
const { locale, t, tr } = useSiteLocale()
const localePath = useLocalePath()
const switchLocale = useSwitchLocale()
const brandName = computed(() => (locale.value === 'zh' ? '优医' : 'UMedGlobal'))
const brandLogoSrc = '/images/logo.png'
const open = ref(false)
const searchOpen = ref(false)
/** Reka NavigationMenu 当前展开项(空字符串表示全部收起)。打开/关闭/悬停延时/键盘/外部点击均由 Reka 托管 */
const activeMenu = ref('')
const langSelect = computed({
get: () => (locale.value === 'zh' ? t('search.chinese') : t('search.english')),
set: (value: string) => {
switchLocale(value === t('search.chinese') ? 'zh' : 'en')
}
})
const navItems = computed<NavItem[]>(() => {
const lp = localePath
return [
{ kind: 'link', navKey: 'home', label: t('nav.home'), to: { path: lp('/') } },
{
kind: 'dropdown',
navKey: 'patientGuide',
label: t('nav.patientGuide'),
lines: tr<NavLabelLines>('nav.patientGuideLines'),
items: getPatientGuideDropdown(locale.value).map((item) => ({
...item,
to: lp(item.to)
}))
},
{
kind: 'link',
navKey: 'featuredHospitals',
label: t('nav.featuredHospitals'),
lines: tr<NavLabelLines>('nav.featuredHospitalsLines'),
to: { path: lp('/hospitals') }
},
{
kind: 'link',
navKey: 'featuredSpecialists',
label: t('nav.featuredSpecialists'),
lines: tr<NavLabelLines>('nav.featuredSpecialistsLines'),
to: { path: lp('/doctors') }
},
{
kind: 'dropdown',
navKey: 'healthScreenings',
label: t('nav.healthScreenings'),
lines: tr<NavLabelLines>('nav.healthScreeningsLines'),
to: { path: lp(healthScreeningsOverviewPath) },
items: getHealthScreeningsDropdown(locale.value).map((item) => ({
...item,
to: lp(item.to)
}))
},
{ kind: 'link', navKey: 'services', label: t('nav.services'), to: { path: lp('/services') } },
{
kind: 'link',
navKey: 'freeAssessment',
label: t('nav.freeAssessment'),
lines: tr<NavLabelLines>('nav.freeAssessmentLines'),
to: { path: lp('/free-assessment') }
},
{ kind: 'link', navKey: 'successStory', label: t('nav.successStory'), to: { path: lp('/cases') } },
{ kind: 'link', navKey: 'news', label: t('nav.news'), to: { path: lp('/news') } },
{ kind: 'link', navKey: 'aboutUs', label: t('nav.aboutUs'), to: { path: lp('/about-us') } },
{ kind: 'link', navKey: 'faq', label: t('nav.faq'), to: { path: lp('/faq') } },
{
kind: 'link',
navKey: 'partnerWithUs',
label: t('nav.partnerWithUs'),
lines: tr<NavLabelLines>('nav.partnerWithUsLines'),
to: { path: lp('/partner-with-us') }
}
]
})
const visibleNavItems = computed(() =>
navItems.value.filter((item) => siteVisibility.showFaqPage || item.navKey !== 'faq')
)
/** 仅首页路径下高亮 HOME(原型:蓝色 + 下划线只出现在首页导航) */
const routeBasePath = computed(() => stripLocalePrefix(route.path))
const isHomePage = computed(() => routeBasePath.value === '/')
const isHealthScreeningsSection = computed(() =>
routeBasePath.value.startsWith('/health-screenings')
)
function isNavItemActive(item: NavItem): boolean {
if (item.kind === 'link') {
if (item.navKey === 'home') return isHomePage.value
if (item.navKey === 'featuredHospitals') return routeBasePath.value === '/hospitals'
if (item.navKey === 'featuredSpecialists') return routeBasePath.value === '/doctors'
if (item.navKey === 'services') return routeBasePath.value === '/services'
if (item.navKey === 'freeAssessment') return routeBasePath.value === '/free-assessment'
if (item.navKey === 'successStory') return routeBasePath.value === '/cases'
if (item.navKey === 'news') return routeBasePath.value === '/news'
if (item.navKey === 'aboutUs') return routeBasePath.value === '/about-us'
if (item.navKey === 'faq') return routeBasePath.value === '/faq'
if (item.navKey === 'partnerWithUs') return routeBasePath.value === '/partner-with-us'
if (item.to && typeof item.to === 'string') return routeBasePath.value === stripLocalePrefix(item.to)
if (item.to && typeof item.to === 'object' && 'path' in item.to) {
const path = stripLocalePrefix(item.to.path as string)
if (item.to.hash) return routeBasePath.value === path && route.hash === item.to.hash
return routeBasePath.value === path && !route.hash
}
}
if (item.kind === 'dropdown' && item.navKey === 'healthScreenings') {
return isHealthScreeningsSection.value
}
return false
}
function closeAllMenus() {
open.value = false
activeMenu.value = ''
if (import.meta.client && document.activeElement instanceof HTMLElement) {
document.activeElement.blur()
}
}
watch(() => route.fullPath, closeAllMenus)
</script>
<template>
<header class="hdr" :class="{ 'hdr--zh': locale === 'zh' }">
<div class="hdr__inner">
<NuxtLink :to="localePath('/')" class="hdr__logo" :aria-label="`${brandName} Home`">
<img
:src="brandLogoSrc"
:alt="brandName"
class="hdr__logo-img"
/>
</NuxtLink>
<button
class="hdr__burger"
:aria-expanded="open"
:aria-label="t('search.toggleMenu')"
@click="open = !open"
>
<span></span><span></span><span></span>
</button>
<NavigationMenuRoot
v-model="activeMenu"
as-child
:delay-duration="0"
:skip-delay-duration="300"
>
<nav class="hdr__nav-root">
<NavigationMenuList as-child>
<ul class="hdr__nav" :class="{ 'is-open': open }">
<template v-for="item in visibleNavItems" :key="item.navKey">
<NavigationMenuItem
v-if="item.kind === 'dropdown'"
:value="item.navKey"
as-child
>
<li class="hdr__nav-item">
<div
class="hdr__dropdown"
:class="{
'is-open': activeMenu === item.navKey,
'hdr__dropdown--wide': item.navKey === 'healthScreenings'
}"
>
<div
class="hdr__pill"
:class="{
'hdr__pill--active': isNavItemActive(item),
'is-open': activeMenu === item.navKey
}"
>
<NavigationMenuLink v-if="item.to" as-child>
<NuxtLink
:to="item.to"
class="hdr__pill-main"
@click="closeAllMenus"
>
<span
class="hdr__label"
:class="{ 'hdr__label--stacked': item.lines }"
>
<span
v-for="(line, li) in navLines(item)"
:key="li"
class="hdr__label-line"
>{{ line }}</span>
</span>
</NuxtLink>
</NavigationMenuLink>
<NavigationMenuTrigger v-else as-child>
<button type="button" class="hdr__pill-main hdr__pill-trigger">
<span
class="hdr__label"
:class="{ 'hdr__label--stacked': item.lines }"
>
<span
v-for="(line, li) in navLines(item)"
:key="li"
class="hdr__label-line"
>{{ line }}</span>
</span>
</button>
</NavigationMenuTrigger>
<NavigationMenuTrigger as-child>
<button
type="button"
class="hdr__pill-chevron"
:aria-label="`${item.label} ${t('nav.submenu')}`"
>
<svg
class="hdr__chevron-icon"
width="10"
height="10"
viewBox="0 0 10 10"
aria-hidden="true"
>
<path
d="M2 3.5 5 6.5 8 3.5"
fill="none"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</button>
</NavigationMenuTrigger>
</div>
<NavigationMenuContent force-mount as-child>
<div class="hdr__dropdown-panel">
<NavigationMenuLink
v-for="sub in item.items"
:key="sub.to"
as-child
>
<NuxtLink
:to="sub.to"
class="hdr__dropdown-link"
@click="closeAllMenus"
>
{{ sub.label }}
</NuxtLink>
</NavigationMenuLink>
</div>
</NavigationMenuContent>
</div>
</li>
</NavigationMenuItem>
<NavigationMenuItem v-else as-child>
<li class="hdr__nav-item">
<NavigationMenuLink as-child>
<NuxtLink
:to="item.to"
class="hdr__pill hdr__pill--link"
:class="{
'hdr__pill--active': isNavItemActive(item),
'hdr__pill--home': item.navKey === 'home'
}"
active-class=""
exact-active-class=""
@click="closeAllMenus"
>
<span
class="hdr__label"
:class="{ 'hdr__label--stacked': item.lines }"
>
<span
v-for="(line, li) in navLines(item)"
:key="li"
class="hdr__label-line"
>{{ line }}</span>
</span>
</NuxtLink>
</NavigationMenuLink>
</li>
</NavigationMenuItem>
</template>
</ul>
</NavigationMenuList>
</nav>
</NavigationMenuRoot>
<div class="hdr__tools">
<button
class="hdr__search"
:aria-label="t('search.searchSite')"
@click="searchOpen = true"
>
<img src="/images/search.png" alt="" />
</button>
<select v-model="langSelect" class="hdr__lang" :aria-label="t('search.language')">
<option :value="t('search.english')">{{ t('search.english') }}</option>
<option :value="t('search.chinese')">{{ t('search.chinese') }}</option>
</select>
</div>
</div>
<SiteSearchModal v-model="searchOpen" />
</header>
</template>
<style scoped>
.hdr {
position: sticky;
top: 0;
z-index: 100;
background: rgba(255, 255, 255, 0.94);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border-bottom: 1px solid #e8eef4;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 4px 20px rgba(15, 45, 85, 0.06);
}
.hdr__inner {
max-width: var(--maxw-header);
margin: 0 auto;
padding: 6px 24px;
min-height: var(--header-h);
display: flex;
align-items: center;
gap: 16px;
}
.hdr__logo {
flex-shrink: 0;
line-height: 0;
}
.hdr__logo img {
height: 56px;
width: auto;
}
.hdr__logo-img {
display: block;
}
/* Reka NavigationMenuRoot 包裹层不参与布局,flex 仍由 .hdr__nav 承担 */
.hdr__nav-root {
display: contents;
}
/* Reka 在 Root 内部注入的相对定位 div,扁平化以保持原有 flex 链路 */
.hdr__nav-root > div {
display: contents;
}
/* NavigationMenuItem(<li>) 不生成盒子,让内部 pill/dropdown 直接成为 .hdr__nav 的 flex 子项 */
.hdr__nav-item {
display: contents;
}
.hdr__nav {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
align-content: center;
gap: 5px 4px;
flex: 0 1 auto;
min-width: 0;
list-style: none;
margin: 0 0 0 50px;
padding: 0;
}
/* 导航胶囊 */
.hdr__pill {
display: inline-flex;
align-items: stretch;
max-width: 100%;
border-radius: 10px;
border: 1px solid transparent;
background: transparent;
transition:
background 0.18s ease,
border-color 0.18s ease,
box-shadow 0.18s ease;
}
.hdr__pill--link {
padding: 5px 11px;
text-decoration: none;
color: inherit;
cursor: pointer;
}
.hdr__pill:hover,
.hdr__dropdown:hover .hdr__pill,
.hdr__pill.is-open {
background: #48a4fc;
border-color: #48a4fc;
}
.hdr__pill:hover .hdr__label-line,
.hdr__dropdown:hover .hdr__pill .hdr__label-line,
.hdr__pill.is-open .hdr__label-line,
.hdr__pill--active .hdr__label-line,
.hdr__pill--active:hover .hdr__label-line,
.hdr__dropdown:hover .hdr__pill--active .hdr__label-line {
color: #fff;
}
.hdr__pill:hover .hdr__pill-chevron,
.hdr__dropdown:hover .hdr__pill-chevron,
.hdr__pill.is-open .hdr__pill-chevron,
.hdr__pill--active .hdr__pill-chevron,
.hdr__pill--active:hover .hdr__pill-chevron,
.hdr__dropdown:hover .hdr__pill--active .hdr__pill-chevron {
color: #fff;
}
.hdr__pill--active,
.hdr__pill--active:hover,
.hdr__dropdown:hover .hdr__pill--active {
background: transparent;
border-color: transparent;
box-shadow: none;
}
.hdr__pill--active .hdr__label-line,
.hdr__pill--active:hover .hdr__label-line,
.hdr__dropdown:hover .hdr__pill--active .hdr__label-line {
color: #2a3d52;
}
.hdr__pill--active .hdr__pill-chevron,
.hdr__pill--active:hover .hdr__pill-chevron,
.hdr__dropdown:hover .hdr__pill--active .hdr__pill-chevron {
color: #6b7f94;
}
.hdr__pill--home.hdr__pill--active {
color: #48a4fc;
}
.hdr__pill-main {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 5px 8px 5px 11px;
border: none;
background: transparent;
cursor: pointer;
font-family: inherit;
color: inherit;
text-decoration: none;
border-radius: 10px 0 0 10px;
}
.hdr__pill-chevron {
display: inline-flex;
align-items: center;
justify-content: center;
width: auto;
padding: 5px 10px 5px 2px;
border: none;
background: transparent;
color: #6b7f94;
cursor: pointer;
border-radius: 0 10px 10px 0;
flex-shrink: 0;
transition: color 0.15s ease, background 0.15s ease;
}
.hdr__pill-chevron:hover {
color: var(--blue);
background: rgba(72, 164, 252, 0.08);
}
.hdr__chevron-icon {
display: block;
transition: transform 0.2s ease;
}
.hdr__dropdown:hover .hdr__chevron-icon,
.hdr__pill.is-open .hdr__chevron-icon {
transform: rotate(180deg);
}
.hdr__label {
display: inline-block;
text-align: center;
line-height: 1.2;
}
.hdr__label--stacked {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
}
.hdr__label-line {
display: block;
white-space: nowrap;
font-size: 12.5px;
font-weight: 600;
letter-spacing: 0.01em;
color: #2a3d52;
}
.hdr__pill--active .hdr__label-line {
color: #48a4fc;
}
.hdr__pill--home .hdr__label-line {
font-size: 13px;
letter-spacing: 0.06em;
}
.hdr__dropdown {
position: relative;
flex-shrink: 0;
}
/* 桌面端:填补触发按钮与下拉面板之间的空隙,避免移入菜单时误触发关闭 */
@media (min-width: 1025px) {
.hdr__tools {
margin-left: 50px;
}
.hdr__dropdown.is-open::after {
content: '';
position: absolute;
left: -12px;
right: -12px;
top: 100%;
height: 18px;
z-index: 119;
}
}
.hdr__dropdown--wide .hdr__dropdown-panel {
min-width: 360px;
max-width: 400px;
}
.hdr__dropdown-panel {
position: absolute;
top: calc(100% + 4px);
left: 50%;
transform: translateX(-50%) translateY(4px);
min-width: 280px;
max-width: 340px;
padding: 8px;
background: #fff;
border: 1px solid #e2eaf2;
border-radius: 12px;
box-shadow:
0 4px 6px rgba(15, 45, 85, 0.04),
0 16px 40px rgba(15, 45, 85, 0.1);
opacity: 0;
visibility: hidden;
pointer-events: none;
transition:
opacity 0.2s ease,
transform 0.2s ease,
visibility 0.2s ease;
z-index: 120;
}
.hdr__dropdown-panel::before {
content: '';
position: absolute;
top: -6px;
left: 50%;
width: 10px;
height: 10px;
background: #fff;
border-left: 1px solid #e2eaf2;
border-top: 1px solid #e2eaf2;
transform: translateX(-50%) rotate(45deg);
}
.hdr__dropdown.is-open .hdr__dropdown-panel {
opacity: 1;
visibility: visible;
pointer-events: auto;
transform: translateX(-50%) translateY(0);
}
.hdr__dropdown-link {
display: block;
padding: 9px 12px;
font-size: 13px;
line-height: 1.45;
color: #2a3d52;
text-decoration: none;
white-space: normal;
border-radius: 8px;
transition: background 0.12s ease, color 0.12s ease;
}
.hdr__dropdown-link:hover {
background: #eef6ff;
color: var(--blue);
text-decoration: none;
}
/* 中文:下拉面板按内容宽度收缩,减少右侧留白 */
.hdr--zh .hdr__dropdown-panel {
min-width: 0;
width: max-content;
max-width: 320px;
padding: 6px;
}
.hdr--zh .hdr__dropdown--wide .hdr__dropdown-panel {
min-width: 0;
max-width: 320px;
}
.hdr--zh .hdr__dropdown-link {
padding: 8px 10px;
white-space: nowrap;
}
/* 中文(PC+移动端):导航标签始终单行拼接,不再分两行 */
.hdr--zh .hdr__label--stacked {
flex-direction: row;
gap: 0;
align-items: center;
}
.hdr__tools {
display: flex;
align-items: center;
gap: 10px;
flex-shrink: 0;
}
.hdr__search {
width: 34px;
height: 34px;
display: grid;
place-items: center;
border: 1px solid #e8eef4;
background: #fafcfe;
cursor: pointer;
border-radius: 10px;
transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.hdr__search:hover {
background: #f0f7ff;
border-color: #c5d9ec;
box-shadow: 0 2px 8px rgba(72, 164, 252, 0.1);
}
.hdr__search img {
width: 18px;
height: 18px;
opacity: 0.75;
}
.hdr__lang {
height: 34px;
border: 1px solid #e8eef4;
border-radius: 10px;
padding: 0 22px 0 10px;
font-size: 13px;
font-weight: 500;
color: #2a3d52;
background-color: #fafcfe;
appearance: none;
-webkit-appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5 5 6.5 8 3.5' fill='none' stroke='%236b7f94' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 9px center;
background-size: 10px 10px;
cursor: pointer;
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hdr__lang:hover {
border-color: #c5d9ec;
}
.hdr__lang:focus {
outline: none;
border-color: var(--blue-light);
box-shadow: 0 0 0 3px rgba(72, 164, 252, 0.2);
background-color: #fafcfe;
}
.hdr__burger {
display: none;
flex-direction: column;
justify-content: center;
gap: 5px;
width: 40px;
height: 40px;
border: 1px solid #e8eef4;
border-radius: 10px;
background: #fafcfe;
cursor: pointer;
margin-left: auto;
transition: background 0.15s ease;
}
.hdr__burger:hover {
background: #f0f7ff;
}
.hdr__burger span {
height: 2px;
width: 18px;
margin: 0 auto;
border-radius: 2px;
background: #2a3d52;
transition: transform 0.2s ease, opacity 0.2s ease;
}
@media (max-width: 1280px) {
.hdr__label-line {
font-size: 12px;
}
.hdr__pill--link {
padding: 5px 9px;
}
.hdr__pill-main {
padding: 5px 6px 5px 9px;
}
.hdr__nav {
gap: 4px 3px;
}
}
@media (max-width: 1024px) {
.hdr__burger {
display: flex;
}
.hdr__nav {
position: absolute;
top: 100%;
left: 12px;
right: 12px;
flex-direction: column;
flex-wrap: nowrap;
align-items: stretch;
background: #fff;
padding: 10px;
margin-top: 4px;
border: 1px solid #e8eef4;
border-radius: 14px;
box-shadow: var(--shadow-lg);
display: none;
gap: 4px;
max-height: calc(100vh - var(--header-h) - 16px);
overflow-y: auto;
}
.hdr__nav.is-open {
display: flex;
}
.hdr__pill,
.hdr__pill--link {
width: 100%;
justify-content: flex-start;
}
.hdr__pill-main {
flex: 0 1 auto;
justify-content: flex-start;
border-radius: 10px 0 0 10px;
}
.hdr__label,
.hdr__label--stacked {
align-items: flex-start;
text-align: left;
}
/* 移动端:导航标签单行显示(英文加词间距,中文由 .hdr--zh 规则置 0) */
.hdr__label--stacked {
flex-direction: row;
gap: 0.28em;
align-items: center;
}
.hdr__label-line {
font-size: 14px;
}
.hdr__dropdown {
width: 100%;
}
.hdr__dropdown.is-open::after {
display: none;
}
.hdr__dropdown-panel {
position: static;
transform: none;
min-width: 0;
max-width: none;
width: 100%;
margin: 0;
padding: 0;
border: none;
border-radius: 10px;
box-shadow: none;
background: #f4f8fc;
opacity: 1;
visibility: hidden;
max-height: 0;
overflow: hidden;
pointer-events: none;
transition: max-height 0.28s ease, padding 0.28s ease, visibility 0.28s ease, margin 0.28s ease;
}
.hdr__dropdown-panel::before {
display: none;
}
/* 中文:移动端覆盖桌面收缩规则,铺满整行不留右侧空白;折叠时去除内边距避免残留空带 */
.hdr--zh .hdr__dropdown-panel,
.hdr--zh .hdr__dropdown--wide .hdr__dropdown-panel {
width: 100%;
max-width: none;
min-width: 0;
padding: 0;
}
.hdr--zh .hdr__dropdown-link {
white-space: normal;
}
.hdr__dropdown.is-open .hdr__dropdown-panel {
visibility: visible;
max-height: 640px;
padding: 4px;
pointer-events: auto;
margin-top: 4px;
transform: none;
}
.hdr__dropdown-link {
font-size: 14px;
}
.hdr__tools {
order: 2;
}
}
@media (max-width: 560px) {
.hdr__logo img {
height: 48px;
}
.hdr__inner {
gap: 10px;
padding: 8px 14px;
}
.hdr__nav {
left: 8px;
right: 8px;
}
}
</style>
File diff suppressed because it is too large Load Diff
+168
View File
@@ -0,0 +1,168 @@
<script setup lang="ts">
import type { SuccessStoryCase } from '~/data/cases-content'
defineProps<{
story: SuccessStoryCase
reverse?: boolean
readFullLabel?: string
}>()
</script>
<template>
<article class="cstory" :class="{ 'cstory--reverse': reverse }">
<div class="cstory__grid">
<div class="cstory__media">
<img :src="story.image" :alt="story.imageAlt" loading="lazy" />
<a
v-if="story.url"
:href="story.url"
target="_blank"
rel="noopener noreferrer"
class="cstory__btn"
>
{{ readFullLabel ?? 'Read Full Case Study' }}
</a>
</div>
<div class="cstory__content">
<a
v-if="story.url"
:href="story.url"
target="_blank"
rel="noopener noreferrer"
class="cstory__title"
>
{{ story.title }}
</a>
<h2 v-else class="cstory__title cstory__title--plain">
{{ story.title }}
</h2>
<section
v-for="(block, i) in story.blocks"
:key="i"
class="cstory__block"
>
<h3 class="cstory__h">{{ block.h }}</h3>
<p class="cstory__p">{{ block.p }}</p>
</section>
</div>
</div>
</article>
</template>
<style scoped>
.cstory {
padding: 48px 0;
border-bottom: 1px solid #d8dde3;
}
.cstory:last-child {
border-bottom: none;
}
.cstory__grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 48px;
align-items: start;
}
.cstory--reverse .cstory__grid {
direction: rtl;
}
.cstory--reverse .cstory__grid > * {
direction: ltr;
}
.cstory__media {
display: flex;
flex-direction: column;
align-items: center;
}
.cstory__media img {
width: 100%;
aspect-ratio: 16 / 10;
object-fit: cover;
border-radius: 4px;
display: block;
}
.cstory__btn {
display: inline-block;
margin-top: 20px;
padding: 11px 28px;
border: none;
border-radius: 999px;
background: #48a4fc;
color: #fff;
font-family: Georgia, 'Times New Roman', serif;
font-size: 15px;
font-weight: 500;
text-decoration: none;
transition: background 0.18s ease;
}
.cstory__btn:hover {
background: #3a96f0;
}
.cstory__title {
display: inline;
color: var(--blue);
font-size: clamp(18px, 2.2vw, 22px);
font-weight: 700;
line-height: 1.45;
text-decoration: underline;
text-underline-offset: 3px;
}
.cstory__title:hover {
color: #0077cc;
}
.cstory__title--plain {
display: block;
text-decoration: none;
cursor: default;
}
.cstory__title--plain:hover {
color: var(--blue);
}
.cstory__block {
margin-top: 18px;
}
.cstory__h {
color: #1e1e1e;
font-size: 16px;
font-weight: 800;
}
.cstory__p {
margin-top: 6px;
color: #1e1e1e;
font-size: 15px;
line-height: 1.75;
white-space: pre-wrap;
}
@media (max-width: 900px) {
.cstory {
padding: 36px 0;
}
.cstory__grid {
grid-template-columns: 1fr;
gap: 28px;
}
.cstory--reverse .cstory__grid {
direction: ltr;
}
}
</style>
+237
View File
@@ -0,0 +1,237 @@
<script setup lang="ts">
const props = defineProps<{
image: string
name: string
department?: string
/** 专家简介;有则展示,无则仅显示姓名与医院 */
expertInfo?: string
/** 未按医院筛选时展示所属医院 */
hospitalName?: string
/** 以顶部为锚点裁切,避免头部被遮挡 */
imageFocusTop?: boolean
imageFit?: 'cover' | 'contain'
/** 单独微调 object-position(cover 模式) */
imagePosition?: string
/** 略缩小照片,为头顶留出空间(cover 模式) */
imageScale?: number
/** 照片区域背景色(contain 时与证件照底色衔接) */
mediaBackground?: string
}>()
const mediaStyle = computed(() =>
props.mediaBackground ? { background: props.mediaBackground } : undefined
)
const photoStyle = computed(() => {
if (props.imageFit === 'contain') return undefined
const style: Record<string, string> = {}
if (props.imagePosition) style.objectPosition = props.imagePosition
if (props.imageScale != null && props.imageScale < 1) {
style.transform = `scale(${props.imageScale})`
style.transformOrigin = 'center top'
}
return Object.keys(style).length ? style : undefined
})
</script>
<template>
<article class="dcard">
<div
class="dcard__media"
:class="{ 'dcard__media--contain': imageFit === 'contain' }"
:style="mediaStyle"
>
<img
:src="image"
:alt="name"
class="dcard__photo"
:class="{
'dcard__photo--focus-top': imageFocusTop && imageFit !== 'contain',
'dcard__photo--contain': imageFit === 'contain'
}"
:style="photoStyle"
loading="lazy"
/>
</div>
<div class="dcard__body">
<h3 class="dcard__name">{{ name }}</h3>
<p v-if="expertInfo" class="dcard__info">{{ expertInfo }}</p>
<p v-else-if="department" class="dcard__dept">{{ department }}</p>
<p v-if="hospitalName" class="dcard__hospital">{{ hospitalName }}</p>
</div>
</article>
</template>
<style scoped>
.dcard {
border-radius: var(--radius);
overflow: hidden;
box-shadow: var(--shadow);
background: #fff;
display: flex;
flex-direction: column;
}
.dcard__media {
aspect-ratio: 243 / 280;
overflow: hidden;
background: #e8eef4;
}
.dcard__media--contain {
display: flex;
align-items: center;
justify-content: center;
}
.dcard__photo {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center center;
}
.dcard__photo--focus-top {
object-position: center top;
}
.dcard__photo--contain {
width: 100%;
height: 100%;
object-fit: contain;
object-position: center center;
}
.dcard__body {
padding: 14px 16px 18px;
border-top: 1px solid #eef2f6;
}
.dcard__name {
font-size: 17px;
font-weight: 800;
color: #0f2740;
line-height: 1.3;
}
.dcard__dept {
margin-top: 8px;
font-size: 13px;
line-height: 1.5;
color: var(--muted);
}
.dcard__info {
margin-top: 8px;
font-size: 13px;
line-height: 1.55;
color: var(--muted);
white-space: pre-line;
}
.dcard__hospital {
margin-top: 8px;
font-size: 12px;
line-height: 1.45;
color: #6b7f94;
}
</style>
+484
View File
@@ -0,0 +1,484 @@
<script setup lang="ts">
import { freeAssessmentContentBundle } from '~/data/free-assessment-content'
const props = withDefaults(
defineProps<{
variant?: 'page' | 'embedded'
}>(),
{ variant: 'page' }
)
const { locale } = useSiteLocale()
const content = useLocalized(freeAssessmentContentBundle)
const freeAssessmentForm = computed(() => content.value.form)
const emit = defineEmits<{
submitted: []
}>()
const form = reactive({
firstName: '',
lastName: '',
email: '',
condition: '',
reports: '',
message: ''
})
type FormErrors = {
firstName?: string
email?: string
condition?: string
}
const formErrors = reactive<FormErrors>({})
const submitting = ref(false)
const submitError = ref('')
const submitSuccess = ref('')
const showSuccessPopup = ref(false)
const SUCCESS_RESET_DELAY_MS = 5000
let successResetTimer: ReturnType<typeof setTimeout> | null = null
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
function resetFormFields() {
form.firstName = ''
form.lastName = ''
form.email = ''
form.condition = ''
form.reports = ''
form.message = ''
submitSuccess.value = ''
submitError.value = ''
showSuccessPopup.value = false
}
function scheduleSuccessReset() {
if (successResetTimer) clearTimeout(successResetTimer)
successResetTimer = setTimeout(() => {
resetFormFields()
successResetTimer = null
}, SUCCESS_RESET_DELAY_MS)
}
onUnmounted(() => {
if (successResetTimer) clearTimeout(successResetTimer)
})
function clearFieldError(field: keyof FormErrors) {
delete formErrors[field]
}
function validateForm(): boolean {
const messages = freeAssessmentForm.value.validation
formErrors.firstName = undefined
formErrors.email = undefined
formErrors.condition = undefined
let valid = true
if (!form.firstName.trim()) {
formErrors.firstName = messages.firstNameRequired
valid = false
}
const email = form.email.trim()
if (!email) {
formErrors.email = messages.emailRequired
valid = false
} else if (!emailPattern.test(email)) {
formErrors.email = messages.emailInvalid
valid = false
}
if (!form.condition.trim()) {
formErrors.condition = messages.conditionRequired
valid = false
}
return valid
}
async function onSubmit() {
if (!validateForm()) return
submitting.value = true
submitError.value = ''
submitSuccess.value = ''
try {
const res = await $fetch<{ code: number; message: string }>('/api/forms/assessment', {
method: 'POST',
body: {
lang: locale.value,
firstName: form.firstName.trim(),
lastName: form.lastName.trim(),
email: form.email.trim(),
condition: form.condition.trim(),
reports: form.reports,
message: form.message.trim(),
},
})
if (res.code !== 200) {
submitError.value = res.message
return
}
submitSuccess.value = freeAssessmentForm.value.submitSuccess
showSuccessPopup.value = true
scheduleSuccessReset()
} catch {
submitError.value = locale.value === 'zh' ? '提交失败,请稍后重试。' : 'Submission failed. Please try again.'
} finally {
submitting.value = false
}
}
</script>
<template>
<div class="fa-form-wrap" :class="{ 'fa-form-wrap--embedded': props.variant === 'embedded' }">
<form
class="fa-form"
:class="{ 'fa-form--embedded': props.variant === 'embedded', 'is-disabled': !!showSuccessPopup }"
:lang="locale"
novalidate
@submit.prevent="onSubmit"
>
<div class="fa-form__row fa-form__row--3">
<label class="fa-field">
<span class="fa-field__label">
{{ freeAssessmentForm.fields.firstName.label }}
<span
v-if="freeAssessmentForm.fields.firstName.required"
class="fa-field__req"
aria-hidden="true"
>*</span>
</span>
<input
v-model="form.firstName"
type="text"
class="fa-field__input"
:class="{ 'fa-field__input--error': formErrors.firstName }"
autocomplete="given-name"
aria-required="true"
:aria-invalid="formErrors.firstName ? 'true' : undefined"
:aria-describedby="formErrors.firstName ? 'fa-first-name-error' : undefined"
@input="clearFieldError('firstName')"
/>
<p v-if="formErrors.firstName" id="fa-first-name-error" class="fa-field__error" role="alert">
{{ formErrors.firstName }}
</p>
</label>
<label class="fa-field">
<span class="fa-field__label">
{{ freeAssessmentForm.fields.lastName.label }}
</span>
<input
v-model="form.lastName"
type="text"
class="fa-field__input"
autocomplete="family-name"
/>
</label>
<label class="fa-field">
<span class="fa-field__label">
{{ freeAssessmentForm.fields.email.label }}
<span
v-if="freeAssessmentForm.fields.email.required"
class="fa-field__req"
aria-hidden="true"
>*</span>
</span>
<input
v-model="form.email"
type="email"
class="fa-field__input"
:class="{ 'fa-field__input--error': formErrors.email }"
autocomplete="email"
inputmode="email"
aria-required="true"
:aria-invalid="formErrors.email ? 'true' : undefined"
:aria-describedby="formErrors.email ? 'fa-email-error' : undefined"
@input="clearFieldError('email')"
/>
<p v-if="formErrors.email" id="fa-email-error" class="fa-field__error" role="alert">
{{ formErrors.email }}
</p>
</label>
</div>
<label class="fa-field fa-field--full">
<span class="fa-field__label">
{{ freeAssessmentForm.fields.condition.label }}
<span
v-if="freeAssessmentForm.fields.condition.required"
class="fa-field__req"
aria-hidden="true"
>*</span>
</span>
<textarea
v-model="form.condition"
class="fa-field__textarea"
:class="{ 'fa-field__textarea--error': formErrors.condition }"
rows="4"
:placeholder="freeAssessmentForm.fields.condition.placeholder"
aria-required="true"
:aria-invalid="formErrors.condition ? 'true' : undefined"
:aria-describedby="formErrors.condition ? 'fa-condition-error' : undefined"
@input="clearFieldError('condition')"
/>
<p v-if="formErrors.condition" id="fa-condition-error" class="fa-field__error" role="alert">
{{ formErrors.condition }}
</p>
</label>
<label class="fa-field fa-field--full">
<span class="fa-field__label">
{{ freeAssessmentForm.fields.reports.label }}
</span>
<select v-model="form.reports" class="fa-field__select">
<option
v-for="opt in freeAssessmentForm.fields.reports.options"
:key="opt.value"
:value="opt.value"
>
{{ opt.label }}
</option>
</select>
</label>
<label class="fa-field fa-field--full">
<span class="fa-field__label">
{{ freeAssessmentForm.fields.message.label }}
</span>
<textarea
v-model="form.message"
class="fa-field__textarea"
rows="4"
/>
</label>
<p v-if="submitError" class="fa-form__submit-error" role="alert">{{ submitError }}</p>
<div class="fa-form__actions">
<button type="submit" class="btn fa-form__submit" :disabled="submitting">
{{ submitting ? (locale === 'zh' ? '提交中…' : 'Submitting…') : freeAssessmentForm.submitLabel }}
</button>
</div>
</form>
<Teleport to="body">
<Transition name="fa-modal">
<div v-if="showSuccessPopup" class="fa-modal" role="dialog" aria-modal="true" aria-labelledby="fa-success-title">
<button type="button" class="fa-modal__backdrop" aria-label="Close success popup" @click="showSuccessPopup = false" />
<div class="fa-modal__panel fa-modal__panel--success">
<button type="button" class="fa-modal__close" aria-label="Close" @click="showSuccessPopup = false">
<span aria-hidden="true">&times;</span>
</button>
<h2 id="fa-success-title" class="fa-modal__title">{{ locale === 'zh' ? '提交成功' : 'Submitted successfully' }}</h2>
<p class="fa-modal__success-text">{{ submitSuccess }}</p>
<p class="fa-modal__success-hint">{{ locale === 'zh' ? '约 5 秒后自动关闭' : 'Will close automatically in about 5 seconds' }}</p>
</div>
</div>
</Transition>
</Teleport>
</div>
</template>
<style scoped>
.fa-form {
background: #fff;
border: 1px solid #e3ecf5;
border-radius: var(--radius);
padding: 40px 44px 44px;
box-shadow: var(--shadow);
}
.fa-form.is-disabled {
pointer-events: none;
}
.fa-form--embedded {
background: transparent;
border: none;
border-radius: 0;
padding: 0;
box-shadow: none;
}
.fa-modal {
position: fixed;
inset: 0;
z-index: 1100;
display: flex;
align-items: center;
justify-content: center;
padding: 24px 16px;
}
.fa-modal__backdrop {
position: absolute;
inset: 0;
background: rgba(15, 39, 64, 0.55);
border: none;
cursor: pointer;
}
.fa-modal__panel {
position: relative;
width: 100%;
max-width: 720px;
background: #fff;
border: 1px solid #e3ecf5;
border-radius: var(--radius);
padding: 32px 36px 36px;
box-shadow: var(--shadow-lg);
}
.fa-modal__panel--success {
text-align: center;
}
.fa-modal__close {
position: absolute;
top: 12px;
right: 14px;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
line-height: 1;
color: #0f2740;
background: transparent;
border: none;
border-radius: 8px;
cursor: pointer;
}
.fa-modal__title {
margin: 0 0 16px;
font-size: 24px;
font-weight: 800;
color: #0f2740;
}
.fa-modal__success-text {
margin: 0;
font-size: 16px;
line-height: 1.7;
color: #36506b;
}
.fa-modal__success-hint {
margin: 14px 0 0;
font-size: 13px;
color: #64748b;
}
.fa-form__row {
display: grid;
gap: 20px;
margin-bottom: 20px;
}
.fa-form__row--3 {
grid-template-columns: repeat(3, 1fr);
}
.fa-field {
display: flex;
flex-direction: column;
gap: 8px;
}
.fa-field--full {
margin-bottom: 20px;
}
.fa-field__label {
font-size: 14px;
font-weight: 600;
color: #0f2740;
}
.fa-field__req {
color: #e53935;
margin-left: 2px;
}
.fa-field__error {
margin: 0;
font-size: 13px;
line-height: 1.45;
color: #c62828;
}
.fa-field__input,
.fa-field__textarea,
.fa-field__select {
width: 100%;
font-family: inherit;
font-size: 15px;
color: var(--ink);
background: #fff;
border: 1px solid #e2eaf2;
border-radius: 8px;
padding: 11px 14px;
transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.fa-field__input--error,
.fa-field__textarea--error {
border-color: #e53935;
}
.fa-field__input--error:focus,
.fa-field__textarea--error:focus {
border-color: #e53935;
box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.14);
}
.fa-field__input::placeholder,
.fa-field__textarea::placeholder {
color: #9aa8b8;
}
.fa-field__input:hover,
.fa-field__textarea:hover,
.fa-field__select:hover {
border-color: #c5d4e4;
}
.fa-field__input:focus,
.fa-field__textarea:focus,
.fa-field__select:focus {
outline: none;
border-color: var(--blue);
box-shadow: 0 0 0 3px rgba(72, 164, 252, 0.14);
}
.fa-field__textarea {
resize: vertical;
min-height: 108px;
line-height: 1.6;
}
.fa-field__select {
cursor: pointer;
height: 44px;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666666' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 14px center;
padding-right: 40px;
}
.fa-form__submit-error {
margin: 0 0 12px;
font-size: 14px;
color: #c62828;
}
.fa-form__actions {
margin-top: 8px;
padding-top: 8px;
border-top: 1px solid #eef2f6;
}
.fa-form__submit:disabled {
opacity: 0.7;
cursor: not-allowed;
}
.fa-form__submit {
width: 100%;
height: 52px;
font-size: 16px;
}
@media (max-width: 900px) {
.fa-form__row--3 {
grid-template-columns: 1fr;
}
}
@media (max-width: 640px) {
.fa-form {
padding: 28px 20px 32px;
}
}
</style>
+152
View File
@@ -0,0 +1,152 @@
<script setup lang="ts">
import { freeAssessmentContentBundle } from '~/data/free-assessment-content'
const content = useLocalized(freeAssessmentContentBundle)
const freeAssessmentForm = computed(() => content.value.form)
const open = defineModel<boolean>({ default: false })
function close() {
open.value = false
}
function onKeydown(e: KeyboardEvent) {
if (e.key === 'Escape' && open.value) {
close()
}
}
watch(open, (isOpen) => {
if (import.meta.client) {
document.body.style.overflow = isOpen ? 'hidden' : ''
}
})
onMounted(() => {
document.addEventListener('keydown', onKeydown)
})
onUnmounted(() => {
document.removeEventListener('keydown', onKeydown)
if (import.meta.client) {
document.body.style.overflow = ''
}
})
</script>
<template>
<Teleport to="body">
<Transition name="fa-modal">
<div
v-if="open"
class="fa-modal"
role="dialog"
aria-modal="true"
:aria-label="freeAssessmentForm.title"
>
<button
type="button"
class="fa-modal__backdrop"
aria-label="Close assessment form"
@click="close"
/>
<div class="fa-modal__panel">
<button
type="button"
class="fa-modal__close"
aria-label="Close"
@click="close"
>
<span aria-hidden="true">&times;</span>
</button>
<h2 class="fa-modal__title">{{ freeAssessmentForm.title }}</h2>
<FreeAssessmentForm variant="embedded" @submitted="close" />
</div>
</div>
</Transition>
</Teleport>
</template>
<style scoped>
.fa-modal {
position: fixed;
inset: 0;
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
padding: 24px 16px;
}
.fa-modal__backdrop {
position: absolute;
inset: 0;
background: rgba(15, 39, 64, 0.55);
border: none;
cursor: pointer;
}
.fa-modal__panel {
position: relative;
width: 100%;
max-width: 880px;
max-height: calc(100vh - 48px);
overflow-y: auto;
background: #fff;
border: 1px solid #e3ecf5;
border-radius: var(--radius);
padding: 36px 44px 44px;
box-shadow: var(--shadow-lg);
}
.fa-modal__close {
position: absolute;
top: 14px;
right: 16px;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
line-height: 1;
color: #0f2740;
background: transparent;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background 0.18s ease, color 0.18s ease;
}
.fa-modal__close:hover {
background: var(--bg-soft);
color: var(--blue);
}
.fa-modal__title {
text-align: center;
font-size: clamp(22px, 2.8vw, 26px);
font-weight: 800;
color: #0f2740;
margin: 0 0 28px;
padding-right: 32px;
}
.fa-modal-enter-active,
.fa-modal-leave-active {
transition: opacity 0.22s ease;
}
.fa-modal-enter-active .fa-modal__panel,
.fa-modal-leave-active .fa-modal__panel {
transition: transform 0.22s ease;
}
.fa-modal-enter-from,
.fa-modal-leave-to {
opacity: 0;
}
.fa-modal-enter-from .fa-modal__panel,
.fa-modal-leave-to .fa-modal__panel {
transform: translateY(12px) scale(0.98);
}
@media (max-width: 768px) {
.fa-modal__panel {
padding: 28px 20px 32px;
}
}
</style>
@@ -0,0 +1,480 @@
<script setup lang="ts">
import { getImcPackagesOverview, imcHospital, imcPackagesContentBundle } from '~/data/imc-packages-content'
const content = useLocalized(imcPackagesContentBundle)
const { locale } = useSiteLocale()
const packagesOverview = computed(() => getImcPackagesOverview(locale.value))
const hospitalDisplayName = computed(() => {
const hospital = content.value.imcHospital
if (locale.value === 'zh' && hospital.nameZh && hospital.centerZh) {
return `${hospital.nameZh} — ${hospital.centerZh}`
}
return `${hospital.nameEn} — ${hospital.centerEn}`
})
</script>
<template>
<div class="hs-imc" :aria-label="content.sectionAriaLabel">
<header class="hs-imc__head">
<h3 class="hs-imc__hospital">
{{ hospitalDisplayName }}
</h3>
<p class="hs-imc__intro">
{{ content.imcHospital.introBeforeDate }}{{ imcHospital.updateDate }}{{ content.imcHospital.introAfterDate }}
</p>
</header>
<div class="hs-imc__grid">
<article
v-for="pkg in packagesOverview"
:key="pkg.slug"
class="hs-imc__card"
>
<NuxtLink :to="pkg.to" class="hs-imc__preview-link">
<img
:src="pkg.previewImage"
:alt="`${pkg.title} ${content.previewAltSuffix}`"
class="hs-imc__preview"
loading="lazy"
/>
</NuxtLink>
<div class="hs-imc__body">
<h4 class="hs-imc__title">
<NuxtLink :to="pkg.to" class="hs-imc__title-link">{{ pkg.title }}</NuxtLink>
</h4>
<p class="hs-imc__meta">
<span>{{ pkg.packageCode }}</span>
<span class="hs-imc__meta-sep">·</span>
<span>{{ pkg.ageNote }}</span>
</p>
<dl class="hs-imc__prices">
<div
v-for="(line, i) in pkg.prices"
:key="i"
class="hs-imc__price-row"
>
<dt>{{ line.label }}</dt>
<dd>{{ line.value }}</dd>
</div>
</dl>
<ul class="hs-imc__highlights">
<li v-for="(item, hi) in pkg.highlights" :key="hi">{{ item }}</li>
</ul>
<p v-if="pkg.gynecologyNote" class="hs-imc__note">{{ pkg.gynecologyNote }}</p>
<NuxtLink :to="pkg.to" class="hs-imc__detail-link">
{{ content.viewFullBreakdown }}
</NuxtLink>
</div>
</article>
</div>
<p class="hs-imc__remarks">{{ content.imcHospital.remarks }}</p>
</div>
</template>
<style scoped>
.hs-imc {
margin-top: 36px;
}
.hs-imc__head {
margin-bottom: 24px;
}
.hs-imc__hospital {
margin: 0 0 8px;
font-size: clamp(18px, 2.2vw, 22px);
font-weight: 700;
color: var(--section-bar, #48a4fc);
line-height: 1.35;
text-align: left;
}
.hs-imc__intro {
margin: 0;
font-size: 14.5px;
line-height: 1.6;
color: #5a6d7d;
}
.hs-imc__grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 28px 24px;
}
.hs-imc__card {
display: flex;
flex-direction: column;
border: 1px solid #e2ecf4;
border-radius: 12px;
overflow: hidden;
background: #fafcfe;
box-shadow: 0 4px 16px rgba(15, 45, 85, 0.06);
}
.hs-imc__preview-link {
display: block;
background: #eef6fc;
border-bottom: 1px solid #e2ecf4;
}
.hs-imc__preview {
display: block;
width: 100%;
height: auto;
max-height: 220px;
object-fit: cover;
object-position: top center;
}
.hs-imc__body {
padding: 18px 20px 20px;
flex: 1;
display: flex;
flex-direction: column;
}
.hs-imc__title {
margin: 0 0 6px;
font-size: 16px;
font-weight: 700;
line-height: 1.35;
}
.hs-imc__title-link {
color: #0f2740;
text-decoration: none;
}
.hs-imc__title-link:hover {
color: var(--section-bar, #48a4fc);
}
.hs-imc__meta {
margin: 0 0 12px;
font-size: 13px;
color: #5a6d7d;
line-height: 1.45;
}
.hs-imc__meta-sep {
margin: 0 4px;
}
.hs-imc__prices {
margin: 0 0 14px;
padding: 12px 14px;
background: #fff;
border-radius: 8px;
border: 1px solid #e8f0f6;
}
.hs-imc__price-row {
display: grid;
grid-template-columns: 1fr auto;
gap: 8px 12px;
font-size: 13px;
line-height: 1.45;
margin-bottom: 8px;
}
.hs-imc__price-row:last-child {
margin-bottom: 0;
}
.hs-imc__price-row dt {
margin: 0;
font-weight: 600;
color: #2d4055;
}
.hs-imc__price-row dd {
margin: 0;
font-weight: 700;
color: #0f2740;
text-align: right;
white-space: nowrap;
}
.hs-imc__highlights {
margin: 0 0 12px;
padding-left: 18px;
font-size: 13.5px;
line-height: 1.55;
color: #2d4055;
}
.hs-imc__highlights li {
margin-bottom: 6px;
}
.hs-imc__highlights li:last-child {
margin-bottom: 0;
}
.hs-imc__note {
margin: 0 0 12px;
font-size: 12.5px;
line-height: 1.5;
color: #5a6d7d;
font-style: italic;
}
.hs-imc__detail-link {
margin-top: auto;
font-size: 14px;
font-weight: 600;
color: var(--section-bar, #48a4fc);
text-decoration: none;
}
.hs-imc__detail-link:hover {
text-decoration: underline;
}
.hs-imc__remarks {
margin: 24px 0 0;
font-size: 13px;
line-height: 1.55;
color: #5a6d7d;
}
@media (max-width: 900px) {
.hs-imc__grid {
grid-template-columns: 1fr;
gap: 20px;
}
.hs-imc__preview {
max-height: 180px;
}
.hs-imc__price-row {
grid-template-columns: 1fr;
}
.hs-imc__price-row dd {
text-align: left;
}
}
</style>
+108
View File
@@ -0,0 +1,108 @@
<script setup lang="ts">
defineProps<{
image: string
name: string
intro: string
url?: string
officialWebsiteLabel?: string
}>()
</script>
<template>
<article class="hcard">
<div class="hcard__media">
<img :src="image" :alt="name" />
<div class="hcard__name">{{ name }}</div>
<div class="hcard__panel">
<h3 class="hcard__panel-name">{{ name }}</h3>
<p class="hcard__intro">{{ intro }}</p>
<a v-if="url" :href="url" target="_blank" rel="noopener" class="hcard__link" @click.stop>
{{ officialWebsiteLabel ?? 'Official website →' }}
</a>
</div>
</div>
</article>
</template>
<style scoped>
.hcard {
border-radius: var(--radius);
overflow: hidden;
box-shadow: var(--shadow);
background: #fff;
}
.hcard__media {
position: relative;
aspect-ratio: 495 / 365;
overflow: hidden;
}
.hcard__media img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.hcard__name {
position: absolute;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, .47);
color: #fff;
font-size: 24px;
font-weight: 700;
padding: 12px 18px;
}
.hcard__panel {
position: absolute;
inset: 0;
background: rgba(72, 164, 252, .96);
color: #fff;
padding: 26px 24px;
display: flex;
flex-direction: column;
gap: 12px;
opacity: 0;
transform: translateY(8px);
transition: opacity .28s ease, transform .28s ease;
overflow: auto;
scrollbar-width: thin;
scrollbar-color: rgba(255, 255, 255, 0.45) transparent;
}
.hcard__panel::-webkit-scrollbar {
width: 5px;
}
.hcard__panel::-webkit-scrollbar-button {
display: none;
width: 0;
height: 0;
}
.hcard__panel::-webkit-scrollbar-track {
background: transparent;
}
.hcard__panel::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.4);
border-radius: 999px;
}
.hcard__panel::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.6);
}
.hcard:hover .hcard__panel,
.hcard:focus-within .hcard__panel {
opacity: 1;
transform: translateY(0);
}
.hcard__panel-name { font-size: 22px; font-weight: 800; }
.hcard__intro { font-size: 15px; line-height: 1.7; white-space: pre-line; }
.hcard__link {
margin-top: auto;
font-size: 14px;
word-break: break-all;
text-decoration: underline;
}
</style>
+145
View File
@@ -0,0 +1,145 @@
<script setup lang="ts">
import type { ArticleItem, MediaPublicItem } from '~/data/news-content'
defineProps<{
item: ArticleItem | MediaPublicItem
reverse?: boolean
readOriginalLabel?: string
}>()
</script>
<template>
<article class="cstory" :class="{ 'cstory--reverse': reverse }">
<div class="cstory__grid">
<div class="cstory__media">
<img :src="item.thumbnail" :alt="item.thumbnailAlt" loading="lazy" />
</div>
<div class="cstory__content">
<a
:href="item.url"
target="_blank"
rel="noopener noreferrer"
class="cstory__title"
>
{{ item.title }}
</a>
<p class="cstory__summary">{{ item.summary }}</p>
<a
:href="item.url"
target="_blank"
rel="noopener noreferrer"
class="cstory__btn"
>
{{ readOriginalLabel ?? 'Read Original Article' }}
</a>
</div>
</div>
</article>
</template>
<style scoped>
.cstory {
padding: 40px 0;
border-bottom: 1px solid #d8dde3;
}
.cstory:last-child {
border-bottom: none;
}
.cstory__grid {
display: grid;
grid-template-columns: auto 1fr;
gap: 36px;
align-items: center;
}
.cstory--reverse .cstory__grid {
direction: rtl;
}
.cstory--reverse .cstory__grid > * {
direction: ltr;
}
.cstory__media img {
width: 220px;
height: 220px;
max-width: 100%;
object-fit: cover;
border-radius: 8px;
display: block;
box-shadow: 0 4px 16px rgba(15, 39, 64, 0.12);
}
.cstory__content {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
min-width: 0;
}
.cstory__title {
display: inline;
color: var(--blue);
font-size: clamp(18px, 2.2vw, 22px);
font-weight: 700;
line-height: 1.45;
text-decoration: underline;
text-underline-offset: 3px;
}
.cstory__title:hover {
color: #0077cc;
}
.cstory__summary {
margin: 14px 0 0;
color: #1e1e1e;
font-size: 15px;
line-height: 1.8;
text-align: justify;
}
.cstory__btn {
display: inline-block;
margin-top: 20px;
padding: 10px 24px;
border: none;
border-radius: 999px;
background: #48a4fc;
color: #fff;
font-family: Georgia, 'Times New Roman', serif;
font-size: 15px;
font-weight: 500;
text-decoration: none;
transition: background 0.18s ease;
}
.cstory__btn:hover {
background: #3a96f0;
}
@media (max-width: 900px) {
.cstory {
padding: 32px 0;
}
.cstory__grid {
grid-template-columns: 1fr;
gap: 20px;
align-items: start;
}
.cstory__media img {
width: min(100%, 280px);
height: min(100%, 280px);
}
.cstory--reverse .cstory__grid {
direction: ltr;
}
}
</style>
+271
View File
@@ -0,0 +1,271 @@
<script setup lang="ts">
import { processStepsBundle } from '~/data/process-content'
const { locale } = useSiteLocale()
const steps = useLocalized(processStepsBundle)
const step1 = computed(() => steps.value[0])
const step2 = computed(() => steps.value[1])
const step3 = computed(() => steps.value[2])
const step4 = computed(() => steps.value[3])
</script>
<template>
<div
class="process-flow"
:class="{ 'process-flow--zh': locale === 'zh' }"
aria-label="Four-step patient journey"
>
<article
class="process-step process-step--01"
:class="`process-step--${step1.layout}`"
aria-labelledby="process-step-01"
>
<h3 id="process-step-01" class="process-step__heading">
<span class="process-step__label">Step - {{ step1.number }}</span>
<span class="process-step__title">{{ step1.title }}</span>
</h3>
<div class="process-step__body">
<p class="process-step__text">{{ step1.text }}</p>
<div class="process-step__media">
<img
:src="step1.image"
:alt="step1.imageAlt"
class="process-step__img"
width="160"
height="160"
loading="lazy"
/>
</div>
</div>
</article>
<span class="process-arrow process-arrow--right" aria-hidden="true">→</span>
<article
class="process-step process-step--02"
:class="`process-step--${step2.layout}`"
aria-labelledby="process-step-02"
>
<h3 id="process-step-02" class="process-step__heading">
<span class="process-step__label">Step - {{ step2.number }}</span>
<span class="process-step__title">{{ step2.title }}</span>
</h3>
<div class="process-step__body">
<p class="process-step__text">{{ step2.text }}</p>
<div class="process-step__media">
<img
:src="step2.image"
:alt="step2.imageAlt"
class="process-step__img"
width="160"
height="160"
loading="lazy"
/>
</div>
</div>
</article>
<span class="process-arrow process-arrow--down" aria-hidden="true">↓</span>
<article
class="process-step process-step--03"
:class="`process-step--${step3.layout}`"
aria-labelledby="process-step-03"
>
<h3 id="process-step-03" class="process-step__heading">
<span class="process-step__label">Step - {{ step3.number }}</span>
<span class="process-step__title">{{ step3.title }}</span>
</h3>
<div class="process-step__body">
<p class="process-step__text">{{ step3.text }}</p>
<div class="process-step__media">
<img
:src="step3.image"
:alt="step3.imageAlt"
class="process-step__img"
width="160"
height="160"
loading="lazy"
/>
</div>
</div>
</article>
<span class="process-arrow process-arrow--left" aria-hidden="true">←</span>
<article
class="process-step process-step--04"
:class="`process-step--${step4.layout}`"
aria-labelledby="process-step-04"
>
<h3 id="process-step-04" class="process-step__heading">
<span class="process-step__label">Step - {{ step4.number }}</span>
<span class="process-step__title">{{ step4.title }}</span>
</h3>
<div class="process-step__body">
<p class="process-step__text">{{ step4.text }}</p>
<div class="process-step__media">
<img
:src="step4.image"
:alt="step4.imageAlt"
class="process-step__img"
width="160"
height="160"
loading="lazy"
/>
</div>
</div>
</article>
<span class="process-arrow process-arrow--up process-arrow--loop" aria-hidden="true">↑</span>
</div>
</template>
<style scoped>
.process-flow {
margin-top: 40px;
max-width: 948px;
margin-left: auto;
margin-right: auto;
display: grid;
grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
grid-template-rows: auto 44px auto;
grid-template-areas:
'step1 arrow-r step2'
'arrow-u . arrow-d'
'step4 arrow-l step3';
gap: 20px 4px;
align-items: center;
}
.process-step--01 { grid-area: step1; }
.process-step--02 { grid-area: step2; }
.process-step--03 { grid-area: step3; }
.process-step--04 { grid-area: step4; }
.process-arrow {
display: flex;
align-items: center;
justify-content: center;
font-size: 34px;
font-weight: 700;
line-height: 1;
color: #1e1e1e;
user-select: none;
}
.process-arrow--right { grid-area: arrow-r; }
.process-arrow--down { grid-area: arrow-d; }
.process-arrow--left { grid-area: arrow-l; }
.process-arrow--up { grid-area: arrow-u; }
.process-flow--zh .process-arrow {
font-size: 24px;
font-weight: 600;
color: #0f2740;
}
.process-flow--zh .process-step__heading {
margin: 0 0 2px;
line-height: 1.15;
}
.process-flow--zh .process-step__label {
font-size: 15px;
}
.process-flow--zh .process-step__title {
font-size: 15px;
}
.process-flow--zh .process-step__body {
gap: 10px;
}
.process-flow--zh .process-step__text {
font-size: 13px;
line-height: 1.65;
}
.process-step__heading {
margin: 0 0 14px;
text-align: center;
line-height: 1.35;
}
.process-step__label {
display: block;
font-size: 17px;
font-weight: 800;
color: #0f2740;
}
.process-step__title {
display: block;
font-size: 16px;
font-weight: 700;
color: #0f2740;
}
.process-step__body {
display: flex;
align-items: center;
gap: 16px;
}
.process-step--text-image .process-step__body {
flex-direction: row;
}
.process-step--image-text .process-step__body {
flex-direction: row-reverse;
}
.process-step__text {
flex: 1;
min-width: 0;
margin: 0;
font-size: 14px;
line-height: 1.65;
color: #36506b;
text-align: left;
}
.process-step__media {
flex-shrink: 0;
width: 160px;
height: 160px;
border-radius: 50%;
overflow: hidden;
background: transparent;
}
.process-step__img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
display: block;
}
@media (max-width: 820px) {
.process-flow {
display: flex;
flex-direction: column;
gap: 0;
max-width: 560px;
}
.process-arrow {
padding: 10px 0 14px;
font-size: 28px;
}
.process-arrow--loop {
display: none;
}
.process-step__body {
flex-direction: column !important;
align-items: center;
}
.process-step__text {
text-align: center;
}
}
</style>
+332
View File
@@ -0,0 +1,332 @@
<script setup lang="ts">
import type { SiteSearchResult } from '~/composables/useSiteSearch'
const open = defineModel<boolean>({ default: false })
const { t, tr } = useSiteLocale()
const localePath = useLocalePath()
const { searchSite } = useSiteSearch()
function categoryLabel(category: string) {
const labels = tr<Record<string, string>>('searchCategories')
return labels[category] ?? category
}
const query = ref('')
const activeIndex = ref(0)
const inputRef = ref<HTMLInputElement | null>(null)
const results = computed<SiteSearchResult[]>(() => searchSite(query.value))
watch(query, () => {
activeIndex.value = 0
})
watch(open, (isOpen) => {
if (!import.meta.client) return
document.body.style.overflow = isOpen ? 'hidden' : ''
if (isOpen) {
nextTick(() => inputRef.value?.focus())
} else {
query.value = ''
activeIndex.value = 0
}
})
function close() {
open.value = false
}
function selectResult(result: SiteSearchResult) {
close()
navigateTo(localePath(result.url))
}
function onKeydown(e: KeyboardEvent) {
if (!open.value) return
if (e.key === 'Escape') {
e.preventDefault()
close()
return
}
if (e.key === 'ArrowDown') {
e.preventDefault()
if (!results.value.length) return
activeIndex.value = (activeIndex.value + 1) % results.value.length
return
}
if (e.key === 'ArrowUp') {
e.preventDefault()
if (!results.value.length) return
activeIndex.value =
(activeIndex.value - 1 + results.value.length) % results.value.length
return
}
if (e.key === 'Enter') {
e.preventDefault()
const hit = results.value[activeIndex.value]
if (hit) selectResult(hit)
}
}
onMounted(() => {
document.addEventListener('keydown', onGlobalKeydown)
document.addEventListener('keydown', onKeydown)
})
onUnmounted(() => {
document.removeEventListener('keydown', onGlobalKeydown)
document.removeEventListener('keydown', onKeydown)
if (import.meta.client) {
document.body.style.overflow = ''
}
})
function onGlobalKeydown(e: KeyboardEvent) {
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k') {
e.preventDefault()
open.value = !open.value
}
}
</script>
<template>
<Teleport to="body">
<Transition name="site-search">
<div
v-if="open"
class="site-search"
role="dialog"
aria-modal="true"
:aria-label="t('search.siteSearch')"
>
<button
type="button"
class="site-search__backdrop"
:aria-label="t('search.closeSearch')"
@click="close"
/>
<div class="site-search__panel">
<div class="site-search__field">
<svg
class="site-search__icon"
width="20"
height="20"
viewBox="0 0 24 24"
aria-hidden="true"
>
<circle
cx="11"
cy="11"
r="7"
fill="none"
stroke="currentColor"
stroke-width="2"
/>
<path
d="M16 16l5 5"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
/>
</svg>
<input
ref="inputRef"
v-model="query"
type="search"
class="site-search__input"
:placeholder="t('search.placeholder')"
autocomplete="off"
:aria-label="t('search.searchSite')"
/>
<kbd class="site-search__hint" aria-hidden="true">Esc</kbd>
</div>
<div v-if="query.trim()" class="site-search__results" role="listbox">
<p v-if="!results.length" class="site-search__empty">
{{ t('search.noResults', { query: query.trim() }) }}
</p>
<button
v-for="(item, index) in results"
:key="item.id"
type="button"
class="site-search__result"
:class="{ 'is-active': index === activeIndex }"
role="option"
:aria-selected="index === activeIndex"
@mouseenter="activeIndex = index"
@click="selectResult(item)"
>
<span class="site-search__result-head">
<span class="site-search__result-title">{{ item.title }}</span>
<span class="site-search__result-cat">{{ categoryLabel(item.category) }}</span>
</span>
<span class="site-search__result-excerpt">{{ item.excerpt }}</span>
</button>
</div>
<p v-else class="site-search__tips">
{{ t('search.tips') }}
<kbd>Ctrl</kbd>+<kbd>K</kbd> {{ t('search.tipsShortcut') }}
</p>
</div>
</div>
</Transition>
</Teleport>
</template>
<style scoped>
.site-search {
position: fixed;
inset: 0;
z-index: 1100;
display: flex;
align-items: flex-start;
justify-content: center;
padding: min(12vh, 96px) 16px 24px;
}
.site-search__backdrop {
position: absolute;
inset: 0;
border: none;
background: rgba(15, 39, 64, 0.52);
cursor: pointer;
}
.site-search__panel {
position: relative;
width: min(680px, 100%);
background: #fff;
border: 1px solid #e2eaf2;
border-radius: 16px;
box-shadow: 0 24px 64px rgba(15, 45, 85, 0.18);
overflow: hidden;
}
.site-search__field {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 16px;
border-bottom: 1px solid #eef3f8;
}
.site-search__icon {
flex-shrink: 0;
color: #6b7f94;
}
.site-search__input {
flex: 1;
min-width: 0;
border: none;
background: transparent;
font-size: 16px;
color: var(--ink);
outline: none;
}
.site-search__input::placeholder {
color: #8a9bb0;
}
.site-search__hint {
flex-shrink: 0;
font-size: 11px;
font-family: inherit;
color: #6b7f94;
background: #f4f8fc;
border: 1px solid #dde7f0;
border-radius: 6px;
padding: 2px 6px;
}
.site-search__results {
max-height: min(52vh, 420px);
overflow-y: auto;
padding: 8px;
}
.site-search__empty,
.site-search__tips {
margin: 0;
padding: 16px 18px 18px;
font-size: 14px;
line-height: 1.6;
color: var(--muted);
}
.site-search__tips kbd {
font-size: 11px;
font-family: inherit;
color: #4a6078;
background: #f4f8fc;
border: 1px solid #dde7f0;
border-radius: 5px;
padding: 1px 5px;
margin: 0 2px;
}
.site-search__result {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
width: 100%;
padding: 10px 12px;
border: none;
border-radius: 10px;
background: transparent;
text-align: left;
cursor: pointer;
font-family: inherit;
transition: background 0.12s ease;
}
.site-search__result:hover,
.site-search__result.is-active {
background: #eef6ff;
}
.site-search__result-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
width: 100%;
}
.site-search__result-title {
font-size: 14px;
font-weight: 600;
color: #0f2740;
line-height: 1.35;
}
.site-search__result-cat {
flex-shrink: 0;
font-size: 11px;
font-weight: 600;
letter-spacing: 0.02em;
text-transform: uppercase;
color: var(--blue);
background: rgba(72, 164, 252, 0.08);
border-radius: 999px;
padding: 2px 8px;
}
.site-search__result-excerpt {
font-size: 13px;
line-height: 1.45;
color: var(--muted);
}
.site-search-enter-active,
.site-search-leave-active {
transition: opacity 0.18s ease;
}
.site-search-enter-active .site-search__panel,
.site-search-leave-active .site-search__panel {
transition: transform 0.18s ease, opacity 0.18s ease;
}
.site-search-enter-from,
.site-search-leave-to {
opacity: 0;
}
.site-search-enter-from .site-search__panel,
.site-search-leave-to .site-search__panel {
transform: translateY(-8px) scale(0.98);
opacity: 0;
}
</style>
+226
View File
@@ -0,0 +1,226 @@
<script setup lang="ts">
import type { MediaPublicItem } from '~/data/news-content'
const props = defineProps<{
item: MediaPublicItem
reverse?: boolean
watchYoutubeLabel?: string
watchTiktokLabel?: string
}>()
const primaryVideoUrl = computed(
() => props.item.youtubeUrl || props.item.tiktokUrl || ''
)
</script>
<template>
<article class="cstory" :class="{ 'cstory--reverse': reverse }">
<div class="cstory__grid">
<div class="cstory__media">
<a
v-if="primaryVideoUrl"
:href="primaryVideoUrl"
target="_blank"
rel="noopener noreferrer"
class="cstory__thumb"
:aria-label="item.title"
>
<img :src="item.thumbnail" :alt="item.thumbnailAlt" loading="lazy" />
<span class="cstory__play" aria-hidden="true">
<svg viewBox="0 0 24 24" width="22" height="22" fill="currentColor">
<path d="M8 5v14l11-7z" />
</svg>
</span>
</a>
<div v-else class="cstory__thumb">
<img :src="item.thumbnail" :alt="item.thumbnailAlt" loading="lazy" />
<span class="cstory__play" aria-hidden="true">
<svg viewBox="0 0 24 24" width="22" height="22" fill="currentColor">
<path d="M8 5v14l11-7z" />
</svg>
</span>
</div>
</div>
<div class="cstory__content">
<h2 class="cstory__title">{{ item.title }}</h2>
<p class="cstory__summary">{{ item.summary }}</p>
<div v-if="item.youtubeUrl || item.tiktokUrl" class="cstory__actions">
<a
v-if="item.youtubeUrl"
:href="item.youtubeUrl"
target="_blank"
rel="noopener noreferrer"
class="cstory__btn"
>
{{ watchYoutubeLabel ?? 'Watch on YouTube' }}
</a>
<a
v-if="item.tiktokUrl"
:href="item.tiktokUrl"
target="_blank"
rel="noopener noreferrer"
class="cstory__btn cstory__btn--tiktok"
>
{{ watchTiktokLabel ?? 'Watch on TikTok' }}
</a>
</div>
</div>
</div>
</article>
</template>
<style scoped>
.cstory {
padding: 40px 0;
border-bottom: 1px solid #d8dde3;
}
.cstory:last-child {
border-bottom: none;
}
.cstory__grid {
display: grid;
grid-template-columns: auto 1fr;
gap: 36px;
align-items: center;
}
.cstory--reverse .cstory__grid {
direction: rtl;
}
.cstory--reverse .cstory__grid > * {
direction: ltr;
}
.cstory__thumb {
position: relative;
display: block;
width: 220px;
max-width: 100%;
text-decoration: none;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 4px 16px rgba(15, 39, 64, 0.12);
}
.cstory__thumb img {
width: 220px;
height: 220px;
max-width: 100%;
object-fit: cover;
display: block;
transition: transform 0.2s ease;
}
.cstory__thumb:hover img {
transform: scale(1.03);
}
.cstory__play {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 52px;
height: 52px;
border-radius: 50%;
background: rgba(15, 39, 64, 0.72);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
transition: background 0.18s ease, transform 0.18s ease;
}
.cstory__thumb:hover .cstory__play {
background: rgba(72, 164, 252, 0.92);
transform: translate(-50%, -50%) scale(1.06);
}
.cstory__play svg {
margin-left: 3px;
}
.cstory__content {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
min-width: 0;
}
.cstory__title {
margin: 0;
color: var(--blue);
font-size: clamp(18px, 2.2vw, 22px);
font-weight: 700;
line-height: 1.45;
}
.cstory__summary {
margin: 14px 0 0;
color: #1e1e1e;
font-size: 15px;
line-height: 1.8;
text-align: justify;
}
.cstory__actions {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin-top: 20px;
}
.cstory__btn {
display: inline-block;
padding: 10px 24px;
border: none;
border-radius: 999px;
background: #48a4fc;
color: #fff;
font-family: Georgia, 'Times New Roman', serif;
font-size: 15px;
font-weight: 500;
text-decoration: none;
transition: background 0.18s ease;
}
.cstory__btn:hover {
background: #3a96f0;
}
.cstory__btn--tiktok {
background: #010101;
}
.cstory__btn--tiktok:hover {
background: #222;
}
@media (max-width: 900px) {
.cstory {
padding: 32px 0;
}
.cstory__grid {
grid-template-columns: 1fr;
gap: 20px;
align-items: start;
}
.cstory__thumb,
.cstory__thumb img {
width: min(100%, 280px);
height: min(100%, 280px);
}
.cstory--reverse .cstory__grid {
direction: ltr;
}
}
</style>