index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view class="page">
  3. <!-- Hero area -->
  4. <view class="hero">
  5. <text class="hero-icon">✦</text>
  6. <text class="price">¥398</text>
  7. <text class="per">/年</text>
  8. <text class="desc">每天仅 ¥1.09,让数字能量成为你的生产力</text>
  9. </view>
  10. <!-- Benefits -->
  11. <view class="card">
  12. <view class="benefit" v-for="item in benefits" :key="item">
  13. <text class="check-icon">◆</text>
  14. <text>{{ item }}</text>
  15. </view>
  16. </view>
  17. <!-- Compare table -->
  18. <view class="compare-card">
  19. <view class="compare-header">
  20. <text class="col">功能</text>
  21. <text class="col">普通用户</text>
  22. <text class="col pro">能量师</text>
  23. </view>
  24. <view class="compare-row" v-for="row in compareData" :key="row.label">
  25. <text class="col">{{ row.label }}</text>
  26. <text class="col free">{{ row.free }}</text>
  27. <text class="col pro">{{ row.pro }}</text>
  28. </view>
  29. </view>
  30. <!-- Pay button -->
  31. <button class="pay-btn" @click="onPay" :disabled="paying">
  32. {{ paying ? '处理中...' : '立即开通 · 能量师 ¥398/年' }}
  33. </button>
  34. <text class="note">支付即表示同意《订阅协议》</text>
  35. </view>
  36. </template>
  37. <script setup>
  38. import { ref } from 'vue'
  39. import { payApi } from '@/utils/api'
  40. const paying = ref(false)
  41. const benefits = [
  42. '无限命盘生成,不限次数',
  43. 'AI 五区完整解读,随问随答',
  44. '无限分享 & PDF 导出',
  45. '全部历史记录',
  46. '推广赚佣金,¥119.4/人'
  47. ]
  48. const compareData = [
  49. { label: '命盘生成', free: '3次/天', pro: '不限' },
  50. { label: 'AI 解读', free: '3轮/天', pro: '无限次' },
  51. { label: '分享', free: '1次/天', pro: '不限' },
  52. { label: '推广佣金', free: '--', pro: '最高¥159.2/人' },
  53. ]
  54. async function onPay() {
  55. paying.value = true
  56. try {
  57. const res = await payApi.create({ totalFee: 39800, payType: 'wxpay' })
  58. uni.showToast({ title: '开通成功!', icon: 'success' })
  59. setTimeout(() => uni.navigateBack(), 1500)
  60. } catch (e) {
  61. uni.showToast({ title: '支付失败,请重试', icon: 'none' })
  62. }
  63. paying.value = false
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .page {
  68. padding: 20px;
  69. min-height: 100vh;
  70. background: linear-gradient(180deg, #0c0a1a 0%, #120d28 60%, #0f0c1e 100%);
  71. }
  72. .hero {
  73. background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(217, 119, 6, 0.06));
  74. border: 1px solid rgba(251, 191, 36, 0.12);
  75. border-radius: 18px;
  76. padding: 36px 20px;
  77. text-align: center;
  78. color: #fff;
  79. margin-bottom: 16px;
  80. }
  81. .hero-icon {
  82. display: block;
  83. font-size: 20px;
  84. color: #fbbf24;
  85. margin-bottom: 12px;
  86. opacity: 0.6;
  87. }
  88. .price {
  89. font-size: 48px;
  90. font-weight: 700;
  91. color: #fbbf24;
  92. text-shadow: 0 0 30px rgba(251, 191, 36, 0.2);
  93. }
  94. .per {
  95. font-size: 16px;
  96. color: rgba(255, 255, 255, 0.5);
  97. margin-left: 4px;
  98. }
  99. .desc {
  100. display: block;
  101. font-size: 13px;
  102. color: rgba(255, 255, 255, 0.4);
  103. margin-top: 14px;
  104. letter-spacing: 1px;
  105. }
  106. .card {
  107. background: rgba(255, 255, 255, 0.03);
  108. border: 1px solid rgba(255, 255, 255, 0.06);
  109. border-radius: 14px;
  110. padding: 20px;
  111. margin-bottom: 16px;
  112. }
  113. .benefit {
  114. padding: 8px 0;
  115. font-size: 14px;
  116. color: rgba(255, 255, 255, 0.7);
  117. display: flex;
  118. align-items: center;
  119. }
  120. .check-icon {
  121. color: #fbbf24;
  122. margin-right: 12px;
  123. font-size: 10px;
  124. opacity: 0.6;
  125. }
  126. .compare-card {
  127. background: rgba(255, 255, 255, 0.03);
  128. border: 1px solid rgba(255, 255, 255, 0.06);
  129. border-radius: 14px;
  130. overflow: hidden;
  131. margin-bottom: 20px;
  132. }
  133. .compare-header,
  134. .compare-row {
  135. display: flex;
  136. padding: 14px 16px;
  137. font-size: 13px;
  138. }
  139. .compare-header {
  140. background: rgba(251, 191, 36, 0.06);
  141. font-weight: 600;
  142. color: rgba(255, 255, 255, 0.7);
  143. }
  144. .compare-row {
  145. border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  146. }
  147. .compare-row:last-child {
  148. border-bottom: none;
  149. }
  150. .col {
  151. flex: 1;
  152. text-align: center;
  153. color: rgba(255, 255, 255, 0.5);
  154. }
  155. .col:first-child {
  156. text-align: left;
  157. flex: 1.5;
  158. color: rgba(255, 255, 255, 0.7);
  159. }
  160. .free {
  161. color: rgba(255, 255, 255, 0.3);
  162. }
  163. .pro {
  164. color: #fbbf24;
  165. }
  166. .pay-btn {
  167. width: 100%;
  168. padding: 16px;
  169. background: linear-gradient(135deg, #f59e0b, #d97706);
  170. color: #fff;
  171. border: none;
  172. border-radius: 14px;
  173. font-size: 17px;
  174. font-weight: 600;
  175. letter-spacing: 2px;
  176. margin-bottom: 8px;
  177. }
  178. .pay-btn[disabled] {
  179. opacity: 0.4;
  180. }
  181. .note {
  182. display: block;
  183. text-align: center;
  184. font-size: 12px;
  185. color: rgba(255, 255, 255, 0.25);
  186. }
  187. </style>