From ce11f509423e0a71bde647e4b4607ecde9f7e688 Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Fri, 30 Oct 2026 09:27:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(pc-decorate):=20=E4=BC=98=E5=8C=96PC?= =?UTF-8?q?=E6=A5=BC=E5=B1=82=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E9=AB=98=E5=BA=A6=E3=80=81=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8F=AF=E8=A7=86=E5=8C=96=E7=83=AD=E5=8C=BA=E5=9B=BE=E7=BB=98?= =?UTF-8?q?=E5=88=B6=E5=8F=8A=E7=BC=96=E8=BE=91=E5=99=A8=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix(editor): 修复点击返回页面列表 autoSaveTimer is not defined 运行时错误,优化回退逻辑 - feat(hotzone): PC 端热区图接入可视化组件,支持拖拽画框、拉伸缩放与百分比自适应 - fix(floor-height): 商品宫格、宫格楼层、横幅楼层、商品条等默认行高改为自适应撑开,防止商品溢出截断 - fix(video): 修正视频组件默认行高与播放器高度对齐为 450px,避免底部遮挡 - fix(freelayout): 统一自由排版默认高度与后台画布高度为 450px,消除底部空白 - feat(adaptive): 频道宫格、品牌墙、优惠券等集合类组件支持动态行高与 autoCompTypes 弹性包裹 - refactor(preset): 优化双端 double11Preset 预设模板,清理遗留固定行高 --- .../components/indexDecorate/RowWrapper.vue | 33 +++++-- .../indexDecorate/components/HotZone.vue | 10 +-- .../indexDecorate/presets/double11Preset.js | 20 +++-- manager/src/components/hotzone/index.vue | 9 +- .../pc/config-panel/PanelHotZone.vue | 88 +++++++++++++++++-- .../src/views/page-decoration/pc/config.js | 27 +++--- .../src/views/page-decoration/pc/index.vue | 64 ++++++++++---- .../pc/presets/double11Preset.js | 20 +++-- .../pc/template/TplFreeLayout.vue | 2 +- .../pc/template/TplHotZone.vue | 8 +- 10 files changed, 210 insertions(+), 71 deletions(-) diff --git a/buyer/src/components/indexDecorate/RowWrapper.vue b/buyer/src/components/indexDecorate/RowWrapper.vue index 69c91ef89..cbebe7e57 100644 --- a/buyer/src/components/indexDecorate/RowWrapper.vue +++ b/buyer/src/components/indexDecorate/RowWrapper.vue @@ -12,7 +12,7 @@ class="component-cell" - :style="getComponentCellStyle(comp.componentStyle, row.rowStyle, row.components ? row.components.length : 1)" + :style="getComponentCellStyle(comp.componentStyle, row.rowStyle, row.components ? row.components.length : 1, comp.type)" > @@ -69,6 +69,10 @@ const props = defineProps({ +const hasAutoComp = computed(() => { + return Array.isArray(props.row.components) && props.row.components.some(c => ['goodsGrid', 'gridFloor', 'bannerFloor', 'goodsBar', 'channelFloor', 'goodsList', 'recommendFeed', 'articleContent', 'brandWall', 'channelGrid', 'couponList'].includes(c?.type)); +}); + const rowWrapperStyle = computed(() => { const s = props.row.rowStyle || {}; const style = {}; @@ -96,8 +100,12 @@ const rowWrapperStyle = computed(() => { const h = String(s.height).trim(); if (h && Number(h) > 0) { const hVal = /^\d+$/.test(h) ? `${h}px` : h; - style.height = hVal; - style.minHeight = hVal; + if (hasAutoComp.value) { + style.minHeight = hVal; + } else { + style.height = hVal; + style.minHeight = hVal; + } } } @@ -164,8 +172,12 @@ const rowInnerFlexStyle = computed(() => { const h = String(s.height).trim(); if (h && Number(h) > 0) { const hVal = /^\d+$/.test(h) ? `${h}px` : h; - styleObj.height = hVal; - styleObj.minHeight = hVal; + if (hasAutoComp.value) { + styleObj.minHeight = hVal; + } else { + styleObj.height = hVal; + styleObj.minHeight = hVal; + } } } @@ -175,7 +187,8 @@ const rowInnerFlexStyle = computed(() => { -function getComponentCellStyle(style, rowStyle = {}, totalComps = 1) { +function getComponentCellStyle(style, rowStyle = {}, totalComps = 1, compType = '') { + const isAutoHeightComp = compType && ['goodsGrid', 'gridFloor', 'bannerFloor', 'goodsBar', 'channelFloor', 'goodsList', 'recommendFeed', 'articleContent', 'brandWall', 'channelGrid', 'couponList'].includes(compType); if (!style) return { flex: '1 1 0%' }; @@ -185,8 +198,12 @@ function getComponentCellStyle(style, rowStyle = {}, totalComps = 1) { const rh = String(rowStyle.height).trim(); if (rh && Number(rh) > 0) { const rhVal = /^\d+$/.test(rh) ? `${rh}px` : rh; - s.height = rhVal; - s.minHeight = rhVal; + if (isAutoHeightComp) { + s.minHeight = rhVal; + } else { + s.height = rhVal; + s.minHeight = rhVal; + } } } const gap = Number(rowStyle?.gap) || 0; diff --git a/buyer/src/components/indexDecorate/components/HotZone.vue b/buyer/src/components/indexDecorate/components/HotZone.vue index a07e304ba..e3910bd1b 100644 --- a/buyer/src/components/indexDecorate/components/HotZone.vue +++ b/buyer/src/components/indexDecorate/components/HotZone.vue @@ -7,10 +7,10 @@ :key="idx" class="zone-link" :style="{ - top: `${zone.top || 0}%`, - left: `${zone.left || 0}%`, - width: `${zone.width || 10}%`, - height: `${zone.height || 10}%` + top: `${zone.top !== undefined ? zone.top : ((zone.topPer || 0) * 100)}%`, + left: `${zone.left !== undefined ? zone.left : ((zone.leftPer || 0) * 100)}%`, + width: `${zone.width !== undefined ? zone.width : ((zone.widthPer || 0.1) * 100)}%`, + height: `${zone.height !== undefined ? zone.height : ((zone.heightPer || 0.1) * 100)}%` }" :title="zone.title" @click="handleClickZone(zone)" @@ -68,7 +68,7 @@ const customStyle = computed(() => { }); function handleClickZone(zone) { - const url = zone?.url ? String(zone.url).trim() : ''; + const url = (zone?.url || zone?.link) ? String(zone.url || zone.link).trim() : ''; if (!url) return; if (/^https?:\/\//i.test(url)) { window.open(url, '_blank'); diff --git a/buyer/src/components/indexDecorate/presets/double11Preset.js b/buyer/src/components/indexDecorate/presets/double11Preset.js index edb8b6ba9..e5bc34c99 100644 --- a/buyer/src/components/indexDecorate/presets/double11Preset.js +++ b/buyer/src/components/indexDecorate/presets/double11Preset.js @@ -724,7 +724,7 @@ export const DOUBLE11_PAGE_DOCUMENT = { 0, 0 ], - "height": 180 + "height": 220 }, "components": [ { @@ -901,6 +901,7 @@ export const DOUBLE11_PAGE_DOCUMENT = { "backgroundColor": "transparent" }, "options": { + "height": 450, "elements": [ { "type": "badge", @@ -979,7 +980,7 @@ export const DOUBLE11_PAGE_DOCUMENT = { 16 ], "borderRadius": "8px", - "height": 560 + "height": "" }, "components": [ { @@ -1061,7 +1062,7 @@ export const DOUBLE11_PAGE_DOCUMENT = { 16 ], "borderRadius": "8px", - "height": 560 + "height": "" }, "components": [ { @@ -1140,7 +1141,7 @@ export const DOUBLE11_PAGE_DOCUMENT = { 16 ], "borderRadius": "8px", - "height": 620 + "height": "" }, "components": [ { @@ -1249,7 +1250,7 @@ export const DOUBLE11_PAGE_DOCUMENT = { 16 ], "borderRadius": "8px", - "height": 420 + "height": "" }, "components": [ { @@ -1404,7 +1405,7 @@ export const DOUBLE11_PAGE_DOCUMENT = { 16 ], "borderRadius": "8px", - "height": 360 + "height": 450 }, "components": [ { @@ -1417,6 +1418,7 @@ export const DOUBLE11_PAGE_DOCUMENT = { }, "options": { "videoUrl": "https://vjs.zencdn.net/v/oceans.mp4", + "height": 450, "coverUrl": "https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/video/video_cover.png", "url": "/goodsList?brand=1", "title": "双11全球狂欢发布盛典 · 年度旗舰好物真实开箱测评", @@ -1481,7 +1483,7 @@ export const DOUBLE11_PAGE_DOCUMENT = { 16 ], "borderRadius": "8px", - "height": 220 + "height": "" }, "components": [ { @@ -1656,7 +1658,7 @@ export const DOUBLE11_PAGE_DOCUMENT = { 16 ], "borderRadius": "8px", - "height": 980 + "height": "" }, "components": [ { @@ -1810,7 +1812,7 @@ export const DOUBLE11_PAGE_DOCUMENT = { 16 ], "borderRadius": "8px", - "height": 1270 + "height": "" }, "components": [ { diff --git a/manager/src/components/hotzone/index.vue b/manager/src/components/hotzone/index.vue index 041b65fbf..bb45056b0 100644 --- a/manager/src/components/hotzone/index.vue +++ b/manager/src/components/hotzone/index.vue @@ -1,7 +1,7 @@