fix:提交修复6个问题

This commit is contained in:
ljy
2026-07-08 23:01:18 +08:00
parent 99be8e0237
commit ab9654564e
43 changed files with 3671 additions and 277 deletions
+8 -2
View File
@@ -1,6 +1,8 @@
import { useCallback, useEffect, useMemo, useState } from 'react';
import { Link, useNavigate } from 'react-router-dom';
import { isLoggedIn, request } from '../lib/api';
import { usePartnerSession } from '../contexts/PartnerSessionContext';
import { isSubAccount } from '../lib/partnerAccess';
import { storeStatusLabel, storeStatusPillClass, type StoreStatusValue } from '../lib/storeStatus';
type StatusFilter = 'ALL' | StoreStatusValue;
@@ -14,6 +16,8 @@ const FILTERS: { key: StatusFilter; label: string }[] = [
export default function StoreListPage() {
const navigate = useNavigate();
const { account } = usePartnerSession();
const readonly = isSubAccount(account);
const [stores, setStores] = useState<Array<Record<string, unknown>>>([]);
const [q, setQ] = useState('');
const [filter, setFilter] = useState<StatusFilter>('ALL');
@@ -62,8 +66,8 @@ export default function StoreListPage() {
</header>
<div className="partner-page-title-block">
<h2></h2>
<p className="text-muted body-md"></p>
<h2>{readonly ? '我的门店' : '门店管理'}</h2>
<p className="text-muted body-md">{readonly ? '查看您录入的合作门店' : '管理您的合作门店及其运营状态'}</p>
</div>
{error && <p className="partner-form-error" role="alert" style={{ margin: '0 20px 12px' }}>{error}</p>}
@@ -111,6 +115,7 @@ export default function StoreListPage() {
</span>
</div>
</Link>
{!readonly && (
<div className="partner-store-card-actions">
<button
type="button"
@@ -145,6 +150,7 @@ export default function StoreListPage() {
<span className="material-symbols-outlined" style={{ fontSize: 20 }}>edit</span>
</Link>
</div>
)}
</div>
);
})}