MultiCardLayout.vue 3.1 KB

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