import { useState } from 'react' import { Plus, Search, Edit, Trash2, Gift, MoreHorizontal } from 'lucide-react' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table' import { Badge } from '@/components/ui/badge' import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog' import { Label } from '@/components/ui/label' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu' import { Textarea } from '@/components/ui/textarea' const mockItems = [ { id: '1', name: '多肉植物盆栽', icon: '🪴', points: 500, stock: 50, sold: 23, category: '绿植', isActive: true, description: '精选多肉植物,含陶瓷花盆' }, { id: '2', name: '园艺工具套装', icon: '🔧', points: 800, stock: 30, sold: 12, category: '工具', isActive: true, description: '包含铲子、剪刀、喷壶' }, { id: '3', name: '植物生长灯', icon: '💡', points: 1200, stock: 20, sold: 8, category: '设备', isActive: true, description: 'LED全光谱补光灯' }, { id: '4', name: '有机肥料包', icon: '🌿', points: 300, stock: 100, sold: 67, category: '肥料', isActive: true, description: '天然有机肥料 500g' }, { id: '5', name: '花盆三件套', icon: '🏺', points: 600, stock: 0, sold: 45, category: '花盆', isActive: false, description: '陶瓷花盆 大中小三件套' }, { id: '6', name: '种子礼盒', icon: '🌱', points: 200, stock: 200, sold: 156, category: '种子', isActive: true, description: '含向日葵、薄荷、薰衣草种子各一包' }, ] export default function ExchangeConfigPage() { const [items] = useState(mockItems) const [dialogOpen, setDialogOpen] = useState(false) const [search, setSearch] = useState('') const filtered = items.filter(i => !search || i.name.includes(search)) return (

兑换配置

管理积分商城的兑换商品,配置积分价格和库存。

商品列表 {filtered.length}
setSearch(e.target.value)} />
图标 商品名称 分类 兑换积分 库存 / 已兑 状态 {filtered.map(item => ( {item.icon}
{item.name}
{item.description}
{item.category} {item.points} {item.stock} / {item.sold} {item.isActive ? 上架 : 下架} 编辑 删除
))}
新增兑换商品 配置商品信息、积分价格和库存数量。