From 0dc434e6a63af357edf55c301105989f6d43639a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=B8=85=E7=88=BD?= Date: Mon, 14 Apr 2025 11:32:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=AE=A1=E5=90=8E=E5=8F=B0=20-=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86=E8=AF=A6=E6=83=85=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5=E7=AC=A6=E5=90=88=E8=A7=A6=E5=AE=A2?= =?UTF-8?q?=E5=AE=9D=E8=A6=81=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/dashboard/customers/[id]/page.tsx | 82 ++++++------------- SuperAdmin/app/dashboard/customers/page.tsx | 18 ++-- .../app/dashboard/projects/new/page.tsx | 35 +++++++- SuperAdmin/lib/traffic-pool-api.ts | 25 +----- 4 files changed, 73 insertions(+), 87 deletions(-) diff --git a/SuperAdmin/app/dashboard/customers/[id]/page.tsx b/SuperAdmin/app/dashboard/customers/[id]/page.tsx index 5fb1fd4c..ff6243f5 100644 --- a/SuperAdmin/app/dashboard/customers/[id]/page.tsx +++ b/SuperAdmin/app/dashboard/customers/[id]/page.tsx @@ -1,6 +1,5 @@ "use client" -import { useEffect, useState } from "react" import Link from "next/link" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" @@ -8,10 +7,19 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { Badge } from "@/components/ui/badge" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { ArrowLeft, MessageSquare, Phone, UserPlus } from "lucide-react" -import { getCustomerDetail, CustomerDetail } from "@/lib/traffic-pool-api" -// 示例数据(用于详细信息部分) -const detailData = { +// Sample customer data +const customerData = { + id: "1", + name: "张三", + avatar: "/placeholder.svg?height=100&width=100", + wechatId: "zhangsan123", + gender: "男", + region: "北京", + source: "微信搜索", + tags: ["潜在客户", "高消费"], + projectName: "电商平台项目", + addedDate: "2023-06-10", devices: [ { id: "d1", name: "iPhone 13 Pro", addedDate: "2023-06-10" }, { id: "d2", name: "MacBook Pro", addedDate: "2023-06-12" }, @@ -55,43 +63,6 @@ const detailData = { } export default function CustomerDetailPage({ params }: { params: { id: string } }) { - const [customer, setCustomer] = useState(null) - const [isLoading, setIsLoading] = useState(true) - const [error, setError] = useState(null) - - useEffect(() => { - const fetchCustomerDetail = async () => { - try { - setIsLoading(true) - const response = await getCustomerDetail(params.id) - if (response.code === 200) { - setCustomer(response.data) - setError(null) - } else { - setError(response.msg || "获取客户详情失败") - } - } catch (err: any) { - setError(err.message || "获取客户详情失败") - } finally { - setIsLoading(false) - } - } - - fetchCustomerDetail() - }, [params.id]) - - if (isLoading) { - return
加载中...
- } - - if (error) { - return
{error}
- } - - if (!customer) { - return
未找到客户信息
- } - return (
@@ -115,14 +86,15 @@ export default function CustomerDetailPage({ params }: { params: { id: string } - - {customer.nickname.slice(0, 2)} + + {customerData.name.slice(0, 2)} -

{customer.nickname}

+

{customerData.name}

+

{customerData.wechatId}

- {customer.tags.map((tag, index) => ( - + {customerData.tags.map((tag) => ( + {tag} ))} @@ -131,23 +103,23 @@ export default function CustomerDetailPage({ params }: { params: { id: string }
性别 - {customer.gender} + {customerData.gender}
地区 - {customer.region} + {customerData.region}
来源 - {customer.source} + {customerData.source}
所属项目 - {customer.projectName} + {customerData.projectName}
添加时间 - {customer.addTime || '暂无'} + {customerData.addedDate}
@@ -166,7 +138,7 @@ export default function CustomerDetailPage({ params }: { params: { id: string } - {detailData.interactions.map((interaction) => ( + {customerData.interactions.map((interaction) => (
{interaction.type === "消息" ? ( @@ -190,7 +162,7 @@ export default function CustomerDetailPage({ params }: { params: { id: string } - {detailData.devices.map((device) => ( + {customerData.devices.map((device) => (

{device.name}

@@ -201,8 +173,8 @@ export default function CustomerDetailPage({ params }: { params: { id: string } - {detailData.transactions.length > 0 ? ( - detailData.transactions.map((transaction) => ( + {customerData.transactions.length > 0 ? ( + customerData.transactions.map((transaction) => (

{transaction.product}

diff --git a/SuperAdmin/app/dashboard/customers/page.tsx b/SuperAdmin/app/dashboard/customers/page.tsx index a7c4c067..e966abc7 100644 --- a/SuperAdmin/app/dashboard/customers/page.tsx +++ b/SuperAdmin/app/dashboard/customers/page.tsx @@ -294,9 +294,9 @@ export default function CustomersPage() { - 客户昵称 + 客户信息 微信ID - 性别 + 标签 地区 来源 公司名称 @@ -341,11 +341,19 @@ export default function CustomersPage() { {customer.wechatId} - {customer.gender} + +
+ {customer.tags.map((tag, index) => ( + + {tag} + + ))} +
+
{customer.region} {customer.source} - {customer.projectName} - {customer.addTime || '暂无'} + {customer.companyName} + {customer.createTime} diff --git a/SuperAdmin/app/dashboard/projects/new/page.tsx b/SuperAdmin/app/dashboard/projects/new/page.tsx index 9579e052..b923976c 100644 --- a/SuperAdmin/app/dashboard/projects/new/page.tsx +++ b/SuperAdmin/app/dashboard/projects/new/page.tsx @@ -9,6 +9,7 @@ import { Input } from "@/components/ui/input" import { Textarea } from "@/components/ui/textarea" import { Label } from "@/components/ui/label" import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card" +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { ArrowLeft, Plus, Trash } from "lucide-react" import Link from "next/link" @@ -16,6 +17,7 @@ export default function NewProjectPage() { const router = useRouter() const [isSubmitting, setIsSubmitting] = useState(false) const [devices, setDevices] = useState([{ id: "1", name: "" }]) + const [status, setStatus] = useState("1") // 默认启用 const handleAddDevice = () => { setDevices([...devices, { id: Date.now().toString(), name: "" }]) @@ -65,13 +67,21 @@ export default function NewProjectPage() {
- - + +
- - + +
@@ -85,6 +95,23 @@ export default function NewProjectPage() {
+
+
+ + +
+ +
+ + +
+
+ +
+ +