MultiCardLayout.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <section class="product-cards multi-layout">
  3. <div v-for="(card, index) in cards" :key="index" class="product-card-wrapper">
  4. <div class="product-card">
  5. <h3 class="card-title">{{ card.title }}</h3>
  6. <p class="card-description">{{ card.description }}</p>
  7. <div class="card-features">
  8. <span v-for="(feature, idx) in card.features" :key="idx" class="feature-tag">{{ feature }}</span>
  9. </div>
  10. <div class="card-actions">
  11. <button class="btn-primary">更多详情</button>
  12. <button class="btn-secondary">0元体验</button>
  13. </div>
  14. </div>
  15. <div v-if="index < cards.length - 1" class="divider"></div>
  16. </div>
  17. </section>
  18. </template>
  19. <script setup>
  20. defineProps({
  21. cards: {
  22. type: Array,
  23. required: true
  24. }
  25. })
  26. </script>
  27. <style scoped lang="scss">
  28. .multi-layout {
  29. max-width: 1200px;
  30. min-height: 474px;
  31. display: flex;
  32. align-items: center;
  33. justify-content: center;
  34. }
  35. .product-card-wrapper {
  36. display: flex;
  37. align-items: center;
  38. }
  39. .product-card {
  40. width: 266px;
  41. height: 336px;
  42. display: flex;
  43. flex-direction: column;
  44. justify-content: space-between;
  45. padding: 30px 0 35px 0;
  46. .card-title {
  47. font-family: 'Source Han Sans CN', sans-serif;
  48. font-size: 20px;
  49. font-weight: 500;
  50. line-height: 20px;
  51. color: #ffffff;
  52. margin: 0;
  53. text-align: center;
  54. }
  55. .card-description {
  56. width: 266px;
  57. font-family: 'Source Han Sans CN', sans-serif;
  58. font-size: 14px;
  59. font-weight: 400;
  60. line-height: 24px;
  61. color: #ffffff;
  62. margin: 0;
  63. text-align: left;
  64. word-wrap: break-word;
  65. }
  66. .card-features {
  67. width: 266px;
  68. display: flex;
  69. flex-direction: column;
  70. align-items: flex-start;
  71. .feature-tag {
  72. font-family: 'Source Han Sans CN', sans-serif;
  73. font-size: 14px;
  74. font-weight: 400;
  75. line-height: 14px;
  76. color: #9b71ff;
  77. margin-bottom: 12px;
  78. &:last-child {
  79. margin-bottom: 0;
  80. }
  81. }
  82. }
  83. .card-actions {
  84. width: 263px;
  85. display: flex;
  86. align-items: center;
  87. margin-top: 20px;
  88. .btn-primary {
  89. width: 120px;
  90. height: 40px;
  91. border-radius: 8px;
  92. background: linear-gradient(24.74deg, rgba(163, 157, 255, 1) 0%, rgba(125, 70, 255, 1) 100%);
  93. border: none;
  94. font-family: 'Source Han Sans CN', sans-serif;
  95. font-size: 14px;
  96. font-weight: 400;
  97. color: #ffffff;
  98. cursor: pointer;
  99. transition: opacity 0.3s ease;
  100. &:hover {
  101. opacity: 0.8;
  102. }
  103. }
  104. .btn-secondary {
  105. width: 120px;
  106. height: 40px;
  107. border-radius: 8px;
  108. border: 1px solid rgba(255, 255, 255, 0.5);
  109. background: rgba(255, 255, 255, 0.2);
  110. backdrop-filter: blur(15.2px);
  111. font-family: 'Source Han Sans CN', sans-serif;
  112. font-size: 14px;
  113. font-weight: 400;
  114. color: #ffffff;
  115. cursor: pointer;
  116. margin-left: 23px;
  117. transition: opacity 0.3s ease;
  118. &:hover {
  119. opacity: 0.8;
  120. }
  121. }
  122. }
  123. }
  124. .divider {
  125. width: 1px;
  126. height: 450px;
  127. background-color: rgba(255, 255, 255, 0.1);
  128. margin: 0 65.5px;
  129. }
  130. </style>