From 7dee45aeed69d74eecafb0742ff374872f920e8c Mon Sep 17 00:00:00 2001 From: xuchao Date: Tue, 21 Jul 2026 16:07:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=A5=E8=B4=B4=E4=BB=B7=E9=A3=98?= =?UTF-8?q?=E5=B8=A6=E6=96=87=E5=AD=97=E5=B1=85=E4=B8=AD=20+=20=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E4=B8=8E=E5=85=83=E7=95=99=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 实测底图(image_bj_text.png)右侧约 18% 是蓝色箭头、左侧橙色才是文字槽。 旧代码 content-box 把飘带拉宽、箭头右移,文字左贴留下右侧空档=太靠左。 改法:盒子改 border-box 精确等于底图宽,右侧 padding 让出箭头区, 文字在橙色槽内 justify-content 居中;拆成 标签/¥/价格/元 四段控制间距, 价格与"元"间留 8rpx(375 屏约 4px),去掉导致数字上偏的 margin-bottom。 实测:文字居中、左留白与右留白均衡、元与价格有明显间距、不压蓝色箭头。 Co-Authored-By: Claude Opus 4.8 --- pages/ticket/scenic.vue | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/pages/ticket/scenic.vue b/pages/ticket/scenic.vue index 06f8a2a..719e8aa 100644 --- a/pages/ticket/scenic.vue +++ b/pages/ticket/scenic.vue @@ -11,8 +11,8 @@ {{item.subTypeId}} 原售价{{(item.price/100).toFixed(0)}}元 - 会员补贴价¥{{(item.unitPrice/100).toFixed(0)}}元 + 会员补贴价¥{{(item.unitPrice/100).toFixed(0)}}元 @@ -122,24 +122,41 @@ .p_text { position: absolute; bottom: 0rpx; - width: 240rpx; right: 0rpx; + // xuchao: border-box 让盒子精确等于底图宽度;右侧 padding 让出蓝色箭头区,文字在橙色槽内居中 + width: 250rpx; height: 50rpx; + box-sizing: border-box; background: url('https://aliyunoss.hn12301.net/xgh/image_bj_text.png'); background-size: 100% 100%; display: flex; align-items: center; + justify-content: center; color: #fff; - font-size: 16rpx; - padding-left: 18rpx; + padding-left: 14rpx; + padding-right: 51rpx; border-radius: 4rpx; } + .p_label { + font-size: 16rpx; + } + + .p_symbol { + font-size: 18rpx; + margin: 0 2rpx 0 6rpx; + } + .p_num { font-size: 32rpx; font-style: italic; font-weight: bold; - margin-bottom: 8rpx; + } + + .p_unit { + font-size: 16rpx; + // xuchao: 价格与"元"之间留出明显间距(8rpx ≈ 375 屏 4px) + margin-left: 8rpx; } .nr_origin {