Files
umed/web/components/AppFooter.vue
T
2026-07-09 14:35:32 +08:00

319 lines
11 KiB
Vue

<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>