PlansSection.vue 4.6 KB

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