Hanye官网
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093
  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="/products/1"
  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. <div class="max-w-screen-2xl mx-auto relative">
  101. <div
  102. class="swiper-pagination swiper-pagination-1 text-left bottom-1 top-0"
  103. ></div>
  104. </div>
  105. </Swiper>
  106. </section>
  107. <!-- 按用途产品展示 -->
  108. <section class="max-w-full mb-12 md:mb-32 xl:px-8 lg:px-6 md:px-4 px-4">
  109. <div class="max-w-screen-2xl mx-auto relative">
  110. <div
  111. class="justify-center text-cyan-400 text-base font-normal leading-tight mb-4"
  112. >
  113. {{ t("products.usage") }}
  114. </div>
  115. <div
  116. class="justify-center text-white font-normal mb-8 md:mb-16 text-xl sm:text-2xl md:text-4xl lg:text-6xl"
  117. >
  118. {{ t("products.usage_title") }}
  119. </div>
  120. </div>
  121. <div class="max-w-screen-2xl mx-auto">
  122. <div class="w-full mb-8">
  123. <div class="flex flex-wrap items-center gap-2">
  124. <div
  125. v-for="(usage, index) in typedUsageList"
  126. :key="usage.id"
  127. 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"
  128. :class="{
  129. 'bg-cyan-400/10 border-cyan-400 text-cyan-400':
  130. activeIndex === index,
  131. 'hover:border-zinc-600': activeIndex !== index,
  132. }"
  133. @click="handleUsageClick(usage.id)"
  134. >
  135. <div
  136. class="usage-name text-center text-xs sm:text-sm font-normal leading-tight md:text-base transition-colors duration-300 relative z-10"
  137. >
  138. {{ usage.name }}
  139. <!-- 用途名称 -->
  140. </div>
  141. <div
  142. class="absolute inset-0 rounded-full bg-cyan-400/20 scale-0 transition-transform duration-300 group-hover:scale-100"
  143. ></div>
  144. </div>
  145. <div class="flex items-center justify-center gap-4 ml-auto">
  146. <div
  147. 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"
  148. >
  149. <i
  150. class="icon-arrow-left text-zinc-300 text-xs sm:text-sm font-normal"
  151. ></i>
  152. </div>
  153. <div
  154. 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"
  155. >
  156. <i
  157. class="icon-arrow-right text-zinc-300 text-xs sm:text-sm font-normal"
  158. ></i>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. <div class="max-w-screen-2xl mx-auto">
  165. <div
  166. class="w-full h-[380px] sm:h-[300px] md:h-[350px] lg:h-[360px] xl:h-[380px] 2xl:h-[460px] relative"
  167. >
  168. <TransitionGroup name="slide-fade" tag="div" class="relative h-full">
  169. <div :key="activeUsageId" class="w-full h-full">
  170. <Swiper
  171. :modules="[Navigation]"
  172. :spaceBetween="30"
  173. :slidesPerView="4"
  174. :breakpoints="{
  175. 320: { slidesPerView: 1, spaceBetween: 10 },
  176. 448: { slidesPerView: 2, spaceBetween: 10 },
  177. 640: { slidesPerView: 3, spaceBetween: 20 },
  178. 1024: { slidesPerView: 4, spaceBetween: 20 },
  179. 1280: { slidesPerView: 4, spaceBetween: 30 },
  180. 1536: { slidesPerView: 4, spaceBetween: 30 },
  181. }"
  182. :navigation="{
  183. prevEl: '.swiper-button-prev-2',
  184. nextEl: '.swiper-button-next-2',
  185. }"
  186. class="h-full"
  187. >
  188. <SwiperSlide
  189. v-for="product in activeProducts"
  190. :key="product.id"
  191. class="w-full sm:w-1/2 md:w-1/3 lg:w-1/4"
  192. >
  193. <div class="w-full h-full p-2">
  194. <nuxt-link :to="product.link" class="block w-full h-full">
  195. <div
  196. 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"
  197. >
  198. <!-- 图片加载占位 -->
  199. <div
  200. v-if="!isImageLoaded[product.id]"
  201. class="absolute inset-0 bg-gradient-to-br from-zinc-800 via-zinc-700 to-zinc-800 animate-gradient"
  202. >
  203. <div
  204. class="absolute inset-0 flex items-center justify-center"
  205. >
  206. <div
  207. class="w-8 h-8 border-4 border-cyan-400/20 border-t-cyan-400 rounded-full animate-spin"
  208. ></div>
  209. </div>
  210. </div>
  211. <!-- 图片容器 -->
  212. <div
  213. class="w-full aspect-square relative transition-all duration-300 overflow-hidden rounded-lg"
  214. :class="{ 'opacity-0': !isImageLoaded[product.id] }"
  215. >
  216. <img
  217. :src="product.image"
  218. :alt="product.title"
  219. class="w-full h-full object-cover transition-all duration-500 group-hover:scale-110"
  220. @load="handleImageLoad(product.id)"
  221. @error="handleImageError(product.id)"
  222. loading="lazy"
  223. />
  224. <div
  225. 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"
  226. ></div>
  227. <!-- 添加查看详情按钮 -->
  228. <div
  229. 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"
  230. >
  231. <div
  232. 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"
  233. >
  234. {{ t("products.view_details") }}
  235. </div>
  236. </div>
  237. </div>
  238. <!-- 文字内容 -->
  239. <div
  240. class="w-full mt-4 min-h-[80px] transition-all duration-300 transform"
  241. :class="{
  242. 'opacity-0 translate-y-4':
  243. !isImageLoaded[product.id],
  244. 'opacity-100 translate-y-0':
  245. isImageLoaded[product.id],
  246. }"
  247. >
  248. <div
  249. 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"
  250. >
  251. {{ product.title }}
  252. </div>
  253. <div
  254. class="text-center text-zinc-400 text-sm font-normal leading-tight line-clamp-2 group-hover:text-zinc-300 transition-colors duration-300"
  255. >
  256. {{ product.description }}
  257. </div>
  258. </div>
  259. </div>
  260. </nuxt-link>
  261. </div>
  262. </SwiperSlide>
  263. </Swiper>
  264. </div>
  265. </TransitionGroup>
  266. </div>
  267. </div>
  268. </section>
  269. <!-- 按分类栏目展示 -->
  270. <section class="max-w-full mb-12 md:mb-32 xl:px-8 lg:px-6 md:px-4 px-4">
  271. <div class="max-w-screen-2xl mx-auto relative">
  272. <div
  273. class="justify-center text-cyan-400 text-base font-normal leading-tight mb-4"
  274. >
  275. Hanye独自に開発・製造、販売
  276. </div>
  277. <div
  278. class="justify-center text-white font-normal mb-8 md:mb-16 text-xl sm:text-2xl md:text-4xl lg:text-6xl"
  279. >
  280. 製品カテゴリー
  281. </div>
  282. </div>
  283. <div class="max-w-screen-2xl mx-auto">
  284. <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
  285. <nuxt-link
  286. v-for="category in typedCategoryList"
  287. :key="category.id"
  288. :to="category.link"
  289. class="bg-zinc-950/10 backdrop-blur-[50px] border border-white/10 rounded-lg flex gap-8 p-4 sm:p-8 justify-between category-item group hover:border-cyan-400/30 transition-all duration-300"
  290. >
  291. <div class="col-span-1 flex flex-col gap-4">
  292. <div
  293. class="flex flex-col gap-2 opacity-80 group-hover:opacity-100 transition-opacity duration-300"
  294. >
  295. <div
  296. v-for="capacitie in category.capacities"
  297. :key="capacitie"
  298. class="text-white text-sm md:text-base font-normal leading-tight flex gap-2 items-center group-hover:text-cyan-400 transition-colors duration-300"
  299. >
  300. <i
  301. class="icon-star text-sm group-hover:scale-110 transition-transform duration-300"
  302. ></i>
  303. <span>{{ capacitie }}</span>
  304. </div>
  305. </div>
  306. <div
  307. class="p-2 sm:p-4 mt-auto bg-zinc-500/20 rounded-lg outline outline-1 outline-offset-[-1px] outline-white/10 backdrop-blur-xl inline-flex justify-center items-center gap-3 overflow-hidden group-hover:bg-cyan-400/10 group-hover:outline-cyan-400/30 transition-all duration-300"
  308. >
  309. <div
  310. class="justify-start text-neutral-200 text-xs md:text-sm font-medium uppercase leading-relaxed group-hover:text-cyan-400 transition-colors duration-300"
  311. >
  312. {{ category.title }}
  313. </div>
  314. </div>
  315. </div>
  316. <div
  317. class="w-32 h-32 md:w-44 md:h-44 relative overflow-hidden rounded-lg"
  318. >
  319. <img
  320. :src="category.image"
  321. :alt="category.title"
  322. class="w-full h-full object-contain transition-transform duration-500 group-hover:scale-110"
  323. />
  324. <div
  325. 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"
  326. ></div>
  327. </div>
  328. </nuxt-link>
  329. </div>
  330. </div>
  331. </section>
  332. <!-- 产品核心展示 -->
  333. <section class="max-w-full mb-12 md:mb-32 xl:px-8 lg:px-6 md:px-4 px-4">
  334. <div
  335. 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"
  336. >
  337. <div class="inline-flex justify-start items-center gap-5">
  338. <div
  339. 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"
  340. >
  341. <div class="w-full h-full flex items-center justify-center">
  342. <i class="icon-h1 text-white text-5xl"></i>
  343. </div>
  344. </div>
  345. <div class="inline-flex flex-col justify-center items-start flex-1">
  346. <div
  347. class="justify-start text-white font-medium text-1xl md:text-lg"
  348. >
  349. {{ t("products.support") }}
  350. </div>
  351. <div
  352. class="justify-start text-zinc-300 text-xs font-normal md:text-sm"
  353. >
  354. {{ t("products.support_description") }}
  355. </div>
  356. </div>
  357. </div>
  358. <div class="inline-flex justify-start items-center gap-5">
  359. <div
  360. 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"
  361. >
  362. <div class="w-full h-full flex items-center justify-center">
  363. <i class="icon-h2 text-white text-5xl"></i>
  364. </div>
  365. </div>
  366. <div class="inline-flex flex-col justify-center items-start flex-1">
  367. <div
  368. class="justify-start text-white font-medium text-1xl md:text-lg"
  369. >
  370. {{ t("products.development") }}
  371. </div>
  372. <div
  373. class="justify-start text-zinc-300 text-xs font-normal md:text-sm"
  374. >
  375. {{ t("products.development_description") }}
  376. </div>
  377. </div>
  378. </div>
  379. <div class="inline-flex justify-start items-center gap-5">
  380. <div
  381. 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"
  382. >
  383. <div class="w-full h-full flex items-center justify-center">
  384. <i class="icon-h3 text-white text-5xl"></i>
  385. </div>
  386. </div>
  387. <div class="inline-flex flex-col justify-center items-start flex-1">
  388. <div
  389. class="justify-start text-white font-medium text-1xl md:text-lg"
  390. >
  391. {{ t("products.develop") }}
  392. </div>
  393. <div
  394. class="justify-start text-zinc-300 text-xs font-normal md:text-sm"
  395. >
  396. {{ t("products.develop_description") }}
  397. </div>
  398. </div>
  399. </div>
  400. </div>
  401. </section>
  402. <!-- 当社の強み -->
  403. <section class="max-w-full mb-12 md:mb-32 xl:px-8 lg:px-6 md:px-4 px-4">
  404. <div class="max-w-screen-2xl mx-auto relative">
  405. <div
  406. class="justify-center text-cyan-400 text-base font-normal leading-tight mb-4"
  407. >
  408. {{ t("products.strong_point") }}
  409. </div>
  410. <div
  411. class="justify-center text-white font-normal mb-8 md:mb-16 text-xl sm:text-2xl md:text-4xl lg:text-6xl"
  412. >
  413. {{ t("products.strong_point_title") }}
  414. </div>
  415. <div
  416. class="absolute right-0 top-1/2 -translate-y-1/2 z-10 lg:block hidden"
  417. >
  418. <div class="flex items-center justify-center gap-4">
  419. <div
  420. 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"
  421. >
  422. <i class="icon-arrow-left text-zinc-300 text-sm font-normal"></i>
  423. </div>
  424. <div
  425. 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"
  426. >
  427. <i class="icon-arrow-right text-zinc-300 text-sm font-normal"></i>
  428. </div>
  429. </div>
  430. </div>
  431. </div>
  432. <div class="max-w-screen-2xl mx-auto">
  433. <div class="w-full relative max-w-full">
  434. <Swiper
  435. :modules="[Navigation, Pagination]"
  436. slides-per-view="auto"
  437. :space-between="30"
  438. :pagination="{ el: '.swiper-pagination-3', clickable: true }"
  439. :navigation="{
  440. prevEl: '.swiper-button-prev-3',
  441. nextEl: '.swiper-button-next-3',
  442. }"
  443. class="h-[320px] sm:h-[320px] md:h-[480px] lg:h-[720px] max-w-full"
  444. >
  445. <SwiperSlide class="!max-w-screen-2xl !w-full">
  446. <div
  447. class="w-full h-full flex items-center px-0 md:px-20"
  448. :style="{
  449. backgroundImage: `url(${homeC1Webp})`,
  450. backgroundSize: 'cover',
  451. backgroundPosition: 'center',
  452. backgroundRepeat: 'no-repeat',
  453. }"
  454. >
  455. <div
  456. 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"
  457. >
  458. <div
  459. class="opacity-90 justify-start text-white text-2xl font-normal md:text-4xl"
  460. >
  461. 一貫体制による高品質と安定供給
  462. </div>
  463. <div
  464. class="opacity-70 justify-start text-white text-base md:text-lg font-normal leading-relaxed"
  465. >
  466. 「企画・開発から製造、品質管理、販売、オンラインショップ運営まで自社で完結。ISO認証取得の工場で生産された信頼性の高い製品を、安定してお届けします。」
  467. </div>
  468. </div>
  469. </div>
  470. </SwiperSlide>
  471. </Swiper>
  472. </div>
  473. <div class="max-w-screen-2xl mx-auto relative">
  474. <div class="swiper-pagination swiper-pagination-3"></div>
  475. </div>
  476. </div>
  477. </section>
  478. <!-- 产品咨询 -->
  479. <section class="max-w-full h-[240px] md:h-[480px] bg-black/80 md:block">
  480. <div class="h-full relative">
  481. <div
  482. class="absolute top-0 left-0 w-full h-full flex flex-col gap-6 items-center justify-center z-10"
  483. >
  484. <h1
  485. class="text-center justify-start text-white font-normal text-xl sm:text-2xl md:text-3xl px-2"
  486. >
  487. {{ t("products.consultation") }}
  488. </h1>
  489. <nuxt-link
  490. :to="locale === defaultLocale ? '/contact' : `/${locale}/contact`"
  491. 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"
  492. >
  493. <span class="text-xs md:text-sm font-normal">{{
  494. t("products.consultation_button")
  495. }}</span>
  496. <i class="icon-arrow-right text-sm font-normal"></i>
  497. </nuxt-link>
  498. </div>
  499. <img
  500. v-if="isMobile"
  501. :src="videoWebp"
  502. alt="video"
  503. class="w-full h-full object-cover opacity-20"
  504. />
  505. <video
  506. v-else
  507. :src="videoSrc"
  508. autoplay
  509. muted
  510. loop
  511. :poster="videoWebp"
  512. class="w-full h-full object-cover opacity-20"
  513. ></video>
  514. </div>
  515. </section>
  516. </div>
  517. </template>
  518. <script setup lang="ts">
  519. import { Swiper, SwiperSlide } from "swiper/vue";
  520. import {
  521. Navigation,
  522. Pagination,
  523. Autoplay,
  524. EffectCreative,
  525. } from "swiper/modules";
  526. import "swiper/css";
  527. import "swiper/css/navigation";
  528. import "swiper/css/pagination";
  529. import { useBreakpoints, breakpointsTailwind } from "@vueuse/core";
  530. import { useI18n, useRoute, useAsyncData, queryCollection } from "#imports";
  531. import video from "@/assets/videos/video.mp4";
  532. import videoWebp from "@/assets/videos/video.webp";
  533. import homeA1Webp from "@/assets/images/home-a-1.webp";
  534. import homeC1Webp from "@/assets/images/home-c-1.webp";
  535. // 数据类型定义
  536. interface Product {
  537. id: number;
  538. title: string;
  539. image: string;
  540. link: string;
  541. description?: string;
  542. }
  543. interface Usage {
  544. id: number;
  545. name: string;
  546. category?: string;
  547. products: Product[];
  548. }
  549. interface Category {
  550. id: number;
  551. title: string;
  552. description: string;
  553. capacities: string[];
  554. summary: string;
  555. sort: number;
  556. image: string;
  557. link: string;
  558. }
  559. // 使用i18n
  560. const { t, locale } = useI18n();
  561. // 默认语言
  562. const defaultLocale = "ja";
  563. // 获取路由
  564. const route = useRoute();
  565. // 断点
  566. const breakpoints = useBreakpoints(breakpointsTailwind);
  567. // 是否移动端
  568. const isMobile = breakpoints.smaller("md");
  569. const videoSrc = ref(video);
  570. // 获取轮播图数据(由于没有对应的content文件,这里保留为静态数据)
  571. const carouselList = ref([
  572. {
  573. id: 1,
  574. title: "高性能SSD",
  575. image: homeA1Webp,
  576. link: "/products/W400-1TBSY01",
  577. },
  578. ]);
  579. /**
  580. * 使用计算属性获取当前语言的数据文件URL
  581. */
  582. const usageDataUrl = computed(() => {
  583. return `/data/usages-${locale.value}.json`;
  584. });
  585. const categoryDataUrl = computed(() => {
  586. return `/data/categories-${locale.value}.json`;
  587. });
  588. const productsDataUrl = computed(() => {
  589. return `/data/products-${locale.value}.json`;
  590. });
  591. // 获取按用途产品数据
  592. const usageList = ref<Usage[]>([]);
  593. const isLoadingUsage = ref(true);
  594. const activeUsageId = ref(1);
  595. // 获取按分类栏目数据
  596. const categoryList = ref<Category[]>([]);
  597. const isLoadingCategory = ref(true);
  598. // 加载用途数据
  599. const loadUsageData = async () => {
  600. try {
  601. isLoadingUsage.value = true;
  602. // 使用fetch获取数据
  603. if (process.client) {
  604. const response = await fetch(usageDataUrl.value);
  605. if (!response.ok) {
  606. throw new Error(`加载用途数据失败: ${response.status}`);
  607. }
  608. const usageData = await response.json();
  609. // 加载对应的产品数据
  610. const productsResponse = await fetch(productsDataUrl.value);
  611. if (!productsResponse.ok) {
  612. throw new Error(`加载产品数据失败: ${productsResponse.status}`);
  613. }
  614. const productsData = await productsResponse.json();
  615. // 处理数据
  616. usageList.value = usageData
  617. .map((usage: any) => {
  618. console.log(`处理用途: ${usage.id} - ${usage.title}`, usage);
  619. // 为每种用途找到对应的产品
  620. const usageProducts = [];
  621. // 按照正确的设计模式:使用用途的title与产品的usage数组进行匹配
  622. // 找出所有usage属性包含当前用途title的产品
  623. const matchedProducts = productsData.filter(
  624. (product: any) =>
  625. product.usage &&
  626. Array.isArray(product.usage) &&
  627. product.usage.includes(usage.title)
  628. );
  629. console.log(
  630. `用途"${usage.title}"匹配到 ${matchedProducts.length} 个产品`
  631. );
  632. // 将匹配的产品添加到列表
  633. if (matchedProducts.length > 0) {
  634. matchedProducts.forEach((product: any) => {
  635. usageProducts.push({
  636. id: product.id,
  637. title: product.title,
  638. image: product.image,
  639. link: `/products/${product.id}`,
  640. description: product.summary,
  641. });
  642. });
  643. } else {
  644. // 如果没有找到匹配的产品,添加一个占位产品
  645. console.log(`用途 ${usage.title} 没有匹配到任何产品,添加占位产品`);
  646. usageProducts.push({
  647. id: `placeholder-${usage.id}`,
  648. title: usage.title || "未命名用途",
  649. image: ``,
  650. link: `/products?usage=${encodeURIComponent(usage.title)}`,
  651. description: "",
  652. });
  653. }
  654. return {
  655. id: parseInt(usage.id) || 0,
  656. name: usage.title,
  657. category: usage.category || "",
  658. products: usageProducts,
  659. };
  660. })
  661. .sort((a: any, b: any) => a.id - b.id);
  662. // 设置默认选中的用途
  663. if (usageList.value.length > 0) {
  664. activeUsageId.value = usageList.value[0].id;
  665. }
  666. }
  667. } catch (error) {
  668. console.error("Error loading usage data:", error);
  669. } finally {
  670. isLoadingUsage.value = false;
  671. }
  672. };
  673. // 加载分类数据
  674. const loadCategoryData = async () => {
  675. try {
  676. isLoadingCategory.value = true;
  677. // 使用fetch获取数据
  678. if (process.client) {
  679. const response = await fetch(categoryDataUrl.value);
  680. if (!response.ok) {
  681. throw new Error(`加载分类数据失败: ${response.status}`);
  682. }
  683. const data = await response.json();
  684. console.log("Raw category data:", data);
  685. // 处理数据
  686. categoryList.value = data
  687. .map((category: any) => {
  688. return {
  689. id: parseInt(category.id) || 0,
  690. title: category.title || "",
  691. description: category.description || "",
  692. image: category.image || "",
  693. link: `/products?category=${encodeURIComponent(category.title)}`,
  694. capacities: category.capacities || [],
  695. summary: category.summary || "",
  696. sort: category.sort || 0,
  697. };
  698. })
  699. .sort((a: any, b: any) => a.id - b.id);
  700. }
  701. } catch (error) {
  702. console.error("Error loading category data:", error);
  703. } finally {
  704. isLoadingCategory.value = false;
  705. }
  706. };
  707. // 当页面加载或语言改变时加载数据
  708. onMounted(() => {
  709. loadUsageData();
  710. loadCategoryData();
  711. });
  712. watch(locale, () => {
  713. loadUsageData();
  714. loadCategoryData();
  715. });
  716. // 处理数据变化
  717. watchEffect(() => {
  718. if (usageList.value) {
  719. console.log("Updated usage list:", usageList.value);
  720. }
  721. if (categoryList.value) {
  722. console.log("Updated category list:", categoryList.value);
  723. }
  724. });
  725. // 计算当前用途列表
  726. const typedUsageList = computed(() => {
  727. console.log("Typed Usage List:", usageList.value);
  728. return usageList.value as Usage[];
  729. });
  730. // 计算当前激活的索引
  731. const activeIndex = computed(() => {
  732. return typedUsageList.value.findIndex(
  733. (item) => item.id === activeUsageId.value
  734. );
  735. });
  736. const activeProducts = computed(() => {
  737. const currentUsage = typedUsageList.value.find(
  738. (item: Usage) => item.id === activeUsageId.value
  739. );
  740. if (currentUsage?.products) {
  741. console.log(
  742. "Products:",
  743. currentUsage.products.map((p: Product) => ({
  744. id: p.id,
  745. title: p.title,
  746. image: p.image,
  747. link: p.link,
  748. }))
  749. );
  750. }
  751. return currentUsage?.products || [];
  752. });
  753. // 图片加载状态
  754. const isImageLoaded = ref<Record<number, boolean>>({});
  755. const imageErrors = ref<Record<number, boolean>>({});
  756. // 监听图片加载状态
  757. watch(
  758. activeProducts,
  759. (newProducts: Product[]) => {
  760. console.log("Active Products Changed:", newProducts);
  761. if (process.client) {
  762. newProducts.forEach((product: Product) => {
  763. if (product.image) {
  764. console.log(
  765. `Checking image for product ${product.id}:`,
  766. product.image
  767. );
  768. const img = new window.Image();
  769. img.onload = () => handleImageLoad(product.id);
  770. img.onerror = () => handleImageError(product.id);
  771. img.src = product.image;
  772. }
  773. });
  774. }
  775. },
  776. { immediate: true }
  777. );
  778. // 处理图片加载
  779. const handleImageLoad = (id: number) => {
  780. if (process.client) {
  781. console.log(`Image loaded for product ${id}`);
  782. isImageLoaded.value[id] = true;
  783. imageErrors.value[id] = false;
  784. }
  785. };
  786. // 处理图片加载错误
  787. const handleImageError = (id: number) => {
  788. if (process.client) {
  789. console.error(`Failed to load image for product ${id}`);
  790. isImageLoaded.value[id] = true;
  791. imageErrors.value[id] = true;
  792. }
  793. };
  794. // 处理用途点击
  795. const handleUsageClick = (id: number) => {
  796. if (process.client) {
  797. console.log("Usage clicked:", id);
  798. // 重置图片加载状态
  799. isImageLoaded.value = {};
  800. imageErrors.value = {};
  801. activeUsageId.value = id;
  802. }
  803. };
  804. // 计算当前分类列表
  805. const typedCategoryList = computed(() => {
  806. return categoryList.value as Category[];
  807. });
  808. // SEO优化
  809. useHead({
  810. title: t("home.title") + " - Hanye",
  811. meta: [
  812. {
  813. name: "description",
  814. content: t("home.description"),
  815. },
  816. {
  817. name: "keywords",
  818. content: t("home.keywords"),
  819. },
  820. ],
  821. });
  822. </script>
  823. <style lang="scss" scoped>
  824. :deep(.swiper-pagination-3) {
  825. margin: auto;
  826. position: static;
  827. padding: 1rem 0;
  828. }
  829. :deep(.swiper-pagination-bullet) {
  830. background-color: var(--color-bg); /* Example color */
  831. border: 2px solid var(--color-text);
  832. }
  833. :deep(.swiper-pagination-bullet-active) {
  834. background-color: var(--color-text); /* Example color */
  835. }
  836. .category-item {
  837. background-image: url("@/assets/images/home-b-1.webp");
  838. background-size: cover;
  839. background-position: center;
  840. background-repeat: no-repeat;
  841. opacity: 0.8;
  842. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  843. position: relative;
  844. overflow: hidden;
  845. &:hover {
  846. opacity: 1;
  847. transform: translateY(-2px);
  848. box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  849. &::before {
  850. opacity: 1;
  851. }
  852. }
  853. &::before {
  854. content: "";
  855. position: absolute;
  856. inset: 0;
  857. background: linear-gradient(45deg, rgba(6, 182, 212, 0.1), transparent);
  858. opacity: 0;
  859. transition: opacity 0.3s ease;
  860. pointer-events: none;
  861. }
  862. }
  863. // 优化过渡动画
  864. .slide-fade-enter-active,
  865. .slide-fade-leave-active {
  866. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  867. position: absolute;
  868. width: 100%;
  869. height: 300px;
  870. }
  871. @media (min-width: 640px) {
  872. .slide-fade-enter-active,
  873. .slide-fade-leave-active {
  874. height: 350px;
  875. }
  876. }
  877. @media (min-width: 768px) {
  878. .slide-fade-enter-active,
  879. .slide-fade-leave-active {
  880. height: 400px;
  881. }
  882. }
  883. @media (min-width: 1024px) {
  884. .slide-fade-enter-active,
  885. .slide-fade-leave-active {
  886. height: 450px;
  887. }
  888. }
  889. .slide-fade-enter-from {
  890. opacity: 0;
  891. transform: translateX(30px);
  892. }
  893. .slide-fade-leave-to {
  894. opacity: 0;
  895. transform: translateX(-30px);
  896. }
  897. // 添加响应式优化
  898. @media (max-width: 640px) {
  899. .slide-fade-enter-from,
  900. .slide-fade-leave-to {
  901. transform: translateX(15px);
  902. }
  903. }
  904. // 优化图片加载动画
  905. @keyframes gradient {
  906. 0% {
  907. background-position: 0% 50%;
  908. }
  909. 50% {
  910. background-position: 100% 50%;
  911. }
  912. 100% {
  913. background-position: 0% 50%;
  914. }
  915. }
  916. .animate-gradient {
  917. background-size: 200% 200%;
  918. animation: gradient 3s ease infinite;
  919. }
  920. // 移除 pagination 相关样式
  921. :deep(.swiper-pagination-2) {
  922. display: none;
  923. }
  924. // 添加导航按钮禁用样式
  925. :deep(.swiper-button-disabled) {
  926. opacity: 0.35;
  927. cursor: not-allowed;
  928. pointer-events: none;
  929. }
  930. // 优化轮播图样式
  931. :deep(.swiper-container-1) {
  932. .swiper-slide {
  933. transition: all 0.5s ease;
  934. transform-origin: center center;
  935. backface-visibility: hidden;
  936. perspective: 1000px;
  937. }
  938. .swiper-pagination-bullet {
  939. width: 12px;
  940. height: 12px;
  941. background: transparent;
  942. border: 2px solid rgba(255, 255, 255, 0.5);
  943. opacity: 1;
  944. transition: all 0.3s ease;
  945. margin: 0 8px !important;
  946. &-active {
  947. background: #fff;
  948. border-color: #fff;
  949. transform: scale(1.2);
  950. }
  951. }
  952. .swiper-pagination {
  953. display: flex;
  954. justify-content: center;
  955. align-items: center;
  956. padding: 20px 0;
  957. }
  958. }
  959. // 添加轮播图遮罩效果
  960. .swiper-slide {
  961. &::before {
  962. content: "";
  963. position: absolute;
  964. top: 0;
  965. left: 0;
  966. right: 0;
  967. bottom: 0;
  968. background: linear-gradient(
  969. to bottom,
  970. rgba(0, 0, 0, 0.2) 0%,
  971. rgba(0, 0, 0, 0.4) 100%
  972. );
  973. z-index: 1;
  974. }
  975. }
  976. // 优化图片加载动画
  977. @keyframes fadeIn {
  978. from {
  979. opacity: 0;
  980. transform: scale(1.1);
  981. }
  982. to {
  983. opacity: 1;
  984. transform: scale(1);
  985. }
  986. }
  987. .swiper-slide-active {
  988. img {
  989. animation: fadeIn 0.8s ease-out forwards;
  990. }
  991. }
  992. // 优化产品卡片动画和交互
  993. .swiper-slide {
  994. a {
  995. text-decoration: none;
  996. display: block;
  997. height: 100%;
  998. &:hover {
  999. text-decoration: none;
  1000. }
  1001. > div {
  1002. position: relative;
  1003. z-index: 1;
  1004. cursor: pointer;
  1005. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  1006. &:hover {
  1007. transform: translateY(-2px);
  1008. box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  1009. }
  1010. }
  1011. }
  1012. }
  1013. // 移除卡片抖动动画
  1014. @keyframes cardHover {
  1015. 0% {
  1016. transform: translateY(0);
  1017. }
  1018. 100% {
  1019. transform: translateY(-2px);
  1020. }
  1021. }
  1022. </style>