SingleCardLayout.vue 2.6 KB

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