|
| 1 | +<template> |
| 2 | + <div class="pricing-container"> |
| 3 | + <h1 class="pricing-title">选择适合您的版本</h1> |
| 4 | + <div class="pricing-cards"> |
| 5 | + <!-- 开源版 --> |
| 6 | + <div class="pricing-card"> |
| 7 | + <div class="card-content"> |
| 8 | + <div class="card-header"> |
| 9 | + <h2>{{ plans.openSource.title }}</h2> |
| 10 | + <p class="card-description">{{ plans.openSource.description }}</p> |
| 11 | + </div> |
| 12 | + <div class="price-section"> |
| 13 | + <div class="current-price">{{ plans.openSource.price.current }}</div> |
| 14 | + <div v-if="plans.openSource.price.original" class="original-price"> |
| 15 | + <del>{{ plans.openSource.price.original }}</del> |
| 16 | + </div> |
| 17 | + </div> |
| 18 | + <ul class="features-list"> |
| 19 | + <li v-for="(feature, index) in plans.openSource.features" :key="index"> |
| 20 | + <span class="feature-icon">✓</span> |
| 21 | + {{ feature }} |
| 22 | + </li> |
| 23 | + </ul> |
| 24 | + </div> |
| 25 | + <button class="cta-button">立即使用</button> |
| 26 | + </div> |
| 27 | + |
| 28 | + <!-- 专业版 --> |
| 29 | + <div class="pricing-card highlighted"> |
| 30 | + <div class="popular-tag">最受欢迎</div> |
| 31 | + <div class="card-content"> |
| 32 | + <div class="card-header"> |
| 33 | + <h2>{{ plans.professional.title }}</h2> |
| 34 | + <p class="card-description">{{ plans.professional.description }}</p> |
| 35 | + </div> |
| 36 | + <div class="price-section"> |
| 37 | + <div class="current-price">{{ plans.professional.price.current }} <span class="billing-cycle">/ 年</span></div> |
| 38 | + <div v-if="plans.professional.price.original" class="original-price"> |
| 39 | + <del>{{ plans.professional.price.original }}</del> |
| 40 | + </div> |
| 41 | + </div> |
| 42 | + <ul class="features-list"> |
| 43 | + <li v-for="(feature, index) in plans.professional.features" :key="index"> |
| 44 | + <span class="feature-icon">✓</span> |
| 45 | + {{ feature }} |
| 46 | + </li> |
| 47 | + </ul> |
| 48 | + </div> |
| 49 | + <button class="cta-button primary" @click="goSponsor">立即购买</button> |
| 50 | + </div> |
| 51 | + |
| 52 | + <!-- 企业版 --> |
| 53 | + <div class="pricing-card"> |
| 54 | + <div class="card-content"> |
| 55 | + <div class="card-header"> |
| 56 | + <h2>{{ plans.enterprise.title }}</h2> |
| 57 | + <p class="card-description">{{ plans.enterprise.description }}</p> |
| 58 | + </div> |
| 59 | + <div class="price-section"> |
| 60 | + <div class="current-price">{{ plans.enterprise.price.current }} <span class="billing-cycle">/ 年</span></div> |
| 61 | + <div v-if="plans.enterprise.price.original" class="original-price"> |
| 62 | + <del>{{ plans.enterprise.price.original }}</del> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + <ul class="features-list"> |
| 66 | + <li v-for="(feature, index) in plans.enterprise.features" :key="index"> |
| 67 | + <span class="feature-icon">✓</span> |
| 68 | + {{ feature }} |
| 69 | + </li> |
| 70 | + </ul> |
| 71 | + </div> |
| 72 | + <button class="cta-button" @click="goSponsor">立即购买</button> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + </div> |
| 76 | +</template> |
| 77 | + |
| 78 | +<script setup> |
| 79 | +import { plans } from "../data/price"; |
| 80 | +import { openSponsorLink, sponsorUrl } from "../data/sponsors"; |
| 81 | +
|
| 82 | +const goSponsor = () => { |
| 83 | + openSponsorLink(sponsorUrl + '#有偿赞助') |
| 84 | +} |
| 85 | +</script> |
| 86 | + |
| 87 | +<style scoped> |
| 88 | +.pricing-container { |
| 89 | + max-width: 1200px; |
| 90 | + margin: 0 auto; |
| 91 | + padding: 2rem 0; |
| 92 | + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; |
| 93 | +} |
| 94 | +
|
| 95 | +.pricing-title { |
| 96 | + text-align: center; |
| 97 | + margin-bottom: 3rem; |
| 98 | +} |
| 99 | +
|
| 100 | +.pricing-cards { |
| 101 | + display: grid; |
| 102 | + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); |
| 103 | + gap: 2rem; |
| 104 | +} |
| 105 | +
|
| 106 | +.pricing-card { |
| 107 | + position: relative; |
| 108 | + border: 1px solid var(--vp-c-border); |
| 109 | + border-radius: 8px; |
| 110 | + padding: 2rem; |
| 111 | + display: flex; |
| 112 | + flex-direction: column; |
| 113 | + height: 100%; |
| 114 | +} |
| 115 | +
|
| 116 | +.pricing-card.highlighted { |
| 117 | + border: 2px solid var(--vp-c-brand-1); |
| 118 | +} |
| 119 | +
|
| 120 | +.popular-tag { |
| 121 | + position: absolute; |
| 122 | + top: -18px; |
| 123 | + right: 20px; |
| 124 | + background-color: var(--vp-c-brand-1); |
| 125 | + color: white; |
| 126 | + padding: 0.25rem 1rem; |
| 127 | + border-radius: 20px; |
| 128 | + font-size: 0.8rem; |
| 129 | + font-weight: bold; |
| 130 | +} |
| 131 | +
|
| 132 | +.card-content { |
| 133 | + flex: 1; |
| 134 | +} |
| 135 | +
|
| 136 | +.card-header { |
| 137 | + margin-bottom: 1.5rem; |
| 138 | + text-align: center; |
| 139 | +} |
| 140 | +
|
| 141 | +.card-header h2 { |
| 142 | + font-size: 1.5rem; |
| 143 | + margin-bottom: 0.5rem; |
| 144 | +} |
| 145 | +
|
| 146 | +.card-description { |
| 147 | + font-size: 0.9rem; |
| 148 | + color: var(--vp-c-text-2); |
| 149 | +} |
| 150 | +
|
| 151 | +.price-section { |
| 152 | + text-align: center; |
| 153 | + margin-bottom: 1.5rem; |
| 154 | +} |
| 155 | +
|
| 156 | +.current-price { |
| 157 | + font-size: 2rem; |
| 158 | + font-weight: bold; |
| 159 | + color: var(--vp-c-brand-1); |
| 160 | + margin-bottom: 0.25rem; |
| 161 | +} |
| 162 | +
|
| 163 | +.billing-cycle { |
| 164 | + font-size: 1rem; |
| 165 | + color: var(--vp-c-text-3); |
| 166 | +} |
| 167 | +
|
| 168 | +.original-price { |
| 169 | + color: var(--vp-c-text-3); |
| 170 | + font-size: 1rem; |
| 171 | +} |
| 172 | +
|
| 173 | +.features-list { |
| 174 | + list-style: none; |
| 175 | + padding: 0; |
| 176 | + margin-bottom: 1.5rem; |
| 177 | +} |
| 178 | +
|
| 179 | +.features-list li { |
| 180 | + padding: 0.5rem 0; |
| 181 | + display: flex; |
| 182 | + align-items: center; |
| 183 | +} |
| 184 | +
|
| 185 | +.feature-icon { |
| 186 | + color: var(--vp-c-brand-1); |
| 187 | + margin-right: 0.5rem; |
| 188 | + font-weight: bold; |
| 189 | +} |
| 190 | +
|
| 191 | +.cta-button { |
| 192 | + width: 100%; |
| 193 | + padding: 0.75rem; |
| 194 | + border: 2px solid var(--vp-c-brand-1); |
| 195 | + border-radius: 5px; |
| 196 | + font-weight: bold; |
| 197 | + cursor: pointer; |
| 198 | + transition: all 0.2s ease; |
| 199 | +} |
| 200 | +
|
| 201 | +.cta-button:hover { |
| 202 | + background-color: var(--vp-c-brand-1); |
| 203 | + color: white; |
| 204 | +} |
| 205 | +
|
| 206 | +.cta-button.primary { |
| 207 | + background-color: var(--vp-c-brand-1); |
| 208 | + color: white; |
| 209 | +} |
| 210 | +</style> |
0 commit comments