diff --git a/Server/application/superadmin/controller/TrafficPool.php b/Server/application/superadmin/controller/TrafficPool.php index 83a96155..6f53170a 100644 --- a/Server/application/superadmin/controller/TrafficPool.php +++ b/Server/application/superadmin/controller/TrafficPool.php @@ -27,7 +27,7 @@ class TrafficPool extends Controller ->join('wechat_account wa', 'tp.wechatId = wa.wechatId', 'LEFT') ->join('wechat_tag wt', 'wa.wechatId = wt.wechatId') ->field([ - 'tp.id', + 'ts.id', 'tp.wechatId', 'tp.createTime as addTime', 'ts.fromd as source', diff --git a/SuperAdmin/app/dashboard/customers/page.tsx b/SuperAdmin/app/dashboard/customers/page.tsx index 908f1f64..478bd3e1 100644 --- a/SuperAdmin/app/dashboard/customers/page.tsx +++ b/SuperAdmin/app/dashboard/customers/page.tsx @@ -13,7 +13,7 @@ import { DropdownMenuSeparator, } from "@/components/ui/dropdown-menu" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" -import { Search, MoreHorizontal, Eye, UserPlus, Filter, ChevronLeft, ChevronRight } from "lucide-react" +import { Search, MoreHorizontal, Eye, UserPlus, Filter, ChevronLeft, ChevronRight, RefreshCw } from "lucide-react" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Badge } from "@/components/ui/badge" import { getTrafficPoolList } from "@/lib/traffic-pool-api" @@ -126,6 +126,15 @@ export default function CustomersPage() { const [pageSize, setPageSize] = useState(30) const [jumpToPage, setJumpToPage] = useState("") + // 添加重置函数 + const handleReset = () => { + setSearchTerm("") + setSelectedRegion("") + setSelectedGender("") + setSelectedSource("") + setSelectedProject("") + } + // 获取客户列表数据 useEffect(() => { const fetchCustomers = async () => { @@ -201,102 +210,105 @@ export default function CustomersPage() { const projects = [...new Set(customers.map((c) => c.projectName))] return ( -
-
+
+

客户池

-
-
-
- - setSearchTerm(e.target.value)} - /> -
- - - - - -
-

地区

- -
- -
-

性别

- -
- -
-

来源

- -
- -
-

所属项目

- -
-
-
+
+
+ + setSearchTerm(e.target.value)} + />
+ + + + + +
+

地区

+ +
+ +
+

性别

+ +
+ +
+

来源

+ +
+ +
+

所属项目

+ +
+
+
+ +
-
+
+
@@ -396,10 +408,12 @@ export default function CustomersPage() {
- - {/* 分页控件 */} - {!isLoading && !error && customers.length > 0 && ( -
+
+ + {/* 固定在底部的分页控件 */} + {!isLoading && !error && customers.length > 0 && ( +
+
共 {totalItems} 条记录,当前第 {currentPage}/{totalPages} 页 @@ -432,14 +446,12 @@ export default function CustomersPage() { {/* 数字分页按钮 */} {Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => { - // 显示当前页码前后2页,以及第一页和最后一页 const shouldShow = page === 1 || page === totalPages || (page >= currentPage - 2 && page <= currentPage + 2); if (!shouldShow) { - // 显示省略号 if (page === currentPage - 3 || page === currentPage + 3) { return ( @@ -496,8 +508,8 @@ export default function CustomersPage() {
- )} -
+
+ )}
) }