1. 海报

This commit is contained in:
李琦
2026-08-03 10:25:11 +08:00
parent 211305c10c
commit 2d5fbbe62a
3 changed files with 48 additions and 0 deletions

View File

@@ -78,6 +78,8 @@ export function defaultSide1PosterConfig() {
return {
...baseFields(1),
side: 1,
pageTitle: '💕李琦❤️李逸烁 · 男方婚礼邀请',
pageDescription: '💍公历2026年9月4日农历七月廿三· 李琦 & 李逸烁 结婚典礼,诚邀您光临。',
sonLabel: '儿子:',
sonName: '李琦',
daughterInLawLabel: '儿媳:',
@@ -109,6 +111,8 @@ export function defaultSide2PosterConfig() {
side: 2,
template: 'split',
mobileLayout: 'landscape',
pageTitle: '💕李琦❤️李逸烁 · 女方婚礼邀请',
pageDescription: '💍公历2026年9月4日农历七月廿三· 李逸烁 & 李琦 结婚典礼,诚邀您光临。',
sonLabel: '女儿:',
sonName: '李逸烁',
daughterInLawLabel: '女婿:',
@@ -140,6 +144,8 @@ export function defaultSide3PosterConfig() {
side: 3,
template: 'classic',
title: '回门宴邀请函',
pageTitle: '💕李琦❤️李逸烁 · 回门宴邀请',
pageDescription: '💍公历2026年9月7日农历七月廿六· 李琦 & 李逸烁 回门宴,诚邀您光临。',
footer: '—回门宴请 ♥ 恭请光临—',
sonLabel: '新郎:',
sonName: '李琦',
@@ -257,6 +263,8 @@ export function normalizePosterConfig(raw, side = 1) {
: base.enterEffect,
invitePath: loaded.invitePath || '/',
inviteButtonText: loaded.inviteButtonText || base.inviteButtonText,
pageTitle: loaded.pageTitle || base.pageTitle || '',
pageDescription: loaded.pageDescription || base.pageDescription || '',
qrCenterImg: loaded.qrCenterImg || '',
verticalSlogan: loaded.verticalSlogan || base.verticalSlogan,
subSlogan1: loaded.subSlogan1 || base.subSlogan1,

View File

@@ -474,6 +474,19 @@
<a-input v-model:value="posterCfg.invitePath" placeholder="/" />
</a-form-item>
</div>
<a-form-item label="页面标题(浏览器标签 / 分享)">
<a-input
v-model:value="posterCfg.pageTitle"
:placeholder="currentPosterSide.label + '海报页面标题'"
/>
</a-form-item>
<a-form-item label="页面描述 description">
<a-textarea
v-model:value="posterCfg.pageDescription"
:rows="2"
placeholder="用于 meta description / 分享摘要"
/>
</a-form-item>
<a-form-item :label="posterCfg.template === 'split' ? '左侧照片' : '顶部照片'">
<image-field
v-model="posterCfg.heroImg"

View File

@@ -138,6 +138,32 @@ function goInvite() {
else router.push(path)
}
function upsertMeta(attr, key, content) {
if (!content) return
let el = document.head.querySelector(`meta[${attr}="${key}"]`)
if (!el) {
el = document.createElement('meta')
el.setAttribute(attr, key)
document.head.appendChild(el)
}
el.setAttribute('content', content)
}
function applyPageMeta() {
const title = String(cfg.pageTitle || cfg.title || posterSideMeta(cfg.side).label || '').trim()
const desc = String(cfg.pageDescription || '').trim()
if (title) {
document.title = title
upsertMeta('property', 'og:title', title)
upsertMeta('name', 'twitter:title', title)
}
if (desc) {
upsertMeta('name', 'description', desc)
upsertMeta('property', 'og:description', desc)
upsertMeta('name', 'twitter:description', desc)
}
}
async function mountCaptureQr(host) {
const isSplit = host.classList.contains('sp-card')
const target = isSplit
@@ -249,6 +275,7 @@ onMounted(async () => {
} catch {
Object.assign(cfg, normalizePosterConfig(null, side))
}
applyPageMeta()
runSequence()
})