From fce7ad0c57919db7e58494f9fb6f03f2b3601462 Mon Sep 17 00:00:00 2001 From: que01 Date: Thu, 8 Oct 2026 16:02:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=92=A8=E8=AF=A2=E6=8C=89=E9=92=AE=E5=AE=BD=E5=BA=A6=E6=BA=A2?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/taro/test/browser/preview.spec.ts | 5 +++++ packages/template-acheng-campus-food/taro/style.css | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/taro/test/browser/preview.spec.ts b/apps/taro/test/browser/preview.spec.ts index 91d2154..3044a88 100644 --- a/apps/taro/test/browser/preview.spec.ts +++ b/apps/taro/test/browser/preview.spec.ts @@ -4,6 +4,11 @@ test("真实 API 驱动首页、出摊和主理人视觉槽位", async ({ page } page.on("pageerror", (error) => errors.push(error.message)); await page.goto("/"); await expect(page.locator(".food-home .name")).toContainText("阿成"); + const actionBounds = await page.locator(".food-home .actions button").evaluateAll((buttons) => { + const parent = buttons[0].parentElement!.getBoundingClientRect(); + return buttons.map((button) => button.getBoundingClientRect().right - parent.right); + }); + expect(Math.max(...actionBounds)).toBeLessThanOrEqual(1); const widths = await page.locator(".scene").evaluate((element) => ({ image: element.getBoundingClientRect().width, parent: element.parentElement!.getBoundingClientRect().width, diff --git a/packages/template-acheng-campus-food/taro/style.css b/packages/template-acheng-campus-food/taro/style.css index 7efc8c7..629c6d7 100644 --- a/packages/template-acheng-campus-food/taro/style.css +++ b/packages/template-acheng-campus-food/taro/style.css @@ -128,7 +128,13 @@ margin-top: 20px; } .food-home .actions button { - flex: 1; + flex: 1 1 0; + width: 0; + min-width: 0; + margin: 0; + padding: 0 8px; + overflow: hidden; + white-space: nowrap; height: 76px; border-radius: 20px; background: #e87532;