feat(ui): 适配手机端布局与触控交互
窄屏改用抽屉导航和卡片列表,加大触控区域并处理安全区,避免表格横向溢出。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -76,14 +76,14 @@ export default async function BirthdayPage({
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<Card className="flex flex-wrap items-center justify-between gap-3 p-3">
|
||||
<Card className="flex flex-col gap-3 p-3 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between">
|
||||
<BirthdayControl mode={mode} date={dateStr} />
|
||||
<div className="pr-1 text-sm text-[var(--color-muted-foreground)]">
|
||||
<div className="text-sm text-[var(--color-muted-foreground)] sm:pr-1">
|
||||
命中 <span className="font-semibold text-[var(--color-foreground)]">{rows.length}</span> 位商户
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
<Card className="overflow-hidden">
|
||||
<Card className="hidden overflow-hidden md:block">
|
||||
<Table>
|
||||
<THead>
|
||||
<tr>
|
||||
@@ -131,6 +131,50 @@ export default async function BirthdayPage({
|
||||
</tbody>
|
||||
</Table>
|
||||
</Card>
|
||||
|
||||
<div className="space-y-3 md:hidden">
|
||||
{rows.length === 0 && (
|
||||
<Card className="py-14 text-center text-sm text-[var(--color-muted-foreground)]">
|
||||
该时段暂无生日商户
|
||||
</Card>
|
||||
)}
|
||||
{rows.map((c) => {
|
||||
const ownerName = c.birthdayOwner === 1 ? c.balanceUser : c.contacts;
|
||||
const ownerPhone =
|
||||
(c.birthdayOwner === 1 ? c.balanceUserPhone : c.contactsPhone) || c.phone;
|
||||
return (
|
||||
<Card key={c.id} className="p-4">
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<div className="min-w-0">
|
||||
<div className="truncate font-medium">{c.customerName}</div>
|
||||
<div className="mt-1 text-xs text-[var(--color-muted-foreground)]">
|
||||
{c.salesman || "—"}
|
||||
</div>
|
||||
</div>
|
||||
<Badge tone={c.birthdayType === 2 ? "warning" : "info"} className="shrink-0">
|
||||
{c.birthdayType === 2 ? "农历" : "阳历"}
|
||||
</Badge>
|
||||
</div>
|
||||
<dl className="mt-3 grid grid-cols-2 gap-x-3 gap-y-2 text-sm">
|
||||
<div>
|
||||
<dt className="text-xs text-[var(--color-muted-foreground)]">归属人</dt>
|
||||
<dd>{ownerName || "—"}</dd>
|
||||
<dd className="text-xs tabular-nums text-[var(--color-muted-foreground)]">
|
||||
{superAdmin ? ownerPhone : maskPhone(ownerPhone)}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="text-xs text-[var(--color-muted-foreground)]">生日</dt>
|
||||
<dd className="tabular-nums">{fmtDate(c.birthday)}</dd>
|
||||
<dd className="text-xs text-[var(--color-muted-foreground)]">
|
||||
{c.birthdayOwner === 1 ? "结算人" : "联系人"}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</Card>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user