fix: 修复餐饮页面底部遮挡及分类提交控件
This commit is contained in:
1 parent
e5a1a60eee
commit
f324b663a6
5 files changed
+65
-1
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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("请填写");
|
||||
});
|
||||
}
|
||||
@@ -33,3 +33,7 @@ Web 未接入微信身份登录,没有已有会话时仅支持填写与校验
|
||||
## Web 预览宽度
|
||||
|
||||
手机小于 430px 时使用屏幕宽度;更宽屏幕使用居中的 430px 内容区。预览外框使用真实 CSS 像素并锁定对应 rem 基准,避免被 Taro 设计稿单位转换二次缩放。底部导航和详情操作栏与内容区对齐。响应式浏览器测试覆盖 375、430、768、1280px;包括原有交互共 9 项通过。
|
||||
|
||||
## 餐饮控件与底部避让修复
|
||||
|
||||
H5 tab 页面统一预留导航避让与安全区空间,删除桌面 app 最小高度对导航容器高度的干扰。餐品分类按钮明确使用内容宽度,避免 H5 Button 默认满宽挤走其他分类。提交按钮明确高度、内边距及文字居中。浏览器检查覆盖手机与桌面滚动到底后的首页最后卡片、咨询记录入口、分类切换和提交校验;共 11 项通过。餐饮 H5、微信构建及格式、类型、lint 通过。微信构建结果不替代微信 IDE 视觉验收。
|
||||
@@ -1117,6 +1117,7 @@
|
||||
border-bottom: 1px solid #f5f5f4;
|
||||
}
|
||||
.food-list .filter {
|
||||
width: auto;
|
||||
margin: 0;
|
||||
padding: 12px 24px;
|
||||
flex-shrink: 0;
|
||||
|
||||
Reference in new issue
Block a user