1. 海报
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user