FloatingConsult.tsx 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { useState } from 'react';
  2. import { MessageCircle, X, Phone } from 'lucide-react';
  3. import { contactInfo } from '@/data/mockData';
  4. export function FloatingConsult() {
  5. const [isOpen, setIsOpen] = useState(false);
  6. return (
  7. <>
  8. {/*<button*/}
  9. {/* onClick={() => setIsOpen(true)}*/}
  10. {/* className="fixed right-6 bottom-6 z-50 w-14 h-14 bg-gradient-to-r from-glow-green to-tech-cyan-500 rounded-full shadow-lg shadow-glow-green/30 flex items-center justify-center text-white hover:scale-110 transition-transform"*/}
  11. {/*>*/}
  12. {/* <MessageCircle className="w-6 h-6" />*/}
  13. {/*</button>*/}
  14. {isOpen && (
  15. <div className="fixed inset-0 z-40">
  16. <div className="absolute inset-0 bg-black/50" onClick={() => setIsOpen(false)} />
  17. <div className="absolute right-6 bottom-24 w-80 bg-white rounded-2xl shadow-2xl overflow-hidden">
  18. <div className="bg-gradient-to-r from-glow-green to-tech-cyan-500 p-4 flex items-center justify-between">
  19. <h3 className="text-white font-semibold">商务咨询</h3>
  20. <button
  21. onClick={() => setIsOpen(false)}
  22. className="text-white/80 hover:text-white transition-colors"
  23. >
  24. <X className="w-5 h-5" />
  25. </button>
  26. </div>
  27. <div className="p-4 space-y-4">
  28. <div className="flex items-center gap-3">
  29. <div className="w-10 h-10 bg-glow-green/10 rounded-full flex items-center justify-center">
  30. <Phone className="w-5 h-5 text-glow-green" />
  31. </div>
  32. <div>
  33. <p className="text-sm text-deep-space-500">商务联系人</p>
  34. <p className="font-semibold text-deep-space-900">{contactInfo.name}</p>
  35. </div>
  36. </div>
  37. <div className="flex items-center gap-3">
  38. <div className="w-10 h-10 bg-tech-cyan-500/10 rounded-full flex items-center justify-center">
  39. <Phone className="w-5 h-5 text-tech-cyan-500" />
  40. </div>
  41. <div>
  42. <p className="text-sm text-deep-space-500">联系电话</p>
  43. <p className="font-semibold text-deep-space-900">{contactInfo.phone}</p>
  44. </div>
  45. </div>
  46. <a
  47. href="/about"
  48. className="block w-full py-3 text-center font-semibold text-white bg-gradient-to-r from-glow-green to-tech-cyan-500 rounded-lg hover:shadow-lg transition-shadow"
  49. >
  50. 在线咨询
  51. </a>
  52. </div>
  53. </div>
  54. </div>
  55. )}
  56. </>
  57. );
  58. }