Hanye官网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <template>
  2. <div>
  3. <div class="w-full h-[55px] sm:h-[72px]"></div>
  4. <ErrorBoundary :error="error">
  5. <div v-if="isLoading" class="flex justify-center py-12">
  6. <!-- 加载中 -->
  7. <div
  8. class="animate-spin h-8 w-8 border-4 border-blue-500 rounded-full border-t-transparent"
  9. ></div>
  10. </div>
  11. <div v-else>
  12. <div class="w-full mb-12 relative">
  13. <div class="absolute top-0 left-0 w-full h-full z-10">
  14. <div
  15. class="max-w-screen-2xl mx-auto h-full flex flex-col justify-center gap-4 p-4"
  16. >
  17. <div
  18. class="justify-start text-white text-2xl font-normal md:text-4xl lg:text-6xl"
  19. >
  20. 製品一覧
  21. </div>
  22. <div
  23. class="text-white text-sm lg:text-lg font-normal leading-loose"
  24. >
  25. 卓越した製品は、実績に裏打ちされた優れた技術と、<br />継続的な革新デザインとの融合により、生み出されます。
  26. </div>
  27. </div>
  28. </div>
  29. <img
  30. :src="banner"
  31. alt="products-banner"
  32. class="w-full object-cover h-60 lg:h-full"
  33. />
  34. </div>
  35. <div class="max-w-full mb-6 xl:px-2 lg:px-2 md:px-4 px-4">
  36. <div class="max-w-screen-2xl mx-auto">
  37. <nuxt-link
  38. to="/"
  39. class="justify-start text-white/60 text-base font-normal"
  40. >ホーム</nuxt-link
  41. >
  42. <span class="text-white/60 text-base font-normal px-2"> / </span>
  43. <nuxt-link to="/products" class="text-white text-base font-normal"
  44. >製品一覧</nuxt-link
  45. >
  46. </div>
  47. </div>
  48. <div
  49. class="max-w-full mb-12 md:mb-20 lg:mb-32 xl:px-2 lg:px-2 md:px-4 px-4"
  50. >
  51. <div class="max-w-screen-2xl mx-auto">
  52. <div class="w-full grid grid-cols-1 md:grid-cols-10 gap-8 md:gap-2">
  53. <div
  54. class="col-span-1 md:col-span-2 flex flex-col gap-16 mb-8 md:mb-0"
  55. >
  56. <div class="flex flex-col gap-4">
  57. <div class="text-white text-3xl font-medium">
  58. 製品カテゴリー
  59. </div>
  60. <div class="flex flex-col gap-4">
  61. <div
  62. class="opacity-80 justify-start text-white text-base font-normal"
  63. >
  64. PCメモリ
  65. </div>
  66. <div
  67. class="opacity-80 justify-start text-white text-base font-normal"
  68. >
  69. PCメモリ
  70. </div>
  71. </div>
  72. </div>
  73. <div class="flex flex-col gap-4">
  74. <div class="text-white text-3xl font-medium">
  75. 製品カテゴリー
  76. </div>
  77. <div class="flex flex-col gap-4">
  78. <div
  79. class="opacity-80 justify-start text-white text-base font-normal"
  80. >
  81. PCメモリ
  82. </div>
  83. <div
  84. class="opacity-80 justify-start text-white text-base font-normal"
  85. >
  86. PCメモリ
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="col-span-1 md:col-span-8">
  92. <div class="flex flex-col gap-16">
  93. <div class="flex flex-col gap-4">
  94. <div class="w-full text-white text-4xl font-normal mb-4">
  95. 2.5-inch SSD
  96. </div>
  97. <div
  98. class="w-full grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4"
  99. >
  100. <div class="bg-zinc-900 rounded-lg">
  101. <div class="w-full p-8">
  102. <img
  103. src="https://placehold.co/400x400"
  104. alt=""
  105. class="w-full h-full object-cover rounded-lg mb-4"
  106. />
  107. <div
  108. class="text-center justify-start text-white text-xl font-normal"
  109. >
  110. Hanye Q60-256GST3
  111. </div>
  112. <div
  113. class="text-center justify-start text-stone-400 text-base font-normal leading-normal"
  114. >
  115. 256GB / 512GB / 1TB / 2TB
  116. </div>
  117. </div>
  118. </div>
  119. <div class="bg-zinc-900 rounded-lg"></div>
  120. <div class="bg-zinc-900 rounded-lg"></div>
  121. <div class="bg-zinc-900 rounded-lg"></div>
  122. </div>
  123. </div>
  124. <div class="flex flex-col gap-4">
  125. <div class="w-full text-white text-4xl font-normal mb-4">
  126. 2.5-inch SSD
  127. </div>
  128. <div
  129. class="w-full grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4"
  130. >
  131. <div class="bg-zinc-900 rounded-lg">
  132. <div class="w-full p-8">
  133. <img
  134. src="https://placehold.co/400x400"
  135. alt=""
  136. class="w-full h-full object-cover rounded-lg mb-4"
  137. />
  138. <div
  139. class="text-center justify-start text-white text-xl font-normal"
  140. >
  141. Hanye Q60-256GST3
  142. </div>
  143. <div
  144. class="text-center justify-start text-stone-400 text-base font-normal leading-normal"
  145. >
  146. 256GB / 512GB / 1TB / 2TB
  147. </div>
  148. </div>
  149. </div>
  150. <div class="bg-zinc-900 rounded-lg">
  151. <div class="w-full p-8">
  152. <img
  153. src="https://placehold.co/400x400"
  154. alt=""
  155. class="w-full h-full object-cover rounded-lg mb-4"
  156. />
  157. <div
  158. class="text-center justify-start text-white text-xl font-normal"
  159. >
  160. Hanye Q60-256GST3
  161. </div>
  162. <div
  163. class="text-center justify-start text-stone-400 text-base font-normal leading-normal"
  164. >
  165. 256GB / 512GB / 1TB / 2TB
  166. </div>
  167. </div>
  168. </div>
  169. <div class="bg-zinc-900 rounded-lg">
  170. <div class="w-full p-8">
  171. <img
  172. src="https://placehold.co/400x400"
  173. alt=""
  174. class="w-full h-full object-cover rounded-lg mb-4"
  175. />
  176. <div
  177. class="text-center justify-start text-white text-xl font-normal"
  178. >
  179. Hanye Q60-256GST3
  180. </div>
  181. <div
  182. class="text-center justify-start text-stone-400 text-base font-normal leading-normal"
  183. >
  184. 256GB / 512GB / 1TB / 2TB
  185. </div>
  186. </div>
  187. </div>
  188. <div class="bg-zinc-900 rounded-lg">
  189. <div class="w-full p-8">
  190. <img
  191. src="https://placehold.co/400x400"
  192. alt=""
  193. class="w-full h-full object-cover rounded-lg mb-4"
  194. />
  195. <div
  196. class="text-center justify-start text-white text-xl font-normal"
  197. >
  198. Hanye Q60-256GST3
  199. </div>
  200. <div
  201. class="text-center justify-start text-stone-400 text-base font-normal leading-normal"
  202. >
  203. 256GB / 512GB / 1TB / 2TB
  204. </div>
  205. </div>
  206. </div>
  207. </div>
  208. </div>
  209. </div>
  210. </div>
  211. </div>
  212. </div>
  213. </div>
  214. </div>
  215. </ErrorBoundary>
  216. </div>
  217. </template>
  218. <script setup lang="ts">
  219. /**
  220. * 产品列表页面
  221. * 展示所有产品
  222. */
  223. import { useErrorHandler } from "~/composables/useErrorHandler";
  224. import banner from "@/assets/images/product-banner.webp";
  225. // 产品接口定义
  226. interface Product {
  227. id: number;
  228. title: string;
  229. description: string;
  230. }
  231. const { error, isLoading, wrapAsync } = useErrorHandler();
  232. const products = ref<Product[]>([]);
  233. /**
  234. * 加载产品数据
  235. */
  236. async function loadProducts() {
  237. await wrapAsync(async () => {
  238. // 模拟API请求延迟
  239. await new Promise((resolve) => setTimeout(resolve, 500));
  240. // 模拟数据,实际项目中应从API获取
  241. products.value = [
  242. {
  243. id: 1,
  244. title: "产品一",
  245. description: "这是产品一的详细描述,介绍产品特点和用途。",
  246. },
  247. {
  248. id: 2,
  249. title: "产品二",
  250. description: "这是产品二的详细描述,介绍产品特点和用途。",
  251. },
  252. {
  253. id: 3,
  254. title: "产品三",
  255. description: "这是产品三的详细描述,介绍产品特点和用途。",
  256. },
  257. {
  258. id: 4,
  259. title: "产品四",
  260. description: "这是产品四的详细描述,介绍产品特点和用途。",
  261. },
  262. {
  263. id: 5,
  264. title: "产品五",
  265. description: "这是产品五的详细描述,介绍产品特点和用途。",
  266. },
  267. {
  268. id: 6,
  269. title: "产品六",
  270. description: "这是产品六的详细描述,介绍产品特点和用途。",
  271. },
  272. ];
  273. return products.value;
  274. });
  275. }
  276. // 页面加载时获取产品数据
  277. onMounted(() => {
  278. loadProducts();
  279. });
  280. // SEO优化
  281. useHead({
  282. title: "产品列表 - Hanye",
  283. meta: [
  284. {
  285. name: "description",
  286. content: "浏览我们的产品列表,找到适合您的解决方案。",
  287. },
  288. ],
  289. });
  290. </script>