"use client" import { useState } from "react" import { motion, AnimatePresence } from "framer-motion" import { Mic } from "lucide-react" interface MatchUser { id: string nickname: string avatar: string tags: string[] matchScore: number concept: string wechat: string commonInterests: Array<{ icon: string; text: string }> } const matchTypes = [ { id: "partner", label: "创业合伙", icon: "⭐", color: "#00E5FF" }, { id: "investor", label: "资源对接", icon: "👥", color: "#7B61FF" }, { id: "mentor", label: "导师顾问", icon: "❤️", color: "#E91E63" }, { id: "team", label: "团队招募", icon: "🎮", color: "#4CAF50" }, ] export default function MatchPage() { const [isMatching, setIsMatching] = useState(false) const [currentMatch, setCurrentMatch] = useState(null) const [matchAttempts, setMatchAttempts] = useState(0) const [selectedType, setSelectedType] = useState("partner") const [activeTab, setActiveTab] = useState<"voice" | "party" | "team">("voice") const startMatch = () => { setIsMatching(true) setMatchAttempts(0) setCurrentMatch(null) const interval = setInterval(() => { setMatchAttempts((prev) => prev + 1) }, 1000) setTimeout( () => { clearInterval(interval) setIsMatching(false) setCurrentMatch(getMockMatch()) }, Math.random() * 3000 + 3000, ) } const getMockMatch = (): MatchUser => { const nicknames = ["创业先锋", "资源整合者", "私域专家", "商业导师", "连续创业者"] const randomIndex = Math.floor(Math.random() * nicknames.length) const concepts = [ "专注私域流量运营5年,帮助100+品牌实现从0到1的增长。", "连续创业者,擅长商业模式设计和资源整合。", "在Soul分享真实创业故事,希望找到志同道合的合作伙伴。", ] const wechats = ["soul_partner_1", "soul_business_2024", "soul_startup_fan"] return { id: `user_${Date.now()}`, nickname: nicknames[randomIndex], avatar: `https://picsum.photos/200/200?random=${randomIndex}`, tags: ["创业者", "私域运营", matchTypes.find((t) => t.id === selectedType)?.label || ""], matchScore: Math.floor(Math.random() * 20) + 80, concept: concepts[randomIndex % concepts.length], wechat: wechats[randomIndex % wechats.length], commonInterests: [ { icon: "📚", text: "都在读《创业实验》" }, { icon: "💼", text: "对私域运营感兴趣" }, { icon: "🎯", text: "相似的创业方向" }, ], } } const nextMatch = () => { setCurrentMatch(null) setTimeout(() => startMatch(), 500) } const handleAddWechat = () => { if (!currentMatch) return navigator.clipboard .writeText(currentMatch.wechat) .then(() => { alert(`微信号已复制:${currentMatch.wechat}\n\n请打开微信添加好友,备注"创业合作"即可。`) }) .catch(() => { alert(`微信号:${currentMatch.wechat}\n\n请手动复制并添加好友。`) }) } const currentTypeLabel = matchTypes.find((t) => t.id === selectedType)?.label || "创业合伙" return (
{/* 顶部标题 */}

星球

{/* Tab切换 */}
{!isMatching && !currentMatch && ( {/* 中央匹配圆环 */} {/* 外层光环 */} {/* 中间光环 */} {/* 内层渐变球 */} {/* 内部渐变光效 */}
{/* 中心图标 */}
开始匹配
寻找{currentTypeLabel}
{/* 当前模式显示 */}

当前模式: {currentTypeLabel}

{/* 分隔线 */}
{/* 选择匹配类型 */}

选择匹配类型

{matchTypes.map((type) => ( ))}
)} {isMatching && ( {/* 匹配动画 */}
{/* 扩散波纹 */} {[1, 2, 3].map((ring) => ( ))}

正在寻找合作伙伴...

已匹配 {matchAttempts} 次

)} {currentMatch && !isMatching && ( {/* 成功动画 */} {/* 用户卡片 */}
{currentMatch.nickname}

{currentMatch.nickname}

{currentMatch.tags.map((tag) => ( {tag} ))}
{currentMatch.matchScore}%
匹配度
{/* 共同兴趣 */}

共同兴趣

{currentMatch.commonInterests.map((interest, i) => (
{interest.icon} {interest.text}
))}
{/* 核心理念 */}

核心理念

{currentMatch.concept}

{/* 操作按钮 */}
)}
) }