feat: 本次提交更新内容如下

选择设备弹窗构建完成
This commit is contained in:
2025-07-10 10:57:26 +08:00
parent a1383510e8
commit b4797425fc
9 changed files with 664 additions and 556 deletions

View File

@@ -3,13 +3,17 @@ import { Link, useLocation } from 'react-router-dom';
import { Home, Users, User, Briefcase } from 'lucide-react';
const navItems = [
{ href: "/", icon: Home, label: "首页" },
{ href: "/scenarios", icon: Users, label: "场景获客" },
{ href: "/workspace", icon: Briefcase, label: "工作台" },
{ href: "/profile", icon: User, label: "我的" },
{ href: "/", icon: Home, label: "首页", id: "home" },
{ href: "/scenarios", icon: Users, label: "场景获客", id: "scenarios" },
{ href: "/workspace", icon: Briefcase, label: "工作台", id: "workspace" },
{ href: "/profile", icon: User, label: "我的", id: "profile" },
];
export default function BottomNav() {
interface BottomNavProps {
activeTab?: string;
}
export default function BottomNav({ activeTab }: BottomNavProps) {
const location = useLocation();
return (
@@ -17,7 +21,7 @@ export default function BottomNav() {
<div className="w-full h-full mx-auto flex justify-around items-center">
{navItems.map((item) => {
const IconComponent = item.icon;
const isActive = location.pathname === item.href;
const isActive = activeTab ? activeTab === item.id : location.pathname === item.href;
return (
<Link

View File

@@ -15,6 +15,7 @@ interface Device {
wxid: string;
status: 'online' | 'offline';
usedInPlans: number;
nickname: string;
}
interface DeviceSelectionDialogProps {
@@ -50,6 +51,7 @@ export function DeviceSelectionDialog({
wxid: serverDevice.wechatId || '',
status: serverDevice.alive === 1 ? 'online' : 'offline',
usedInPlans: 0, // 这个字段需要从其他API获取
nickname: serverDevice.nickname || '',
}));
setDevices(convertedDevices);
} else {
@@ -93,7 +95,7 @@ export function DeviceSelectionDialog({
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-2xl max-h-[80vh] flex flex-col">
<DialogContent className="flex flex-col">
<DialogHeader>
<DialogTitle></DialogTitle>
</DialogHeader>
@@ -102,7 +104,7 @@ export function DeviceSelectionDialog({
<div className="relative flex-1">
<Search className="absolute left-3 top-2.5 h-4 w-4 text-gray-400" />
<Input
placeholder="搜索设备IMEI/备注/微信号"
placeholder="搜索设备IMEI/备注"
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
className="pl-9"
@@ -153,7 +155,8 @@ export function DeviceSelectionDialog({
</div>
<div className="text-sm text-gray-500 mt-1">
<div>IMEI: {device.imei}</div>
<div>: {device.wxid}</div>
<div>: {device.wxid||'-'}</div>
<div>: {device.nickname||'-'}</div>
</div>
{device.usedInPlans > 0 && (
<div className="text-sm text-orange-500 mt-1"> {device.usedInPlans} </div>

View File

@@ -41,7 +41,7 @@ interface DialogContentProps {
export function DialogContent({ children, className = '' }: DialogContentProps) {
return (
<div className={`p-6 bg-white rounded-lg shadow-xl max-w-md w-full mx-4 ${className}`}>
<div className={`p-6 bg-white rounded-lg shadow-xl mx-4 ${className}`}>
{children}
</div>
);