"use client" import { useState } from "react" import { useRouter } from "next/navigation" import { ChevronLeft, Plus, Settings, QrCode, BarChart4, CreditCard, Users, Gift } 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" export default function PaymentCodePage() { const router = useRouter() const [activeTab, setActiveTab] = useState("codes") // 模拟数据 const paymentCodes = [ { id: 1, name: "社群会员付款码", amount: "19.9", status: "active", totalPayments: 156, totalAmount: 3104.4 }, { id: 2, name: "课程付款码", amount: "99", status: "active", totalPayments: 78, totalAmount: 7722 }, { id: 3, name: "咨询服务付款码", amount: "199", status: "active", totalPayments: 45, totalAmount: 8955 }, { id: 4, name: "产品购买付款码", amount: "299", status: "active", totalPayments: 32, totalAmount: 9568 }, ] const statistics = { today: { payments: 24, amount: 2568, customers: 22 }, week: { payments: 156, amount: 15420, customers: 142 }, month: { payments: 311, amount: 29845, customers: 289 }, } const distributions = [ { id: 1, name: "分销返利规则1", type: "percentage", value: "10%", totalDistributed: 1245.6 }, { id: 2, name: "分销返利规则2", type: "fixed", value: "5元", totalDistributed: 890 }, ] const redPackets = [ { id: 1, name: "新客红包", amount: "5", totalSent: 156, totalAmount: 780 }, { id: 2, name: "推广红包", amount: "10", totalSent: 89, totalAmount: 890 }, ] return (
{/* 头部 */}

付款码获客

{/* 统计卡片 */}

数据概览

今日

支付笔数

{statistics.today.payments}

支付金额

¥{statistics.today.amount}

新增客户

{statistics.today.customers}

{/* 标签页 */}
付款码 数据统计 分销返利 红包池 {/* 付款码列表 */}
{paymentCodes.map((code) => (

{code.name}

金额: ¥{code.amount}

{code.status === "active" ? "启用中" : "已停用"}

支付笔数

{code.totalPayments}

支付金额

¥{code.totalAmount}

))}
{/* 数据统计 */}

支付数据统计

今日支付笔数 {statistics.today.payments}
今日支付金额 ¥{statistics.today.amount}
今日新增客户 {statistics.today.customers}
本周支付笔数 {statistics.week.payments}
本周支付金额 ¥{statistics.week.amount}
本月支付金额 ¥{statistics.month.amount}
{/* 分销返利 */}
{distributions.map((rule) => (

{rule.name}

{rule.type === "percentage" ? "比例" : "固定金额"}
返利值 {rule.value}
已发放金额 ¥{rule.totalDistributed}
))}
{/* 红包池 */}
{redPackets.map((packet) => (

{packet.name}

¥{packet.amount}
已发放数量 {packet.totalSent}
已发放金额 ¥{packet.totalAmount}
))}
) }