fix:提交修复6个问题
This commit is contained in:
@@ -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>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user