PlansSection.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <script setup>
  2. import { plans } from '~/utils/plans'
  3. </script>
  4. <template>
  5. <section class="plans-section">
  6. <div class="plans-cards">
  7. <div v-for="(plan, index) in plans" :key="index" class="plan-card">
  8. <div class="plan-name">{{ plan.name }}</div>
  9. <div class="plan-desc">{{ plan.desc }}</div>
  10. <div class="old-price">
  11. <del>{{ plan.oldPrice }}</del>
  12. <span>{{ plan.save }}</span>
  13. </div>
  14. <div class="plan-price">{{ plan.price }}</div>
  15. <div class="plan-actions">
  16. <button class="btn-primary" :class="plan.buttonClass">立即选择</button>
  17. </div>
  18. <div class="plan-title">
  19. <div class="plan-cs">详细参数</div>
  20. <ul class="plan-features">
  21. <li v-for="(feature, fIndex) in plan.features" :key="fIndex">{{ feature }}</li>
  22. </ul>
  23. </div>
  24. </div>
  25. </div>
  26. </section>
  27. </template>
  28. <style scoped lang="scss">
  29. .plans-section {
  30. width: 100%;
  31. max-width: 1200px;
  32. margin: 0 auto 0;
  33. position: relative;
  34. box-sizing: border-box;
  35. display: flex;
  36. flex-direction: column;
  37. gap: 40px;
  38. z-index: 1;
  39. .plans-cards {
  40. display: grid;
  41. grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  42. gap: 24px;
  43. }
  44. .plan-card {
  45. border-radius: 20px;
  46. background: rgba(255, 255, 255, 0.08);
  47. padding: 45px 24px;
  48. box-sizing: border-box;
  49. display: flex;
  50. flex-direction: column;
  51. height: 608px;
  52. transition: transform .3s ease;
  53. &:hover {
  54. border: 2px solid rgba(178, 161, 255, 0.80);
  55. background: linear-gradient(180deg, rgba(146, 116, 254, 0.20) 0%, rgba(125, 70, 255, 0.20) 100%);
  56. transform: translateY(-5px);
  57. .plan-actions .btn-primary {
  58. background: linear-gradient(91deg, #A39DFF 1.24%, #7D46FF 122.93%);
  59. }
  60. }
  61. .plan-name {
  62. text-align: center;
  63. font-size: 36px;
  64. font-weight: 700;
  65. line-height: 26px;
  66. color: #ffffff;
  67. }
  68. .plan-desc {
  69. margin-top: 40px;
  70. text-align: center;
  71. font-size: 20px;
  72. font-weight: 400;
  73. line-height: 20px;
  74. color: #e0d3ff;
  75. }
  76. .old-price {
  77. margin-top: 20px;
  78. display: flex;
  79. justify-content: center;
  80. align-items: center;
  81. gap: 12px;
  82. del {
  83. color: #A39DFF;
  84. font-size: 20px;
  85. font-style: normal;
  86. font-weight: 500;
  87. line-height: 20px;
  88. }
  89. span {
  90. display: flex;
  91. border-radius: 17.5px;
  92. background: #7D46FF;
  93. color: #fff;
  94. width: 145px;
  95. height: 35px;
  96. justify-content: center;
  97. align-items: center;
  98. gap: 10px;
  99. }
  100. }
  101. .plan-price {
  102. padding: 42px;
  103. text-align: center;
  104. font-size: 65px;
  105. font-weight: 700;
  106. line-height: 65px;
  107. color: #ffffff;
  108. margin: 8px 0;
  109. }
  110. .plan-actions {
  111. display: flex;
  112. gap: 12px;
  113. align-items: center;
  114. .btn-primary {
  115. flex: 1;
  116. height: 64px;
  117. border-radius: 50px;
  118. background: linear-gradient(91deg, rgba(163, 157, 255, 0.20) 1.24%, rgba(125, 70, 255, 0.20) 122.93%);
  119. border: none;
  120. color: #fff;
  121. font-size: 24px;
  122. cursor: pointer;
  123. transition: opacity 0.3s ease;
  124. &:hover {
  125. opacity: 0.85;
  126. }
  127. }
  128. }
  129. .plan-title {
  130. .plan-cs {
  131. margin: 22px 0;
  132. color: #fff;
  133. font-size: 20px;
  134. font-style: normal;
  135. font-weight: 600;
  136. line-height: 20px;
  137. }
  138. .plan-features {
  139. margin: 0;
  140. padding: 0;
  141. display: grid;
  142. grid-template-columns: repeat(2, 1fr);
  143. gap: 15px;
  144. li {
  145. position: relative;
  146. padding-left: 20px;
  147. font-size: 14px;
  148. font-weight: 400;
  149. line-height: 20px;
  150. color: rgba(255, 255, 255, 0.6);
  151. &::before {
  152. content: "";
  153. position: absolute;
  154. left: 0;
  155. top: 50%;
  156. transform: translateY(-50%);
  157. width: 16px;
  158. height: 16px;
  159. border-radius: 50%;
  160. background-color: #a39dff;
  161. display: flex;
  162. align-items: center;
  163. justify-content: center;
  164. }
  165. &::after {
  166. content: "✓";
  167. position: absolute;
  168. left: 4px;
  169. top: 50%;
  170. transform: translateY(-50%);
  171. color: #fff;
  172. font-size: 10px;
  173. font-weight: bold;
  174. text-align: center;
  175. }
  176. }
  177. }
  178. }
  179. }
  180. }
  181. </style>