MIF7T-1/MIF7T-7 收口真机反馈并统一移动体验

这个提交包含在:
2026-05-13 10:17:50 +08:00
父节点 44b5af4f1e
当前提交 cf2bba02d5
共修改 30 个文件,包含 793 行新增和 264 行删除
@@ -1,4 +1,6 @@
import type { ReactNode } from "react";
import { useEffect } from "react";
import { ArrowLeft } from "lucide-react";
import { useLocation, useNavigate } from "react-router-dom";
import { Button } from "../ui/button";
@@ -26,14 +28,26 @@ export function MobileDetailHeader({ title, subtitle, status, fallbackTo, testId
const currentPath = `${location.pathname}${location.search}`;
const from = isSafeMobileSource(state?.from, currentPath) ? state?.from : null;
useEffect(() => {
const scrollToTop = () => {
window.scrollTo({ top: 0, behavior: "auto" });
document.querySelector<HTMLElement>(".hyb-mobile-shell .overflow-y-auto")?.scrollTo({ top: 0, behavior: "auto" });
};
scrollToTop();
const frameId = window.requestAnimationFrame(scrollToTop);
return () => window.cancelAnimationFrame(frameId);
}, [currentPath]);
const handleBack = () => {
navigate(from ?? fallbackTo, { replace: true });
};
return (
<header className="mobile-detail-header flex min-h-12 items-center gap-3" data-testid={testId}>
<Button className="shrink-0 px-3" size="sm" type="button" variant="secondary" onClick={handleBack}>
返回
<Button className="min-h-11 shrink-0 gap-1 px-3" size="sm" type="button" variant="secondary" onClick={handleBack}>
<ArrowLeft aria-hidden="true" className="size-4" />
<span>返回</span>
</Button>
<div className="min-w-0 flex-1">
<div className="truncate text-base font-semibold text-zinc-900">{title}</div>
@@ -12,8 +12,10 @@ import {
IdCard,
Network,
PackageSearch,
QrCode,
ReceiptText,
Settings,
ShoppingCart,
UserCog,
UserRound,
Users,
@@ -34,9 +36,11 @@ const MOBILE_ICON_MAP: Record<string, LucideIcon> = {
notifications: Bell,
person: UserRound,
picture_as_pdf: FileText,
qr_code_scanner: QrCode,
receipt_long: ReceiptText,
request_quote: FileCheck2,
settings: Settings,
shopping_cart: ShoppingCart,
workspaces: BriefcaseBusiness,
};
@@ -1,6 +1,12 @@
import type { ReactNode } from "react";
import type { ComponentPropsWithoutRef } from "react";
import { cn } from "../../lib/utils";
export function PageScaffold({ className, children }: { className?: string; children: ReactNode }) {
return <div className={cn("page-scaffold", className)}>{children}</div>;
type PageScaffoldProps = ComponentPropsWithoutRef<"div">;
export function PageScaffold({ className, children, ...props }: PageScaffoldProps) {
return (
<div className={cn("page-scaffold", className)} {...props}>
{children}
</div>
);
}