fix:提交修改信息
This commit is contained in:
@@ -12,6 +12,16 @@ function auditStatus(store: Record<string, unknown>) {
|
||||
return String(audits?.[0]?.status ?? '').toUpperCase();
|
||||
}
|
||||
|
||||
function storeStatusLabel(store: Record<string, unknown>) {
|
||||
const audit = auditStatus(store);
|
||||
if (audit === 'PENDING') return '待审核';
|
||||
const s = String(store.status).toUpperCase();
|
||||
if (s === 'OPEN') return '营业中';
|
||||
if (s === 'PAUSED') return '暂时闭店';
|
||||
if (s === 'CLOSED') return '已关闭';
|
||||
return s;
|
||||
}
|
||||
|
||||
export default function HomePage() {
|
||||
const navigate = useNavigate();
|
||||
const [dash, setDash] = useState<Record<string, unknown> | null>(null);
|
||||
@@ -42,6 +52,8 @@ export default function HomePage() {
|
||||
return created.getMonth() === now.getMonth() && created.getFullYear() === now.getFullYear();
|
||||
}).length;
|
||||
|
||||
const recentFromDash = (dash?.recentStores as Array<Record<string, unknown>> | undefined) ?? [];
|
||||
const displayStores = stores.length > 0 ? stores : recentFromDash;
|
||||
const previewLeaderboard = LEADERBOARD_MOCK.slice(0, 2);
|
||||
|
||||
return (
|
||||
@@ -167,14 +179,29 @@ export default function HomePage() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{stores.length > 0 && (
|
||||
{pendingStores.length > 0 && (
|
||||
<div className="partner-pending-stores">
|
||||
<p className="label-md text-muted" style={{ marginBottom: 8 }}>待审核门店名称</p>
|
||||
<ul className="partner-store-name-list partner-store-name-list--compact">
|
||||
{pendingStores.map((s) => (
|
||||
<li key={String(s.id)}>
|
||||
<span className="headline-md">{String(s.name || '未命名门店')}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{displayStores.length > 0 && (
|
||||
<ul className="partner-store-name-list">
|
||||
{stores.slice(0, 5).map((s) => (
|
||||
<li className="partner-store-name-list-header">
|
||||
<span className="label-md text-muted">门店名称</span>
|
||||
<span className="label-md text-muted">状态</span>
|
||||
</li>
|
||||
{displayStores.slice(0, 5).map((s) => (
|
||||
<li key={String(s.id)}>
|
||||
<span className="headline-md">{String(s.name)}</span>
|
||||
<span className="label-md text-muted">
|
||||
{auditStatus(s) === 'PENDING' ? '待审核' : String(s.status) === 'OPEN' ? '营业中' : String(s.status)}
|
||||
</span>
|
||||
<span className="headline-md">{String(s.name || '未命名门店')}</span>
|
||||
<span className="label-md text-muted">{storeStatusLabel(s)}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user