feat(trash): 商品删除→垃圾桶(软删可恢复)+ 左侧垃圾桶入口

后端(无需迁移,复用 Product.status active/archived):
- destroy 改软删(status→archived);正常列表/详情只看 active
- 新增 /products/trash(列已删)、/products/{id}/restore(恢复)、/{id}/purge(彻底删)
- tests.py:软删/列表隐藏/回收站/恢复/彻底删/拒绝彻底删 active —— 5 测试全过

前端:
- api:productsTrash / restoreProduct / purgeProduct
- 左侧导航加「垃圾桶」(新增 trash 图标);route-config 接 /trash 路由
- 新页 routes/trash.tsx + trash-page.css(仅 token):已删商品列表 + 恢复 + 彻底删(二次确认)
- 删除确认文案「不可撤销」→「移至垃圾桶可恢复」;toast「商品已删除」→「已移至垃圾桶」

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
seaislee1209
2026-06-20 19:16:28 +08:00
co-authored by Claude Opus 4.8
parent b8fc1a0749
commit 3469799da5
10 changed files with 238 additions and 6 deletions
+24
View File
@@ -0,0 +1,24 @@
/* 垃圾桶 · 已删除商品(软删 status=archived)· 仅用 design-restraint token */
.trash-empty { min-height: 220px; flex-direction: column; gap: 10px; }
.trash-list { display: flex; flex-direction: column; gap: 10px; }
.trash-row {
display: flex;
align-items: center;
gap: 14px;
padding: 12px 14px;
background: var(--surface);
border: 1px solid var(--border-faint);
border-radius: var(--r-md);
}
.trash-thumb { width: 52px; height: 52px; flex: 0 0 52px; border-radius: var(--r-sm); }
.trash-meta { flex: 1 1 auto; min-width: 0; }
.trash-name { font-size: 14px; font-weight: 500; color: var(--accent-black); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-sub { font-family: var(--font-mono); font-size: 12px; color: var(--black-alpha-48); margin-top: 3px; letter-spacing: .02em; }
.trash-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.trash-confirm-txt { font-size: 12px; color: var(--accent-crimson); letter-spacing: .02em; }
/* 彻底删除确认按钮:危险态(复用全站 crimson token,不写裸 hex) */
.trash-del { background: var(--accent-crimson); border-color: var(--accent-crimson); color: var(--accent-white); }
.trash-del:hover { filter: brightness(1.06); }