更新页面效果
This commit is contained in:
@@ -78,6 +78,17 @@
|
||||
<a-form-item label="竖排文案 · 下联">
|
||||
<a-input v-model:value="cfg.formalText2" placeholder="如 良缘永结 匹配同称" />
|
||||
</a-form-item>
|
||||
<a-form-item label="邀请文案页高度">
|
||||
<div class="flex gap-2 items-center">
|
||||
<a-select :value="heightFieldSelectValue(cfg.formalPageHeight)" @change="(v) => onHeightFieldModeChange(cfg, 'formalPageHeight', v)" class="flex-1">
|
||||
<a-select-option v-for="opt in HEIGHT_PRESETS" :key="opt.value" :value="opt.value">{{ opt.label }}</a-select-option>
|
||||
</a-select>
|
||||
<a-input-number v-if="heightFieldSelectValue(cfg.formalPageHeight) === '__custom__'"
|
||||
:value="customVhValue(cfg.formalPageHeight)" @change="(v) => onHeightFieldCustomVh(cfg, 'formalPageHeight', v)"
|
||||
:min="20" :max="200" addon-after="vh" class="w-[150px]" />
|
||||
</div>
|
||||
<div class="text-[11px] text-[#8A8680] mt-1">控制前台竖排邀请文案页的展示高度,默认满屏。</div>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</a-tab-pane>
|
||||
@@ -398,7 +409,7 @@ function defaultConfig() {
|
||||
return {
|
||||
groom: '李明', bride: '王华', date: '2026-05-20', lunar: '农历四月初四 星期三',
|
||||
hotel: '杭州星光万丽大酒店', address: '杭州市西湖区星光大道88号\n3楼大宴会厅',
|
||||
formalText1: '两姓联姻 一堂缔约', formalText2: '良缘永结 匹配同称',
|
||||
formalText1: '两姓联姻 一堂缔约', formalText2: '良缘永结 匹配同称', formalPageHeight: '100vh',
|
||||
heroImg: 'https://images.unsplash.com/photo-1583939003579-730e3918a45a?auto=format&fit=crop&w=800&q=80',
|
||||
endImg: 'https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&w=800&q=80',
|
||||
musicList: [{ url: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3', name: '背景音乐 1' }],
|
||||
@@ -446,19 +457,31 @@ const HEIGHT_PRESETS = [
|
||||
{ label: '自定义', value: '__custom__' },
|
||||
]
|
||||
function heightSelectValue(page) {
|
||||
const match = HEIGHT_PRESETS.find((p) => p.value === page.height)
|
||||
return match ? match.value : '__custom__'
|
||||
return heightFieldSelectValue(page.height)
|
||||
}
|
||||
function onHeightModeChange(page, val) {
|
||||
if (val !== '__custom__') page.height = val
|
||||
}
|
||||
function customVh(page) {
|
||||
const m = /^([\d.]+)vh$/.exec(page.height || '')
|
||||
return m ? Number(m[1]) : 100
|
||||
return customVhValue(page.height)
|
||||
}
|
||||
function onCustomVh(page, val) {
|
||||
page.height = (val || 100) + 'vh'
|
||||
}
|
||||
function heightFieldSelectValue(value) {
|
||||
const match = HEIGHT_PRESETS.find((p) => p.value === value)
|
||||
return match ? match.value : '__custom__'
|
||||
}
|
||||
function customVhValue(value) {
|
||||
const m = /^([\d.]+)vh$/.exec(value || '')
|
||||
return m ? Number(m[1]) : 100
|
||||
}
|
||||
function onHeightFieldModeChange(target, key, val) {
|
||||
if (val !== '__custom__') target[key] = val
|
||||
}
|
||||
function onHeightFieldCustomVh(target, key, val) {
|
||||
target[key] = (val || 100) + 'vh'
|
||||
}
|
||||
|
||||
function ensurePageShape(p) {
|
||||
if (p.type === 'single') { p.img1 = p.img1 || ''; delete p.img2; delete p.images }
|
||||
@@ -664,6 +687,7 @@ onMounted(async () => {
|
||||
}
|
||||
loaded.endImg = loaded.endImg || loaded.heroImg || cfg.endImg
|
||||
Object.assign(cfg, loaded)
|
||||
cfg.formalPageHeight = cfg.formalPageHeight || '100vh'
|
||||
cfg.photoPages = (cfg.photoPages || []).map(ensurePageShape)
|
||||
setActivePhotoIndex(currentPhotoIndex.value)
|
||||
// 数值型参数兜底(兼容旧配置)
|
||||
|
||||
Reference in New Issue
Block a user