feat: sync Sidebar and BottomNav, standardize user profile API
Align Sidebar & BottomNav menus, remove "Search", add user profile mock data, implement /api/users, add FilterDrawer, complete Section, ProfileHeader, MetricsRFM components Co-authored-by: null <4804959+fnvtk@users.noreply.github.com>
This commit is contained in:
@@ -12,20 +12,7 @@ import { Avatar } from "@/components/ui/avatar"
|
||||
import { Progress } from "@/components/ui/progress"
|
||||
import { Switch } from "@/components/ui/switch"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import {
|
||||
Search,
|
||||
Sparkles,
|
||||
Clock,
|
||||
TrendingUp,
|
||||
Users,
|
||||
Brain,
|
||||
Zap,
|
||||
Download,
|
||||
RefreshCw,
|
||||
Eye,
|
||||
BarChart3,
|
||||
Lightbulb,
|
||||
} from "lucide-react"
|
||||
import { Search, Sparkles, Clock, TrendingUp, Users, Brain, Zap, Download, RefreshCw, Eye, BarChart3, Lightbulb } from 'lucide-react'
|
||||
import { TooltipHelp, TooltipProvider } from "@/components/ui/tooltip-help"
|
||||
|
||||
interface SearchResult {
|
||||
@@ -59,6 +46,20 @@ export default function IntelligentSearchPage() {
|
||||
const [searchResults, setSearchResults] = useState<SearchResponse | null>(null)
|
||||
const [searchHistory, setSearchHistory] = useState<string[]>([])
|
||||
const [activeTab, setActiveTab] = useState("search")
|
||||
const [rfmHighValueOnly, setRfmHighValueOnly] = useState(false);
|
||||
|
||||
const detectQueryType = (q: string) => {
|
||||
const s = q.trim()
|
||||
if (/^\d{5,11}$/.test(s)) {
|
||||
if (/^1[3-9]\d{9}$/.test(s) || /^\d{3}\*{4}\d{4}$/.test(s)) return "手机号"
|
||||
return "QQ号"
|
||||
}
|
||||
if (/^[A-F0-9]{14}$/.test(s)) return "MEID"
|
||||
if (/^0{6,}$/.test(s) || s.includes("000000")) return "流量词"
|
||||
return "通用"
|
||||
}
|
||||
|
||||
const queryType = detectQueryType(searchQuery)
|
||||
|
||||
// 执行搜索
|
||||
const performSearch = useCallback(
|
||||
@@ -78,6 +79,7 @@ export default function IntelligentSearchPage() {
|
||||
options: {
|
||||
useAI,
|
||||
includeInsights,
|
||||
rfmTag: includeInsights ? "高" : undefined,
|
||||
limit: 50,
|
||||
},
|
||||
}),
|
||||
@@ -193,6 +195,11 @@ export default function IntelligentSearchPage() {
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 mt-2">
|
||||
<Badge variant="secondary" className="text-xs">识别: {queryType}</Badge>
|
||||
{queryType === "流量词" && <Badge className="text-xs">优先匹配流量池</Badge>}
|
||||
</div>
|
||||
|
||||
{/* 搜索选项 */}
|
||||
<div className="flex flex-wrap items-center gap-6">
|
||||
<div className="flex items-center gap-2">
|
||||
@@ -226,6 +233,13 @@ export default function IntelligentSearchPage() {
|
||||
<TooltipHelp content="在搜索结果中包含AI生成的业务洞察和分析建议" />
|
||||
</Label>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<Switch id="rfm-high" checked={rfmHighValueOnly} onCheckedChange={setRfmHighValueOnly} />
|
||||
<Label htmlFor="rfm-high" className="flex items-center gap-1">
|
||||
仅看RFM高价值
|
||||
</Label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 搜索历史 */}
|
||||
|
||||
Reference in New Issue
Block a user