App.tsx 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. import { useEffect } from "react";
  2. import { Mail, MapPin } from "lucide-react";
  3. import { NavLink, Outlet, useLocation, useNavigate } from "react-router-dom";
  4. import logoImage from "./assets/images/logo.png";
  5. import { products } from "./utils/utils";
  6. const Navbar = () => {
  7. const navigate = useNavigate();
  8. return (
  9. <nav className="fixed top-0 w-full z-50 bg-slate-950/70 backdrop-blur-md border-b border-slate-800">
  10. <div className="flex justify-between items-center max-w-7xl mx-auto px-6 h-20">
  11. <div
  12. className="flex items-center gap-3 cursor-pointer font-headline"
  13. onClick={() => navigate("/")}
  14. >
  15. <div
  16. style={{
  17. width: "7.75rem",
  18. height: "2.35rem",
  19. borderRadius: "9999px",
  20. overflow: "hidden",
  21. }}
  22. className="w-11 h-11 bg-white rounded-xl flex items-center justify-center"
  23. >
  24. <img
  25. style={{ width: "5.5rem", height: "3rem" }}
  26. src={logoImage}
  27. alt="智价云 Logo"
  28. className="w-7 h-7 object-contain"
  29. />
  30. </div>
  31. </div>
  32. <div className="hidden md:flex items-center space-x-10">
  33. <NavLink
  34. to="/"
  35. className={({ isActive }) =>
  36. `relative inline-flex items-center leading-none font-headline text-sm ${
  37. isActive
  38. ? "text-secondary font-bold"
  39. : "text-slate-300 hover:text-white font-medium transition-colors"
  40. }`
  41. }
  42. >
  43. {({ isActive }) => (
  44. <>
  45. 首页
  46. {isActive && (
  47. <span className="absolute left-0 -bottom-2 h-0.5 w-full bg-secondary rounded-full"></span>
  48. )}
  49. </>
  50. )}
  51. </NavLink>
  52. <div className="relative group">
  53. <span className="inline-flex items-center leading-none text-slate-300 hover:text-white transition-colors font-headline text-sm font-medium cursor-default">
  54. 产品中心
  55. </span>
  56. <div className="absolute left-1/2 top-full mt-3 -translate-x-1/2 min-w-32 rounded-lg border border-slate-800 bg-slate-900/95 p-1.5 shadow-xl opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200">
  57. {products.map((product) => (
  58. <a key={product.name} href={product.url} target="_blank" rel="noreferrer" className="block rounded-md px-3 py-2 text-sm text-slate-200 hover:bg-slate-800 hover:text-white transition-colors">
  59. {product.name}
  60. </a>
  61. ))}
  62. </div>
  63. </div>
  64. <NavLink
  65. to="https://home.kailin.com.cn"
  66. target="_blank"
  67. rel="noreferrer"
  68. className={`relative inline-flex items-center leading-none font-headline text-sm text-slate-300 hover:text-white font-medium transition-colors`}
  69. >
  70. 关于我们
  71. </NavLink>
  72. {/* <NavLink
  73. to="/contact"
  74. className={({ isActive }) =>
  75. `relative inline-flex items-center leading-none font-headline text-sm ${
  76. isActive
  77. ? "text-secondary font-bold"
  78. : "text-slate-300 hover:text-white font-medium transition-colors"
  79. }`
  80. }
  81. >
  82. {({ isActive }) => (
  83. <>
  84. 联系我们
  85. {isActive && (
  86. <span className="absolute left-0 -bottom-2 h-0.5 w-full bg-secondary rounded-full"></span>
  87. )}
  88. </>
  89. )}
  90. </NavLink> */}
  91. </div>
  92. <button
  93. onClick={() => navigate("/contact")}
  94. className="bg-blue-600 text-white px-6 py-2.5 rounded-lg font-headline text-sm font-bold hover:bg-blue-500 transition-all active:scale-95"
  95. >
  96. 获取方案
  97. </button>
  98. </div>
  99. </nav>
  100. );
  101. };
  102. const Footer = () => {
  103. const navigate = useNavigate();
  104. return (
  105. <footer className="bg-slate-950 border-t border-slate-800 py-16 px-6">
  106. <div className="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-4 gap-12">
  107. <div className="space-y-6">
  108. <div className="text-xl font-bold text-white font-headline">
  109. 开邻智数
  110. </div>
  111. <p className="text-sm text-slate-400 leading-relaxed">
  112. 一站式企微生态SCRM私域直播
  113. </p>
  114. </div>
  115. <div>
  116. <h5 className="font-bold text-slate-200 mb-6 uppercase tracking-widest text-xs">
  117. 联系我们
  118. </h5>
  119. <ul className="space-y-4 text-sm text-slate-400">
  120. <li className="flex items-center gap-2">
  121. <Mail className="w-4 h-4 text-secondary" />
  122. bd@dotouch.tech
  123. </li>
  124. <li className="flex items-start gap-2">
  125. <MapPin className="w-4 h-4 text-secondary mt-0.5" />
  126. <span>深圳大方无隅科技有限公司</span>
  127. </li>
  128. </ul>
  129. </div>
  130. <div>
  131. <h5 className="font-bold text-slate-200 mb-6 uppercase tracking-widest text-xs">
  132. 产品中心
  133. </h5>
  134. <ul className="space-y-4 text-sm text-slate-400">
  135. {products.map((product) => (
  136. <li key={product.name}>
  137. <a href={product.url} target="_blank" rel="noreferrer" className="hover:text-secondary transition-colors">
  138. {product.name}
  139. </a>
  140. </li>
  141. ))}
  142. </ul>
  143. </div>
  144. <div>
  145. <h5 className="font-bold text-slate-200 mb-6 uppercase tracking-widest text-xs">
  146. 法律条款
  147. </h5>
  148. <ul className="space-y-4 text-sm text-slate-400">
  149. <li>
  150. <a
  151. href="/privacy"
  152. target="_blank"
  153. rel="noreferrer"
  154. className="hover:text-secondary transition-colors"
  155. >
  156. 隐私政策
  157. </a>
  158. </li>
  159. <li>
  160. <a
  161. href="/agreement"
  162. target="_blank"
  163. rel="noreferrer"
  164. className="hover:text-secondary transition-colors"
  165. >
  166. 用户协议
  167. </a>
  168. </li>
  169. </ul>
  170. </div>
  171. </div>
  172. <div className="max-w-7xl mx-auto mt-16 pt-8 border-t border-slate-800 text-center">
  173. <p className="text-sm text-slate-500">© 粤ICP备2024220172号-9</p>
  174. </div>
  175. </footer>
  176. );
  177. };
  178. export default function App() {
  179. const location = useLocation();
  180. useEffect(() => {
  181. window.scrollTo(0, 0);
  182. }, [location.pathname]);
  183. return (
  184. <div className="min-h-screen flex flex-col bg-slate-950 text-slate-100">
  185. <Navbar />
  186. <main className="flex-grow">
  187. <Outlet />
  188. </main>
  189. <Footer />
  190. </div>
  191. );
  192. }