diff --git a/App.jsx b/App.jsx index 8a9c1b0..db38e68 100644 --- a/App.jsx +++ b/App.jsx @@ -2532,6 +2532,10 @@ function MainApp({ username, onLogout }) { const [dragCustomerIdx, setDragCustomerIdx] = useState(null); const [dragCustomerVip, setDragCustomerVip] = useState(false); // 正在拖拽的卡片属于VIP组还是普通组 const [dragGroupState, setDragGroupState] = useState(null); // { category, index } + // 产品分组:各大类默认收拢(只显示类目名、数量、品牌、类型),点类目标题展开产品列表;离开页面再进来又是全部收拢 + const [groupsOpen, setGroupsOpen] = useState(() => new Set()); + useEffect(() => { if (view === 'groups') setGroupsOpen(new Set()); }, [view]); + const toggleGroup = (id) => setGroupsOpen(prev => { const n = new Set(prev); if (n.has(id)) n.delete(id); else n.add(id); return n; }); const [pwCurrent, setPwCurrent] = useState(''); const [pwNew, setPwNew] = useState(''); @@ -4026,13 +4030,24 @@ function MainApp({ username, onLogout }) { {view === 'groups' && ( <> -