From b01effaf5e4bd8c435f2ee5f8a3ef20fa5bea7c0 Mon Sep 17 00:00:00 2001 From: Blizzard Date: Fri, 31 Jul 2026 08:40:06 +0800 Subject: [PATCH] =?UTF-8?q?style(fe):=20=E7=A4=BE=E5=8C=BA=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E5=9B=BE=E7=89=87=E6=94=B9=E5=9B=BA=E5=AE=9A=E5=B0=8F?= =?UTF-8?q?=E7=BC=A9=E7=95=A5=E5=9B=BE=EF=BC=88210rpx=20=E6=AD=A3=E6=96=B9?= =?UTF-8?q?=E5=BD=A2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit aspect-ratio 在微信渲染不生效导致竖图被撑长。改成 flex-wrap + 显式 210rpx 见方的缩略图,小而统一,点击 previewImage 放大。 Co-Authored-By: Claude Opus 5 --- pets-fe/app.wxss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pets-fe/app.wxss b/pets-fe/app.wxss index 3fb35a8..1f7307a 100644 --- a/pets-fe/app.wxss +++ b/pets-fe/app.wxss @@ -389,11 +389,11 @@ page{scrollbar-width:none;-ms-overflow-style:none} .pu-s{font-size:var(--fs-sm);color:var(--muted)} .post-content{font-size:var(--fs-md);line-height:1.62;color:var(--text-2);margin-bottom:var(--sp-3)} -.photo-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--sp-1);margin-bottom:var(--sp-3)} +.photo-grid{display:flex;flex-wrap:wrap;gap:var(--sp-1);margin-bottom:var(--sp-3)} .photo-tile{ - /* 微信 image 默认 320x240,不显式给宽高会撑破网格。width:100% + min-width:0 - 让它缩进 1fr 格子,aspect-ratio 保持正方形,overflow 裁掉溢出 */ - width:100%;min-width:0;aspect-ratio:1;overflow:hidden; + /* 固定尺寸小缩略图,正方形。不用 aspect-ratio(微信渲染不生效,竖图会被撑长), + 显式 width/height 最稳;mode=aspectFill 裁成正方,点击再走 previewImage 放大 */ + width:210rpx;height:210rpx;flex:none;overflow:hidden; border-radius:var(--r-sm);background:var(--primary-soft); display:flex;align-items:center;justify-content:center;font-size:56rpx; }