From 4eedf7b1f11391de28bcdaba78e0cb855d7e8ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=90=A6?= Date: Fri, 31 Jul 2026 15:03:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B5=E9=9D=A2=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/admin/AdminEditor.vue | 34 +++- vite-tailwindcss/src/views/index/index.vue | 178 ++++++++++++------ 2 files changed, 153 insertions(+), 59 deletions(-) diff --git a/vite-tailwindcss/src/views/admin/AdminEditor.vue b/vite-tailwindcss/src/views/admin/AdminEditor.vue index 33a6eea..25a4c92 100644 --- a/vite-tailwindcss/src/views/admin/AdminEditor.vue +++ b/vite-tailwindcss/src/views/admin/AdminEditor.vue @@ -78,6 +78,17 @@ + +
+ + {{ opt.label }} + + +
+
控制前台竖排邀请文案页的展示高度,默认满屏。
+
@@ -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) // 数值型参数兜底(兼容旧配置) diff --git a/vite-tailwindcss/src/views/index/index.vue b/vite-tailwindcss/src/views/index/index.vue index 09c0b4c..9d6dff8 100644 --- a/vite-tailwindcss/src/views/index/index.vue +++ b/vite-tailwindcss/src/views/index/index.vue @@ -1,22 +1,28 @@