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.

usage.ts 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /**
  2. * 按用途产品展示接口
  3. * @returns 按用途分类的产品数据
  4. */
  5. export default defineEventHandler(async (event) => {
  6. // 获取查询参数中的语言设置
  7. const query = getQuery(event);
  8. const lang = query.lang || 'ja'; // 默认使用日语
  9. // 模拟数据
  10. const usageList = [
  11. {
  12. id: 1,
  13. name: lang === 'zh' ? '外接存储转换' : '外付けストレージ化',
  14. products: [
  15. {
  16. id: 1,
  17. title: 'Hanye Q60-2TST3',
  18. description: '2TB SSD UP TO 550MB/s',
  19. image: 'https://picsum.photos/300/300?random=1',
  20. link: '/products/1'
  21. },
  22. {
  23. id: 2,
  24. title: 'Hanye Q60-4TST3',
  25. description: '4TB SSD UP TO 550MB/s',
  26. image: 'https://picsum.photos/300/300?random=2',
  27. link: '/products/2'
  28. },
  29. {
  30. id: 3,
  31. title: 'Hanye Q60-8TST3',
  32. description: '8TB SSD UP TO 550MB/s',
  33. image: 'https://picsum.photos/300/300?random=3',
  34. link: '/products/3'
  35. },
  36. {
  37. id: 4,
  38. title: 'Hanye Q60-16TST3',
  39. description: '16TB SSD UP TO 550MB/s',
  40. image: 'https://picsum.photos/300/300?random=4',
  41. link: '/products/4'
  42. },
  43. {
  44. id: 5,
  45. title: 'Hanye Q60-32TST3',
  46. description: '32TB SSD UP TO 550MB/s',
  47. image: 'https://picsum.photos/300/300?random=5',
  48. link: '/products/5'
  49. }
  50. ]
  51. },
  52. {
  53. id: 2,
  54. name: lang === 'zh' ? 'PC加速' : 'PC高速化',
  55. products: [
  56. {
  57. id: 4,
  58. title: 'Hanye Q60-2TST3',
  59. description: '2TB SSD UP TO 550MB/s',
  60. image: 'https://picsum.photos/300/300?random=4',
  61. link: '/products/4'
  62. },
  63. {
  64. id: 5,
  65. title: 'Hanye Q60-4TST3',
  66. description: '4TB SSD UP TO 550MB/s',
  67. image: 'https://picsum.photos/300/300?random=5',
  68. link: '/products/5'
  69. },
  70. {
  71. id: 6,
  72. title: 'Hanye Q60-8TST3',
  73. description: '8TB SSD UP TO 550MB/s',
  74. image: 'https://picsum.photos/300/300?random=6',
  75. link: '/products/6'
  76. }
  77. ]
  78. },
  79. {
  80. id: 3,
  81. name: lang === 'zh' ? '数据备份' : 'データバックアップ',
  82. products: [
  83. {
  84. id: 7,
  85. title: 'Hanye Q60-2TST3',
  86. description: '2TB SSD UP TO 550MB/s',
  87. image: 'https://picsum.photos/300/300?random=7',
  88. link: '/products/7'
  89. },
  90. {
  91. id: 8,
  92. title: 'Hanye Q60-4TST3',
  93. description: '4TB SSD UP TO 550MB/s',
  94. image: 'https://picsum.photos/300/300?random=8',
  95. link: '/products/8'
  96. },
  97. {
  98. id: 9,
  99. title: 'Hanye Q60-8TST3',
  100. description: '8TB SSD UP TO 550MB/s',
  101. image: 'https://picsum.photos/300/300?random=9',
  102. link: '/products/9'
  103. }
  104. ]
  105. }
  106. ]
  107. return {
  108. code: 200,
  109. data: usageList,
  110. message: lang === 'zh' ? '获取按用途产品数据成功' : '用途別製品データの取得に成功しました'
  111. }
  112. })