MultiCardLayout.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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-size: 20px;
  48. font-weight: 500;
  49. line-height: 20px;
  50. color: #ffffff;
  51. margin: 0;
  52. text-align: center;
  53. }
  54. .card-description {
  55. width: 266px;
  56. color: rgba(255, 255, 255, 0.6);
  57. font-size: 14px;
  58. font-style: normal;
  59. font-weight: 400;
  60. line-height: 24px;
  61. }
  62. .card-features {
  63. width: 266px;
  64. display: flex;
  65. flex-direction: column;
  66. align-items: flex-start;
  67. .feature-tag {
  68. font-size: 14px;
  69. font-weight: 400;
  70. line-height: 14px;
  71. color: #9b71ff;
  72. margin-bottom: 12px;
  73. &:last-child {
  74. margin-bottom: 0;
  75. }
  76. }
  77. }
  78. .card-actions {
  79. width: 263px;
  80. display: flex;
  81. align-items: center;
  82. margin-top: 20px;
  83. .btn-primary {
  84. width: 120px;
  85. height: 40px;
  86. border-radius: 8px;
  87. background: linear-gradient(24.74deg, rgba(163, 157, 255, 1) 0%, rgba(125, 70, 255, 1) 100%);
  88. border: none;
  89. font-size: 14px;
  90. font-weight: 400;
  91. color: #ffffff;
  92. cursor: pointer;
  93. transition: opacity 0.3s ease;
  94. &:hover {
  95. opacity: 0.8;
  96. }
  97. }
  98. .btn-secondary {
  99. width: 120px;
  100. height: 40px;
  101. border-radius: 8px;
  102. border: 1px solid rgba(255, 255, 255, 0.5);
  103. background: rgba(255, 255, 255, 0.2);
  104. backdrop-filter: blur(15.2px);
  105. font-size: 14px;
  106. font-weight: 400;
  107. color: #ffffff;
  108. cursor: pointer;
  109. margin-left: 23px;
  110. transition: opacity 0.3s ease;
  111. &:hover {
  112. opacity: 0.8;
  113. }
  114. }
  115. }
  116. }
  117. .divider {
  118. width: 1px;
  119. height: 450px;
  120. background-color: rgba(255, 255, 255, 0.1);
  121. margin: 0 65.5px;
  122. }
  123. </style>