"use client" import { useState } from "react" import { useRouter } from "next/navigation" import Image from "next/image" import { ChevronLeft, Download, Share2, QrCode, Copy, BarChart4, Users } from "lucide-react" import { Button } from "@/components/ui/button" import { Card, CardContent } from "@/components/ui/card" import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs" import { Badge } from "@/components/ui/badge" import { Switch } from "@/components/ui/switch" import { toast } from "@/components/ui/use-toast" export default function PaymentCodeDetailPage({ params }: { params: { id: string } }) { const router = useRouter() const [activeTab, setActiveTab] = useState("detail") // 模拟数据 const paymentCode = { id: params.id, name: "社群会员付款码", amount: "19.9", description: "加入VIP社群会员", status: "active", qrCodeUrl: "/placeholder.svg?height=300&width=300&query=QR%20Code", paymentMethod: "wechat", createTime: "2023-10-26 11:00:00", totalPayments: 156, totalAmount: 3104.4, distribution: { enabled: true, type: "percentage", value: "10%", totalDistributed: 310.44, }, redPacket: { enabled: true, amount: "5", totalSent: 156, totalAmount: 780, }, autoWelcome: { enabled: true, message: "感谢您的支付,欢迎加入我们的VIP社群!", }, tags: ["付款客户", "社群会员", "已成交"], } const recentPayments = [ { id: 1, user: "用户1", amount: "19.9", time: "2023-10-26 15:30:00", status: "success" }, { id: 2, user: "用户2", amount: "19.9", time: "2023-10-26 14:45:00", status: "success" }, { id: 3, user: "用户3", amount: "19.9", time: "2023-10-26 13:20:00", status: "success" }, { id: 4, user: "用户4", amount: "19.9", time: "2023-10-26 12:10:00", status: "success" }, { id: 5, user: "用户5", amount: "19.9", time: "2023-10-26 11:05:00", status: "success" }, ] const handleStatusChange = (checked: boolean) => { toast({ title: checked ? "付款码已启用" : "付款码已停用", description: checked ? "客户现在可以通过此付款码支付" : "客户将无法通过此付款码支付", }) } const handleCopy = (text: string) => { navigator.clipboard.writeText(text) toast({ title: "复制成功", description: "内容已复制到剪贴板", }) } const handleDownload = () => { toast({ title: "下载成功", description: "付款码已保存到相册", }) } const handleShare = () => { toast({ title: "分享成功", description: "付款码已分享", }) } return (
{paymentCode.description}
{payment.user}
{payment.time}
¥{payment.amount}