import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { formatNumber, getGrowthClass } from "@/lib/utils" import { ArrowDown, ArrowUp } from "lucide-react" export function DashboardOverview() { // 这里应该从API获取实际数据 const overviewData = { userAcquisition: { total: 12458, growth: 12.5, sources: [ { name: "微信", value: 4523, growth: 15.2 }, { name: "抖音", value: 3254, growth: 24.3 }, { name: "小红书", value: 2145, growth: 8.7 }, { name: "公众号", value: 1536, growth: -3.2 }, { name: "官网", value: 1000, growth: 5.6 }, ], }, userRetention: { rate: 68.5, growth: 2.3, periods: [ { name: "7天", value: 85.2, growth: 1.2 }, { name: "30天", value: 68.5, growth: 2.3 }, { name: "90天", value: 42.3, growth: 3.5 }, { name: "180天", value: 28.7, growth: -1.2 }, { name: "365天", value: 15.4, growth: -2.5 }, ], }, userConversion: { rate: 12.5, growth: 3.2, stages: [ { name: "浏览", value: 100, growth: 0 }, { name: "注册", value: 35.2, growth: 2.1 }, { name: "首次购买", value: 12.5, growth: 3.2 }, { name: "复购", value: 8.3, growth: 5.4 }, { name: "会员", value: 4.2, growth: 1.8 }, ], }, } return ( 用户获取 用户留存 用户转化 用户获取分析 各渠道用户获取情况及增长趋势

总获取用户

{formatNumber(overviewData.userAcquisition.total)}

{overviewData.userAcquisition.growth > 0 ? ( ) : ( )} {Math.abs(overviewData.userAcquisition.growth)}%
{overviewData.userAcquisition.sources.map((source) => (
{source.name}
{formatNumber(source.value)} {source.growth > 0 ? "+" : ""} {source.growth}%
))}
用户留存分析 不同时间段的用户留存率及变化趋势

30天留存率

{overviewData.userRetention.rate}%

{overviewData.userRetention.growth > 0 ? ( ) : ( )} {Math.abs(overviewData.userRetention.growth)}%
{overviewData.userRetention.periods.map((period) => (
{period.name}
{period.value}% {period.growth > 0 ? "+" : ""} {period.growth}%
))}
用户转化分析 用户转化漏斗各阶段转化率及变化趋势

首次购买转化率

{overviewData.userConversion.rate}%

{overviewData.userConversion.growth > 0 ? ( ) : ( )} {Math.abs(overviewData.userConversion.growth)}%
{overviewData.userConversion.stages.map((stage) => (
{stage.name}
{stage.value}% {stage.growth > 0 ? "+" : ""} {stage.growth}%
))}
) }