Hanye官网
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

index.vue 42KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
  1. <template>
  2. <div>
  3. <div class="w-full h-[88px] md:h-[0]"></div>
  4. <!-- 轮播图 -->
  5. <section class="max-w-full mb-12 md:mb-32 xl:px-8 lg:px-6 md:px-4 px-4">
  6. <Swiper
  7. :modules="[Pagination, Autoplay, EffectCreative]"
  8. :slides-per-view="1"
  9. :space-between="30"
  10. :loop="true"
  11. :pagination="{ el: '.swiper-pagination-1', clickable: true }"
  12. :autoplay="{
  13. delay: 5000,
  14. disableOnInteraction: false,
  15. pauseOnMouseEnter: true,
  16. waitForTransition: true,
  17. }"
  18. effect="creative"
  19. :creativeEffect="{
  20. prev: {
  21. shadow: true,
  22. translate: ['-120%', 0, -500],
  23. rotate: [0, 0, -90],
  24. opacity: 0,
  25. },
  26. next: {
  27. shadow: true,
  28. translate: ['120%', 0, -500],
  29. rotate: [0, 0, 90],
  30. opacity: 0,
  31. },
  32. }"
  33. :speed="1000"
  34. :grabCursor="true"
  35. :parallax="true"
  36. class="h-[320px] sm:h-[320px] md:h-[768px] lg:h-[900px] swiper-container-1"
  37. >
  38. <SwiperSlide>
  39. <div
  40. class="max-w-screen-2xl mx-auto h-full relative"
  41. :style="{
  42. backgroundImage: `url(${homeA1Webp})`,
  43. backgroundSize: 'cover',
  44. backgroundPosition: 'center',
  45. backgroundRepeat: 'no-repeat',
  46. }"
  47. >
  48. <div
  49. class="w-full h-full flex-col justify-center hidden md:flex relative z-10"
  50. >
  51. <div
  52. class="rounded border border-white w-11 h-6 leading-none justify-center flex items-center text-white text-sm font-normal"
  53. >
  54. SSD
  55. </div>
  56. <div class="justify-center">
  57. <span class="text-white text-6xl font-normal leading-[78px]">{{
  58. t("home.carousel.one.title")
  59. }}</span>
  60. <span class="text-white text-6xl font-normal leading-[78px]">{{
  61. t("home.carousel.one.description")
  62. }}</span>
  63. <br />
  64. <span class="text-white text-6xl font-normal leading-[78px]">{{
  65. t("home.carousel.one.description2")
  66. }}</span
  67. ><br />
  68. <span
  69. class="text-cyan-400 text-6xl font-normal leading-[78px]"
  70. >{{ t("home.carousel.one.description3") }}</span
  71. >
  72. </div>
  73. <div class="flex flex-col gap-2 mt-4">
  74. <div
  75. class="flex items-center gap-2 text-stone-50 text-xl font-normal"
  76. >
  77. <div class="w-2 h-2 bg-white rounded-full"></div>
  78. {{ t("home.carousel.one.description4") }}
  79. </div>
  80. <div
  81. class="flex items-center gap-2 text-stone-50 text-xl font-normal"
  82. >
  83. <div class="w-2 h-2 bg-white rounded-full"></div>
  84. {{ t("home.carousel.one.description5") }}
  85. </div>
  86. </div>
  87. <div
  88. class="w-36 h-14 mt-12 flex items-center justify-center bg-[#35F1FF] rounded-lg hover:bg-[#35F1FF]/80 transition-colors duration-300"
  89. >
  90. <nuxt-link
  91. :to="`${homepagePath}/products/HE80-2TNLHS`"
  92. class="w-full h-full !flex items-center justify-center text-zinc-900"
  93. >
  94. {{ t("products.view_details") }}
  95. </nuxt-link>
  96. </div>
  97. </div>
  98. </div>
  99. </SwiperSlide>
  100. <SwiperSlide v-if="!isMobile">
  101. <div class="max-w-screen-2xl mx-auto h-full relative">
  102. <video
  103. :src="homeA3Webp"
  104. autoplay
  105. muted
  106. loop
  107. class="w-full h-full object-cover"
  108. ></video>
  109. <div
  110. class="w-full h-full flex-col justify-center hidden md:flex absolute top-0 left-0 z-10"
  111. >
  112. <div class="justify-center">
  113. <span class="text-white text-6xl font-normal leading-[78px]">{{
  114. t("home.carousel.three.title")
  115. }}</span>
  116. <span class="text-white text-6xl font-normal leading-[78px]">{{
  117. t("home.carousel.three.description")
  118. }}</span>
  119. <br />
  120. <span class="text-white text-6xl font-normal leading-[78px]">{{
  121. t("home.carousel.three.description2")
  122. }}</span
  123. ><br />
  124. <span
  125. class="text-cyan-400 text-6xl font-normal leading-[78px]"
  126. >{{ t("home.carousel.three.description3") }}</span
  127. >
  128. </div>
  129. <div class="flex flex-col gap-2 mt-4">
  130. <div
  131. class="flex items-center gap-2 text-stone-50 text-xl font-normal"
  132. >
  133. <div class="w-2 h-2 bg-white rounded-full"></div>
  134. {{ t("home.carousel.three.description4") }}
  135. </div>
  136. <div
  137. class="flex items-center gap-2 text-stone-50 text-xl font-normal"
  138. >
  139. <div class="w-2 h-2 bg-white rounded-full"></div>
  140. {{ t("home.carousel.three.description5") }}
  141. </div>
  142. </div>
  143. <div
  144. class="w-36 h-14 mt-12 flex items-center justify-center bg-[#35F1FF] rounded-lg hover:bg-[#35F1FF]/80 transition-colors duration-300"
  145. >
  146. <nuxt-link
  147. :to="`${homepagePath}/about`"
  148. class="w-full h-full !flex items-center justify-center text-zinc-900"
  149. >
  150. {{ t("products.view_details") }}
  151. </nuxt-link>
  152. </div>
  153. </div>
  154. </div>
  155. </SwiperSlide>
  156. <div class="max-w-screen-2xl mx-auto relative">
  157. <div
  158. class="swiper-pagination swiper-pagination-1 text-left bottom-1 top-0"
  159. ></div>
  160. </div>
  161. </Swiper>
  162. </section>
  163. <!-- 按分类栏目展示 -->
  164. <section class="max-w-full mb-12 md:mb-32 xl:px-8 lg:px-6 md:px-4 px-4">
  165. <div class="max-w-screen-2xl mx-auto relative">
  166. <div
  167. class="justify-center text-cyan-400 text-base font-normal leading-tight mb-4"
  168. >
  169. {{ t("home.useCategoryTitle") }}
  170. </div>
  171. <div
  172. class="justify-center text-white font-normal mb-8 md:mb-16 text-xl sm:text-2xl md:text-4xl lg:text-6xl"
  173. >
  174. {{ t("home.useCategoryDescription") }}
  175. </div>
  176. </div>
  177. <div class="max-w-screen-2xl mx-auto relative">
  178. <!-- 企业产品 -->
  179. <div
  180. class="flex w-full relative mb-10 xl:mb-40 gap-6 flex-col xl:flex-row"
  181. >
  182. <div
  183. class="select-none relative w-full xl:w-[65%] h-[280px] md:h-[320px] xl:h-[520px] animate-gradient-bg [background:linear-gradient(180deg,#444B55_0%,#98A3B4_95%)] from-zinc-900 to-zinc-800"
  184. >
  185. <img
  186. src="@/assets/images/business.webp"
  187. alt="business"
  188. class="max-h-full pl-0 md:pl-4 pt-0 md:pt-4 relative z-10"
  189. />
  190. <span
  191. class="absolute hidden xl:block z-0 top-[35%] left-[60%] translate-y-[-50%] translate-x-[-50%] opacity-5 text-white text-[160px] font-bold select-none"
  192. >Hanye</span
  193. >
  194. <div
  195. class="w-full absolute xl:hidden top-0 left-0 right-0 bottom-0 z-10 flex flex-col justify-center items-end p-4 md:p-8"
  196. >
  197. <div
  198. class="opacity-10 text-white text-4xl md:text-7xl font-bold mb-2 select-none"
  199. >
  200. Business
  201. </div>
  202. <div class="justify-center text-white text-4xl font-medium mb-4">
  203. {{ t("home.business.title") }}
  204. </div>
  205. <div class="justify-center text-white text-xl font-normal mb-8">
  206. {{ t("home.business.description") }}
  207. </div>
  208. <nuxt-link
  209. :to="`${homepagePath}/products?audiences=1`"
  210. class="h-14 px-8 py-3.5 bg-white/10 hover:bg-white/15 rounded-[10px] outline outline-1 outline-white/20 backdrop-blur-md inline-flex flex-col justify-start items-start gap-3.5"
  211. >
  212. <div class="inline-flex justify-start items-center gap-2.5">
  213. {{ t("home.business.view_details") }}
  214. <i class="icon-arrow-right text-xs ml-2"></i>
  215. </div>
  216. </nuxt-link>
  217. </div>
  218. </div>
  219. <div class="relative hidden xl:flex flex-1 flex-col gap-10">
  220. <div class="w-full">
  221. <div
  222. class="opacity-20 text-white text-7xl font-bold mb-2 select-none"
  223. >
  224. Business
  225. </div>
  226. <div class="justify-center text-white text-4xl font-medium mb-4">
  227. {{ t("home.business.title") }}
  228. </div>
  229. <div class="justify-center text-white text-xl font-normal mb-8">
  230. {{ t("home.business.description") }}
  231. </div>
  232. <nuxt-link
  233. :to="`${homepagePath}/products?audiences=1`"
  234. class="h-14 px-8 py-3.5 bg-white/10 hover:bg-white/15 rounded-[10px] outline outline-1 outline-white/20 backdrop-blur-md inline-flex flex-col justify-start items-start gap-3.5"
  235. >
  236. <div class="inline-flex justify-start items-center gap-2.5">
  237. {{ t("home.business.view_details") }}
  238. <i class="icon-arrow-right text-xs ml-2"></i>
  239. </div>
  240. </nuxt-link>
  241. </div>
  242. </div>
  243. <div
  244. class="bg-zinc-900/60 backdrop-blur-[120px] right-0 bottom-[-30%] static xl:absolute"
  245. >
  246. <div class="w-full h-full grid grid-cols-2">
  247. <nuxt-link
  248. v-for="category in categoryList"
  249. :key="category.id"
  250. class="flex flex-col gap-4 items-center p-4 md:p-12 hover:bg-zinc-900/50 hover:scale-95 transition-all duration-300"
  251. v-show="category.audiences === 1"
  252. :to="`${category.link}`"
  253. >
  254. <img
  255. class="w-[200px] h-[200px] object-contain"
  256. :src="category.image"
  257. />
  258. <div
  259. class="text-center flex justify-center text-white text-base font-bold"
  260. >
  261. {{ category.title }}
  262. </div>
  263. <div
  264. class="text-center text-white/50 text-sm max-w-[280px] line-clamp-2"
  265. >
  266. {{ category.description }}
  267. </div>
  268. </nuxt-link>
  269. </div>
  270. </div>
  271. </div>
  272. <!-- 个人产品 -->
  273. <div
  274. class="flex w-full gap-8 relative mb-0 xl:mb-60 flex-col xl:flex-row"
  275. >
  276. <div
  277. class="flex-1 hidden xl:flex flex-col gap-10 relative top-[-80px]"
  278. >
  279. <div class="w-full">
  280. <div
  281. class="opacity-20 justify-center text-white text-7xl font-bold mb-2 select-none"
  282. >
  283. Personal
  284. </div>
  285. <div class="justify-center text-white text-4xl font-medium mb-4">
  286. {{ t("home.personal.title") }}
  287. </div>
  288. <div class="justify-center text-white text-xl font-normal mb-8">
  289. {{ t("home.personal.description") }}
  290. </div>
  291. <nuxt-link
  292. :to="`${homepagePath}/products?audiences=0`"
  293. class="h-14 px-8 py-3.5 bg-white/10 hover:bg-white/15 rounded-[10px] outline outline-1 outline-white/20 backdrop-blur-md inline-flex flex-col justify-start items-start gap-3.5"
  294. >
  295. <div class="inline-flex justify-start items-center gap-2.5">
  296. {{ t("home.personal.view_details") }}
  297. <i class="icon-arrow-right text-xs ml-2"></i>
  298. </div>
  299. </nuxt-link>
  300. </div>
  301. </div>
  302. <div
  303. class="w-full xl:w-[75%] h-[280px] md:h-[320px] xl:h-[480px] select-none relative z-0 flex justify-end items-end animate-gradient-bg [background:linear-gradient(180deg,#0086f4_0%,#88d5fa_80%)]"
  304. >
  305. <img
  306. src="@/assets/images/personal.webp"
  307. alt="personal"
  308. class="pt-0 md:pt-20 max-h-full relative z-10"
  309. />
  310. <span
  311. class="absolute hidden xl:block z-0 top-[25%] left-[35%] translate-y-[-50%] translate-x-[-50%] opacity-5 text-white text-[160px] font-bold select-none"
  312. >Hanye</span
  313. >
  314. <div
  315. class="flex xl:hidden flex-col gap-10 absolute top-0 left-0 right-0 bottom-0 z-10 justify-center p-4 md:p-8"
  316. >
  317. <div class="w-full">
  318. <div
  319. class="opacity-10 justify-center text-white text-4xl md:text-7xl font-bold mb-2 select-none"
  320. >
  321. Personal
  322. </div>
  323. <div
  324. class="justify-center text-white text-4xl font-medium mb-4"
  325. >
  326. {{ t("home.personal.title") }}
  327. </div>
  328. <div class="justify-center text-white text-xl font-normal mb-8">
  329. {{ t("home.personal.description") }}
  330. </div>
  331. <nuxt-link
  332. :to="`${homepagePath}/products?audiences=0`"
  333. class="h-14 px-8 py-3.5 bg-white/10 hover:bg-white/15 rounded-[10px] outline outline-1 outline-white/20 backdrop-blur-md inline-flex flex-col justify-start items-start gap-3.5"
  334. >
  335. <div class="inline-flex justify-start items-center gap-2.5">
  336. {{ t("home.personal.view_details") }}
  337. <i class="icon-arrow-right text-xs ml-2"></i>
  338. </div>
  339. </nuxt-link>
  340. </div>
  341. </div>
  342. </div>
  343. <div
  344. class="bg-zinc-900/60 backdrop-blur-[120px] static left-0 bottom-[-30%] xl:absolute z-2"
  345. >
  346. <div class="w-full h-full grid grid-cols-2 lg:grid-cols-3">
  347. <nuxt-link
  348. v-for="category in categoryList"
  349. :key="category.id"
  350. class="flex flex-col gap-4 items-center py-4 px-4 md:py-12 md:px-6 hover:bg-zinc-900/50 hover:scale-95 transition-all duration-300"
  351. v-show="category.audiences === 0"
  352. :to="`${category.link}`"
  353. >
  354. <img
  355. class="w-[200px] h-[200px] object-contain"
  356. :src="category.image"
  357. />
  358. <div
  359. class="text-center flex justify-center text-white text-base font-bold"
  360. >
  361. {{ category.title }}
  362. </div>
  363. <div
  364. class="text-center text-white/50 text-sm max-w-[280px] line-clamp-2"
  365. >
  366. {{ category.description }}
  367. </div>
  368. </nuxt-link>
  369. </div>
  370. </div>
  371. </div>
  372. </div>
  373. </section>
  374. <!-- 按用途产品展示 -->
  375. <section
  376. v-if="false"
  377. class="max-w-full mb-12 md:mb-32 xl:px-8 lg:px-6 md:px-4 px-4"
  378. >
  379. <div class="max-w-screen-2xl mx-auto relative">
  380. <div
  381. class="justify-center text-cyan-400 text-base font-normal leading-tight mb-4"
  382. >
  383. {{ t("products.usage") }}
  384. </div>
  385. <div
  386. class="justify-center text-white font-normal mb-8 md:mb-16 text-xl sm:text-2xl md:text-4xl lg:text-6xl"
  387. >
  388. {{ t("products.usage_title") }}
  389. </div>
  390. </div>
  391. <div class="max-w-screen-2xl mx-auto">
  392. <div class="w-full mb-8">
  393. <div class="flex flex-wrap items-center gap-2">
  394. <div
  395. v-for="(usage, index) in typedUsageList"
  396. :key="usage.id"
  397. class="cursor-pointer select-none px-4 sm:px-7 py-2 sm:py-3 rounded-full border border-zinc-700 text-white transition-all duration-300 relative group"
  398. :class="{
  399. 'bg-cyan-400 border-zinc-900 pointer-events-none text-zinc-900':
  400. activeIndex === index,
  401. 'hover:border-zinc-600': activeIndex !== index,
  402. }"
  403. @click="handleUsageClick(usage.id)"
  404. >
  405. <div
  406. class="usage-name text-center text-xs sm:text-sm font-normal leading-tight md:text-base transition-colors duration-300 relative z-10"
  407. >
  408. {{ usage.name }}
  409. <!-- 用途名称 -->
  410. </div>
  411. <div
  412. class="absolute inset-0 rounded-full bg-cyan-400/20 scale-0 transition-transform duration-300 group-hover:scale-100"
  413. ></div>
  414. </div>
  415. <div class="flex items-center justify-center gap-4 ml-auto">
  416. <div
  417. class="swiper-button-prev-2 bg-zinc-700 w-8 h-8 sm:w-10 sm:h-10 rounded-full flex items-center justify-center cursor-pointer hover:bg-zinc-600 transition-colors duration-200"
  418. >
  419. <i
  420. class="icon-arrow-left text-zinc-300 text-xs sm:text-sm font-normal"
  421. ></i>
  422. </div>
  423. <div
  424. class="swiper-button-next-2 bg-zinc-700 w-8 h-8 sm:w-10 sm:h-10 rounded-full flex items-center justify-center cursor-pointer hover:bg-zinc-600 transition-colors duration-200"
  425. >
  426. <i
  427. class="icon-arrow-right text-zinc-300 text-xs sm:text-sm font-normal"
  428. ></i>
  429. </div>
  430. </div>
  431. </div>
  432. </div>
  433. </div>
  434. <div class="max-w-screen-2xl mx-auto">
  435. <div
  436. class="w-full h-[420px] sm:h-[300px] md:h-[350px] lg:h-[360px] xl:h-[380px] 2xl:h-[460px] relative"
  437. >
  438. <TransitionGroup name="slide-fade" tag="div" class="relative h-full">
  439. <div :key="activeUsageId" class="w-full h-full">
  440. <Swiper
  441. :modules="[Navigation]"
  442. :spaceBetween="30"
  443. :slidesPerView="4"
  444. :breakpoints="{
  445. 320: { slidesPerView: 1, spaceBetween: 10 },
  446. 448: { slidesPerView: 2, spaceBetween: 10 },
  447. 640: { slidesPerView: 3, spaceBetween: 20 },
  448. 1024: { slidesPerView: 4, spaceBetween: 20 },
  449. 1280: { slidesPerView: 4, spaceBetween: 30 },
  450. 1536: { slidesPerView: 4, spaceBetween: 30 },
  451. }"
  452. :navigation="{
  453. prevEl: '.swiper-button-prev-2',
  454. nextEl: '.swiper-button-next-2',
  455. }"
  456. class="h-full"
  457. >
  458. <SwiperSlide
  459. v-for="product in activeProducts"
  460. :key="product.id"
  461. class="w-full sm:w-1/2 md:w-1/3 lg:w-1/4"
  462. >
  463. <div class="w-full h-full p-2">
  464. <nuxt-link :to="product.link" class="block w-full h-full">
  465. <div
  466. class="w-full h-full bg-zinc-900 rounded-2xl p-4 flex flex-col items-center justify-start relative overflow-hidden group hover:bg-zinc-800 transition-all duration-300 hover:shadow-lg hover:shadow-cyan-400/10"
  467. >
  468. <!-- 图片加载占位 -->
  469. <div
  470. v-if="!isImageLoaded[product.id]"
  471. class="absolute inset-0 bg-gradient-to-br from-zinc-800 via-zinc-700 to-zinc-800 animate-gradient"
  472. >
  473. <div
  474. class="absolute inset-0 flex items-center justify-center"
  475. >
  476. <div
  477. class="w-8 h-8 border-4 border-cyan-400/20 border-t-cyan-400 rounded-full animate-spin"
  478. ></div>
  479. </div>
  480. </div>
  481. <!-- 图片容器 -->
  482. <div
  483. class="w-full aspect-square relative transition-all duration-300 overflow-hidden rounded-lg"
  484. :class="{ 'opacity-0': !isImageLoaded[product.id] }"
  485. >
  486. <img
  487. :src="product.image"
  488. :alt="product.title"
  489. class="w-full h-full object-cover transition-all duration-500 group-hover:scale-110"
  490. @load="handleImageLoad(product.id)"
  491. @error="handleImageError(product.id)"
  492. loading="lazy"
  493. />
  494. <div
  495. class="absolute inset-0 bg-gradient-to-t from-black/60 via-black/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"
  496. ></div>
  497. <!-- 添加查看详情按钮 -->
  498. <div
  499. class="absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all duration-300 transform translate-y-4 group-hover:translate-y-0"
  500. >
  501. <div
  502. class="px-4 py-2 bg-cyan-400/20 backdrop-blur-sm rounded-full text-white text-sm font-medium border border-cyan-400/30 transform transition-transform duration-300 group-hover:scale-105"
  503. >
  504. {{ t("products.view_details") }}
  505. </div>
  506. </div>
  507. </div>
  508. <!-- 文字内容 -->
  509. <div
  510. class="w-full mt-4 min-h-[80px] transition-all duration-300 transform"
  511. :class="{
  512. 'opacity-0 translate-y-4':
  513. !isImageLoaded[product.id],
  514. 'opacity-100 translate-y-0':
  515. isImageLoaded[product.id],
  516. }"
  517. >
  518. <div
  519. class="text-center text-white text-base font-bold leading-tight mb-2 line-clamp-2 group-hover:text-cyan-400 transition-colors duration-300"
  520. >
  521. {{ product.title }}
  522. </div>
  523. <div
  524. class="text-center text-zinc-400 text-sm font-normal leading-tight line-clamp-2 group-hover:text-zinc-300 transition-colors duration-300"
  525. >
  526. {{ product.description }}
  527. </div>
  528. </div>
  529. </div>
  530. </nuxt-link>
  531. </div>
  532. </SwiperSlide>
  533. </Swiper>
  534. </div>
  535. </TransitionGroup>
  536. </div>
  537. </div>
  538. </section>
  539. <!-- 核心展示 -->
  540. <section class="max-w-full mb-12 md:mb-32 xl:px-8 lg:px-6 md:px-4 px-4">
  541. <div
  542. class="max-w-screen-2xl mx-auto grid grid-cols-1 lg:grid-cols-3 md:grid-cols-2 sm:grid-cols-1 gap-4"
  543. >
  544. <div class="inline-flex justify-start items-center gap-5">
  545. <div
  546. class="w-12 h-12 md:w-16 md:h-16 relative bg-gradient-to-b from-neutral-600 to-slate-400 rounded-xl border-b-[1.50px] border-neutral-700 overflow-hidden"
  547. >
  548. <div class="w-full h-full flex items-center justify-center">
  549. <i class="icon-h1 text-white text-5xl"></i>
  550. </div>
  551. </div>
  552. <div class="inline-flex flex-col justify-center items-start flex-1">
  553. <div
  554. class="justify-start text-white font-medium text-1xl md:text-lg"
  555. >
  556. {{ t("products.support") }}
  557. </div>
  558. <div
  559. class="justify-start text-zinc-300 text-xs font-normal md:text-sm"
  560. >
  561. {{ t("products.support_description") }}
  562. </div>
  563. </div>
  564. </div>
  565. <div class="inline-flex justify-start items-center gap-5">
  566. <div
  567. class="w-12 h-12 md:w-16 md:h-16 relative bg-gradient-to-b from-neutral-600 to-slate-400 rounded-xl border-b-[1.50px] border-neutral-700 overflow-hidden"
  568. >
  569. <div class="w-full h-full flex items-center justify-center">
  570. <i class="icon-h2 text-white text-5xl"></i>
  571. </div>
  572. </div>
  573. <div class="inline-flex flex-col justify-center items-start flex-1">
  574. <div
  575. class="justify-start text-white font-medium text-1xl md:text-lg"
  576. >
  577. {{ t("products.development") }}
  578. </div>
  579. <div
  580. class="justify-start text-zinc-300 text-xs font-normal md:text-sm"
  581. >
  582. {{ t("products.development_description") }}
  583. </div>
  584. </div>
  585. </div>
  586. <div class="inline-flex justify-start items-center gap-5">
  587. <div
  588. class="w-12 h-12 md:w-16 md:h-16 relative bg-gradient-to-b from-neutral-600 to-slate-400 rounded-xl border-b-[1.50px] border-neutral-700 overflow-hidden"
  589. >
  590. <div class="w-full h-full flex items-center justify-center">
  591. <i class="icon-h3 text-white text-5xl"></i>
  592. </div>
  593. </div>
  594. <div class="inline-flex flex-col justify-center items-start flex-1">
  595. <div
  596. class="justify-start text-white font-medium text-1xl md:text-lg"
  597. >
  598. {{ t("products.develop") }}
  599. </div>
  600. <div
  601. class="justify-start text-zinc-300 text-xs font-normal md:text-sm"
  602. >
  603. {{ t("products.develop_description") }}
  604. </div>
  605. </div>
  606. </div>
  607. </div>
  608. </section>
  609. <!-- 关于我们 -->
  610. <section class="max-w-full mb-12 md:mb-32 xl:px-8 lg:px-6 md:px-4 px-4">
  611. <div class="max-w-screen-2xl mx-auto relative">
  612. <div
  613. class="justify-center text-cyan-400 text-base font-normal leading-tight mb-4"
  614. >
  615. {{ t("products.strong_point") }}
  616. </div>
  617. <div
  618. class="justify-center text-white font-normal mb-8 md:mb-16 text-xl sm:text-2xl md:text-4xl lg:text-6xl"
  619. >
  620. {{ t("products.strong_point_title") }}
  621. </div>
  622. <div
  623. class="absolute right-0 top-1/2 -translate-y-1/2 z-10 lg:block hidden"
  624. >
  625. <div class="flex items-center justify-center gap-4">
  626. <div
  627. class="swiper-button-prev-3 bg-zinc-700 w-10 h-10 rounded-full flex items-center justify-center cursor-pointer hover:bg-zinc-600 transition-colors duration-200"
  628. >
  629. <i class="icon-arrow-left text-zinc-300 text-sm font-normal"></i>
  630. </div>
  631. <div
  632. class="swiper-button-next-3 bg-zinc-700 w-10 h-10 rounded-full flex items-center justify-center cursor-pointer hover:bg-zinc-600 transition-colors duration-200"
  633. >
  634. <i class="icon-arrow-right text-zinc-300 text-sm font-normal"></i>
  635. </div>
  636. </div>
  637. </div>
  638. </div>
  639. <div class="max-w-screen-2xl mx-auto">
  640. <div class="w-full relative max-w-full">
  641. <Swiper
  642. :modules="[Navigation, Pagination]"
  643. slides-per-view="auto"
  644. :space-between="30"
  645. :pagination="{ el: '.swiper-pagination-3', clickable: true }"
  646. :navigation="{
  647. prevEl: '.swiper-button-prev-3',
  648. nextEl: '.swiper-button-next-3',
  649. }"
  650. class="h-[360px] sm:h-[360px] md:h-[480px] lg:h-[720px] max-w-full"
  651. >
  652. <SwiperSlide class="!max-w-screen-2xl !w-full">
  653. <div
  654. class="w-full h-full flex items-center px-0 md:px-20"
  655. :style="{
  656. backgroundImage: `url(${homeC1Webp})`,
  657. backgroundSize: 'cover',
  658. backgroundPosition: 'center',
  659. backgroundRepeat: 'no-repeat',
  660. }"
  661. >
  662. <div
  663. class="w-full lg:w-[50%] h-full md:h-auto bg-white/5 rounded-0 md:rounded-2xl backdrop-blur-[50px] px-4 py-8 md:py-12 md:px-8 flex flex-col gap-8 border border-white/10"
  664. >
  665. <div
  666. class="opacity-90 justify-start text-white text-2xl font-normal md:text-4xl"
  667. >
  668. {{ t("about.companyInfo.name") }}
  669. </div>
  670. <div
  671. class="opacity-70 justify-start text-white text-base md:text-lg font-normal leading-relaxed whitespace-pre-wrap"
  672. >
  673. {{ t("about.companyInfo.description") }}
  674. </div>
  675. </div>
  676. </div>
  677. </SwiperSlide>
  678. </Swiper>
  679. </div>
  680. <div class="max-w-screen-2xl mx-auto relative">
  681. <div class="swiper-pagination swiper-pagination-3"></div>
  682. </div>
  683. </div>
  684. </section>
  685. <!-- 产品咨询 -->
  686. <section class="max-w-full h-[240px] md:h-[480px] bg-black/80 md:block">
  687. <div class="h-full relative">
  688. <div
  689. class="absolute top-0 left-0 w-full h-full flex flex-col gap-6 items-center justify-center z-10"
  690. >
  691. <h1
  692. class="text-center justify-start text-white font-normal text-xl sm:text-2xl md:text-3xl px-2"
  693. >
  694. {{ t("products.consultation") }}
  695. </h1>
  696. <nuxt-link
  697. :to="`${homepagePath}/contact`"
  698. class="w-32 h-10 md:w-40 md:h-11 bg-zinc-300/10 rounded-lg outline outline-1 flex items-center justify-center gap-2 outline-white/20 backdrop-blur-[10px] cursor-pointer hover:bg-zinc-300/20 transition-colors duration-200"
  699. >
  700. <span class="text-xs md:text-sm font-normal">{{
  701. t("products.consultation_button")
  702. }}</span>
  703. <i class="icon-arrow-right text-sm font-normal"></i>
  704. </nuxt-link>
  705. </div>
  706. <img
  707. v-if="isMobile"
  708. :src="videoWebp"
  709. alt="video"
  710. class="w-full h-full object-cover opacity-20"
  711. />
  712. <video
  713. v-else
  714. :src="videoSrc"
  715. autoplay
  716. muted
  717. loop
  718. :poster="videoWebp"
  719. class="w-full h-full object-cover opacity-20"
  720. ></video>
  721. </div>
  722. </section>
  723. </div>
  724. </template>
  725. <script setup lang="ts">
  726. import { Swiper, SwiperSlide } from "swiper/vue";
  727. import {
  728. Navigation,
  729. Pagination,
  730. Autoplay,
  731. EffectCreative,
  732. } from "swiper/modules";
  733. import "swiper/css";
  734. import "swiper/css/navigation";
  735. import "swiper/css/pagination";
  736. import { useBreakpoints, breakpointsTailwind } from "@vueuse/core";
  737. import { useI18n, useRoute, useAsyncData, queryCollection } from "#imports";
  738. import video from "@/assets/videos/video.mp4";
  739. import videoWebp from "@/assets/videos/video.webp";
  740. import homeA1Webp from "@/assets/images/home-a-1.webp";
  741. import homeA2Webp from "@/assets/images/home-a-2.webp";
  742. import homeA3Webp from "@/assets/videos/banner03.mp4";
  743. import homeC1Webp from "@/assets/images/home-c-1.webp";
  744. // 数据类型定义
  745. interface Product {
  746. id: number;
  747. title: string;
  748. image: string;
  749. link: string;
  750. description?: string;
  751. name?: string;
  752. }
  753. interface Usage {
  754. id: number;
  755. name: string;
  756. category?: string;
  757. products: Product[];
  758. }
  759. interface Category {
  760. id: number;
  761. title: string;
  762. description: string;
  763. capacities: string[];
  764. summary: string;
  765. sort: number;
  766. image: string;
  767. link: string;
  768. audiences: number;
  769. }
  770. // 使用i18n
  771. const { t, locale } = useI18n();
  772. // 默认语言
  773. const defaultLocale = "zh";
  774. // 获取路由
  775. const route = useRoute();
  776. // 断点
  777. const breakpoints = useBreakpoints(breakpointsTailwind);
  778. // 是否移动端
  779. const isMobile = breakpoints.smaller("md");
  780. const videoSrc = ref(video);
  781. /**
  782. * 使用计算属性获取当前语言的数据文件URL
  783. */
  784. const usageDataUrl = computed(() => {
  785. return `/data/usages-${locale.value}.json`;
  786. });
  787. const categoryDataUrl = computed(() => {
  788. return `/data/categories-${locale.value}.json`;
  789. });
  790. const productsDataUrl = computed(() => {
  791. return `/data/products-${locale.value}.json`;
  792. });
  793. const homepagePath = computed(() => {
  794. return locale.value === "zh" ? "" : `/${locale.value}`;
  795. });
  796. // 获取按用途产品数据
  797. const usageList = ref<Usage[]>([]);
  798. const isLoadingUsage = ref(true);
  799. const activeUsageId = ref(1);
  800. // 获取按分类栏目数据
  801. const categoryList = ref<Category[]>([]);
  802. const isLoadingCategory = ref(true);
  803. // 加载用途数据
  804. const loadUsageData = async () => {
  805. try {
  806. isLoadingUsage.value = true;
  807. // 使用fetch获取数据
  808. if (process.client) {
  809. const response = await fetch(usageDataUrl.value);
  810. if (!response.ok) {
  811. throw new Error(`加载用途数据失败: ${response.status}`);
  812. }
  813. const usageData = await response.json();
  814. // 加载对应的产品数据
  815. const productsResponse = await fetch(productsDataUrl.value);
  816. if (!productsResponse.ok) {
  817. throw new Error(`加载产品数据失败: ${productsResponse.status}`);
  818. }
  819. const productsData = await productsResponse.json();
  820. // 处理数据
  821. usageList.value = usageData
  822. .map((usage: any) => {
  823. // 为每种用途找到对应的产品
  824. const usageProducts = [];
  825. // 按照正确的设计模式:使用用途的title与产品的usage数组进行匹配
  826. // 找出所有usage属性包含当前用途title的产品
  827. const matchedProducts = productsData.filter(
  828. (product: any) =>
  829. product.usage &&
  830. Array.isArray(product.usage) &&
  831. product.usage.includes(usage.title)
  832. );
  833. // 将匹配的产品添加到列表
  834. if (matchedProducts.length > 0) {
  835. matchedProducts.forEach((product: any) => {
  836. usageProducts.push({
  837. id: product.id,
  838. title: product.title,
  839. image: product.image,
  840. link: `${homepagePath.value}/products/${product.name}`,
  841. description: product.summary,
  842. });
  843. });
  844. } else {
  845. // 如果没有找到匹配的产品,添加一个占位产品
  846. usageProducts.push({
  847. id: `placeholder-${usage.id}`,
  848. title: usage.title,
  849. image: ``,
  850. link: `${homepagePath.value}/products?usage=${encodeURIComponent(
  851. usage.title
  852. )}`,
  853. description: "",
  854. });
  855. }
  856. return {
  857. id: parseInt(usage.id) || 0,
  858. name: usage.title,
  859. category: usage.category || "",
  860. products: usageProducts,
  861. };
  862. })
  863. .sort((a: any, b: any) => a.id - b.id);
  864. // 设置默认选中的用途
  865. if (usageList.value.length > 0) {
  866. activeUsageId.value = usageList.value[0].id;
  867. }
  868. }
  869. } catch (error) {
  870. console.error("Error loading usage data:", error);
  871. } finally {
  872. isLoadingUsage.value = false;
  873. }
  874. };
  875. // 加载分类数据
  876. const loadCategoryData = async () => {
  877. try {
  878. isLoadingCategory.value = true;
  879. // 使用fetch获取数据
  880. if (process.client) {
  881. const response = await fetch(categoryDataUrl.value);
  882. if (!response.ok) {
  883. throw new Error(`加载分类数据失败: ${response.status}`);
  884. }
  885. const data = await response.json();
  886. // 处理数据
  887. categoryList.value = data
  888. .map((category: any) => {
  889. return {
  890. id: parseInt(category.id) || 0,
  891. title: category.title || "",
  892. description: category.description || "",
  893. image: category.image || "",
  894. link: `${homepagePath.value}/products?category=${encodeURIComponent(
  895. category.title
  896. )}&audiences=${category.audiences}`,
  897. capacities: category.capacities || [],
  898. summary: category.summary || "",
  899. sort: category.sort || 0,
  900. audiences: category.audiences,
  901. };
  902. })
  903. .sort((a: any, b: any) => a.id - b.id);
  904. }
  905. } catch (error) {
  906. console.error("Error loading category data:", error);
  907. } finally {
  908. isLoadingCategory.value = false;
  909. }
  910. };
  911. // 当页面加载或语言改变时加载数据
  912. onMounted(() => {
  913. loadUsageData();
  914. loadCategoryData();
  915. });
  916. watch(locale, () => {
  917. loadUsageData();
  918. loadCategoryData();
  919. });
  920. // 计算当前用途列表
  921. const typedUsageList = computed(() => {
  922. return usageList.value as Usage[];
  923. });
  924. // 计算当前激活的索引
  925. const activeIndex = computed(() => {
  926. return typedUsageList.value.findIndex(
  927. (item) => item.id === activeUsageId.value
  928. );
  929. });
  930. const activeProducts = computed(() => {
  931. const currentUsage = typedUsageList.value.find(
  932. (item: Usage) => item.id === activeUsageId.value
  933. );
  934. return currentUsage?.products || [];
  935. });
  936. // 图片加载状态
  937. const isImageLoaded = ref<Record<number, boolean>>({});
  938. const imageErrors = ref<Record<number, boolean>>({});
  939. // 监听图片加载状态
  940. watch(
  941. activeProducts,
  942. (newProducts: Product[]) => {
  943. if (process.client) {
  944. newProducts.forEach((product: Product) => {
  945. if (product.image) {
  946. const img = new window.Image();
  947. img.onload = () => handleImageLoad(product.id);
  948. img.onerror = () => handleImageError(product.id);
  949. img.src = product.image;
  950. }
  951. });
  952. }
  953. },
  954. { immediate: true }
  955. );
  956. // 处理图片加载
  957. const handleImageLoad = (id: number) => {
  958. if (process.client) {
  959. isImageLoaded.value[id] = true;
  960. imageErrors.value[id] = false;
  961. }
  962. };
  963. // 处理图片加载错误
  964. const handleImageError = (id: number) => {
  965. if (process.client) {
  966. console.error(`Failed to load image for product ${id}`);
  967. isImageLoaded.value[id] = true;
  968. imageErrors.value[id] = true;
  969. }
  970. };
  971. // 处理用途点击
  972. const handleUsageClick = (id: number) => {
  973. if (process.client) {
  974. // 重置图片加载状态
  975. isImageLoaded.value = {};
  976. imageErrors.value = {};
  977. activeUsageId.value = id;
  978. }
  979. };
  980. // 计算当前分类列表
  981. const typedCategoryList = computed(() => {
  982. return categoryList.value as Category[];
  983. });
  984. // SEO优化
  985. useHead({
  986. title: t("home.title") + " - Hanye",
  987. meta: [
  988. {
  989. name: "description",
  990. content: t("home.description"),
  991. },
  992. {
  993. name: "keywords",
  994. content: t("home.keywords"),
  995. },
  996. ],
  997. });
  998. </script>
  999. <style lang="scss" scoped>
  1000. :deep(.swiper-pagination-3) {
  1001. margin: auto;
  1002. position: static;
  1003. padding: 1rem 0;
  1004. }
  1005. :deep(.swiper-pagination-bullet) {
  1006. background-color: var(--color-bg); /* Example color */
  1007. border: 2px solid var(--color-text);
  1008. }
  1009. :deep(.swiper-pagination-bullet-active) {
  1010. background-color: var(--color-text); /* Example color */
  1011. }
  1012. .use-business {
  1013. background-image: url("@/assets/images/business.webp");
  1014. background-size: auto 548px;
  1015. background-position: left top;
  1016. background-repeat: no-repeat;
  1017. }
  1018. .use-personal {
  1019. background-image: url("@/assets/images/personal.webp");
  1020. background-size: auto 480px;
  1021. background-position: right bottom;
  1022. background-repeat: no-repeat;
  1023. }
  1024. // 优化过渡动画
  1025. .slide-fade-enter-active,
  1026. .slide-fade-leave-active {
  1027. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  1028. position: absolute;
  1029. width: 100%;
  1030. height: 300px;
  1031. }
  1032. @media (min-width: 640px) {
  1033. .slide-fade-enter-active,
  1034. .slide-fade-leave-active {
  1035. height: 350px;
  1036. }
  1037. }
  1038. @media (min-width: 768px) {
  1039. .slide-fade-enter-active,
  1040. .slide-fade-leave-active {
  1041. height: 400px;
  1042. }
  1043. }
  1044. @media (min-width: 1024px) {
  1045. .slide-fade-enter-active,
  1046. .slide-fade-leave-active {
  1047. height: 450px;
  1048. }
  1049. }
  1050. .slide-fade-enter-from {
  1051. opacity: 0;
  1052. transform: translateX(30px);
  1053. }
  1054. .slide-fade-leave-to {
  1055. opacity: 0;
  1056. transform: translateX(-30px);
  1057. }
  1058. // 添加响应式优化
  1059. @media (max-width: 640px) {
  1060. .slide-fade-enter-from,
  1061. .slide-fade-leave-to {
  1062. transform: translateX(15px);
  1063. }
  1064. }
  1065. // 优化图片加载动画
  1066. @keyframes gradient {
  1067. 0% {
  1068. background-position: 0% 50%;
  1069. }
  1070. 50% {
  1071. background-position: 100% 50%;
  1072. }
  1073. 100% {
  1074. background-position: 0% 50%;
  1075. }
  1076. }
  1077. .animate-gradient {
  1078. background-size: 200% 200%;
  1079. animation: gradient 3s ease infinite;
  1080. }
  1081. // 移除 pagination 相关样式
  1082. :deep(.swiper-pagination-2) {
  1083. display: none;
  1084. }
  1085. // 添加导航按钮禁用样式
  1086. :deep(.swiper-button-disabled) {
  1087. opacity: 0.35;
  1088. cursor: not-allowed;
  1089. pointer-events: none;
  1090. }
  1091. // 优化轮播图样式
  1092. :deep(.swiper-container-1) {
  1093. .swiper-slide {
  1094. transition: all 0.5s ease;
  1095. transform-origin: center center;
  1096. backface-visibility: hidden;
  1097. perspective: 1000px;
  1098. }
  1099. .swiper-pagination-bullet {
  1100. width: 12px;
  1101. height: 12px;
  1102. background: transparent;
  1103. border: 2px solid rgba(255, 255, 255, 0.5);
  1104. opacity: 1;
  1105. transition: all 0.3s ease;
  1106. margin: 0 8px !important;
  1107. &-active {
  1108. background: #fff;
  1109. border-color: #fff;
  1110. transform: scale(1.2);
  1111. }
  1112. }
  1113. .swiper-pagination {
  1114. display: flex;
  1115. justify-content: center;
  1116. align-items: center;
  1117. padding: 20px 0;
  1118. }
  1119. }
  1120. // 优化图片加载动画
  1121. @keyframes fadeIn {
  1122. from {
  1123. opacity: 0;
  1124. transform: scale(1.1);
  1125. }
  1126. to {
  1127. opacity: 1;
  1128. transform: scale(1);
  1129. }
  1130. }
  1131. .swiper-slide-active {
  1132. img {
  1133. animation: fadeIn 0.8s ease-out forwards;
  1134. }
  1135. }
  1136. // 优化产品卡片动画和交互
  1137. .swiper-slide {
  1138. a {
  1139. text-decoration: none;
  1140. display: block;
  1141. height: 100%;
  1142. &:hover {
  1143. text-decoration: none;
  1144. }
  1145. > div {
  1146. position: relative;
  1147. z-index: 1;
  1148. cursor: pointer;
  1149. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  1150. &:hover {
  1151. transform: translateY(-2px);
  1152. box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  1153. }
  1154. }
  1155. }
  1156. }
  1157. // 移除卡片抖动动画
  1158. @keyframes cardHover {
  1159. 0% {
  1160. transform: translateY(0);
  1161. }
  1162. 100% {
  1163. transform: translateY(-2px);
  1164. }
  1165. }
  1166. // 添加渐变背景动画
  1167. @keyframes gradient-bg {
  1168. 0% {
  1169. background-position: 0% 50%;
  1170. opacity: 1;
  1171. }
  1172. 50% {
  1173. background-position: 100% 50%;
  1174. opacity: 0.9;
  1175. }
  1176. 100% {
  1177. background-position: 0% 50%;
  1178. opacity: 1;
  1179. }
  1180. }
  1181. .animate-gradient-bg {
  1182. background-size: 200% 200%;
  1183. animation: gradient-bg 15s ease infinite;
  1184. }
  1185. </style>