移动端页脚电话支持一键拨号

This commit is contained in:
Rei
2026-09-09 11:59:40 +08:00
parent 16313c5add
commit ad70023215
2 changed files with 9 additions and 1 deletions
+7 -1
View File
@@ -5,6 +5,8 @@ import { getCMSConfig, useCMS, useCMSTexts } from '@/services/cms'
export default function Footer() {
const { data: config } = useCMS(getCMSConfig, null)
const { data: texts } = useCMSTexts()
const hotline = String(config?.hotline || '').trim()
const phoneLink = hotline.replace(/[^\d+]/g, '')
return (
<footer className="site-footer">
<div className="container footer-grid">
@@ -34,7 +36,11 @@ export default function Footer() {
<Link to="/contact">咨询获取方案</Link>
</li>
</ul>
{(config?.hotline || config?.contact_email) && <p className="footer-desc" style={{marginTop:16}}>{[config.hotline, config.contact_email].filter(Boolean).join(' · ')}</p>}
{(hotline || config?.contact_email) && <p className="footer-desc" style={{marginTop:16}}>
{hotline && <a className="footer-contact-link" href={`tel:${phoneLink}`} aria-label={`拨打电话 ${hotline}`}>{hotline}</a>}
{hotline && config?.contact_email && ' · '}
{config?.contact_email && <a className="footer-contact-link" href={`mailto:${config.contact_email}`}>{config.contact_email}</a>}
</p>}
</div>
</div>
<div className="container footer-bottom">
+2
View File
@@ -77,6 +77,8 @@
color: #64748b;
}
.footer-bottom a { color: #94a3b8; }
.footer-contact-link { color: #94a3b8; }
.footer-contact-link:hover { color: #fff; }
@media (max-width: 960px) {
.nav-menu, .nav-resident {