fix: 修复餐饮页面底部遮挡及分类提交控件

This commit is contained in:
que01 committed 2026-10-08 15:51:36 +08:00
1 parent e5a1a60eee
commit f324b663a6
5 files changed
+65 -1

No files matched your search

+6 -1
View File
@@ -36,6 +36,12 @@ image {
font-size: 22px;
}
/* postcss-pxtransform disable */
/* H5 导航固定在视口底部,滚动页面必须保留真实像素的避让空间。 */
.taro_tabbar_page {
box-sizing: border-box;
padding-bottom: calc(66px + env(safe-area-inset-bottom));
}
@media (min-width: 430px) {
html {
font-size: 22.933333px !important;
@@ -46,7 +52,6 @@ image {
margin: 0 auto;
}
#app {
min-height: 100vh;
background: #fafaf9;
}
.taro-tabbar__tabbar,
+14
View File
@@ -104,6 +104,13 @@
font-size: 24px;
}
.submit-button {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: 88px;
padding: 20px 24px;
line-height: 1.5;
margin: 32px 0 0;
background: #f97316;
color: #fff;
@@ -190,6 +197,13 @@
}
.editorial-inquiry .submit-button,
.editorial-forms .submit-button {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: 88px;
padding: 20px 24px;
line-height: 1.5;
background: #202221;
}
.editorial-inquiry,
+40
View File
@@ -114,3 +114,43 @@ for (const width of [375, 430, 768, 1280]) {
expect(bar!.width).toBeCloseTo(expectedWidth, 0);
});
}
for (const width of [375, 1280]) {
test(`餐饮控件与底部避让 ${width}`, async ({ page }) => {
await page.setViewportSize({ width, height: 812 });
const scrollToBottom = async () => {
await page.evaluate(() => {
document.querySelectorAll("*").forEach((element) => {
if (/auto|scroll/.test(getComputedStyle(element).overflowY))
element.scrollTop = element.scrollHeight;
});
window.scrollTo(0, document.body.scrollHeight);
});
};
const aboveNavigation = async (selector: string) => {
const bottom = await page.locator(selector).last().boundingBox();
const nav = await page.locator(".taro-tabbar__tabbar").boundingBox();
expect(bottom!.y + bottom!.height).toBeLessThan(nav!.y - 8);
};
await page.goto("/");
await expect(page.locator(".food-home .promise").last()).toBeAttached();
await scrollToBottom();
await aboveNavigation(".food-home .promise");
await page.goto("/#/pages/offerings/index");
await expect(page.locator(".filter").first()).toBeVisible();
const filters = await page
.locator(".filter")
.evaluateAll((elements) => elements.map((element) => element.getBoundingClientRect().width));
expect(filters[0]).toBeLessThan(200);
await page.locator(".filter").nth(1).click();
await expect(page.locator(".filter").nth(1)).toHaveClass(/active/);
await page.goto("/#/pages/inquiry/index");
await expect(page.locator(".submit-button")).toBeVisible();
await scrollToBottom();
await aboveNavigation(".history-link");
const button = await page.locator(".submit-button").boundingBox();
expect(button!.height).toBeGreaterThanOrEqual(44);
await page.locator(".submit-button").click();
await expect(page.locator(".form-error")).toContainText("请填写");
});
}