index.vue 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="page-payment">
  3. <view class="plan-card">
  4. <view class="plan-header">
  5. <text class="plan-name">VIP 会员</text>
  6. <text class="plan-price">¥398</text>
  7. <text class="plan-period">/ 年</text>
  8. </view>
  9. <view class="plan-features">
  10. <text class="feature">✓ 无限次数字能量分析</text>
  11. <text class="feature">✓ AI 深度解读报告</text>
  12. <text class="feature">✓ 号码标注与标签管理</text>
  13. <text class="feature">✓ 历史记录永久保存</text>
  14. <text class="feature">✓ 推广赚取佣金</text>
  15. </view>
  16. </view>
  17. <view class="order-summary">
  18. <text class="summary-title">订单摘要</text>
  19. <view class="summary-row">
  20. <text>VIP 会员年费</text>
  21. <text>¥398</text>
  22. </view>
  23. <view class="summary-row total">
  24. <text>合计</text>
  25. <text>¥398</text>
  26. </view>
  27. </view>
  28. <button class="pay-btn" @click="handlePay" :disabled="paying">
  29. {{ paying ? '支付中...' : '立即支付 ¥398' }}
  30. </button>
  31. </view>
  32. </template>
  33. <script setup lang="ts">
  34. import { ref } from 'vue'
  35. import { payApi } from '@/utils/api'
  36. const paying = ref(false)
  37. async function handlePay() {
  38. paying.value = true
  39. try {
  40. // Placeholder - integrates with WeChat Pay
  41. const order: any = await payApi.create({ totalFee: 39800, payType: 'wxpay' })
  42. uni.showToast({
  43. title: '支付成功!',
  44. icon: 'success',
  45. success: () => {
  46. setTimeout(() => uni.navigateBack(), 1500)
  47. }
  48. })
  49. } catch (e) {
  50. uni.showToast({ title: '支付失败', icon: 'none' })
  51. } finally {
  52. paying.value = false
  53. }
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .page-payment { padding: 16px; }
  58. .plan-card {
  59. background: #fff; border-radius: 16px; padding: 24px;
  60. text-align: center; margin-bottom: 16px;
  61. }
  62. .plan-header { margin-bottom: 20px; }
  63. .plan-name { font-size: 20px; font-weight: 700; color: #1F2937; display: block; }
  64. .plan-price {
  65. font-size: 36px; font-weight: 800; color: #3B82F6; display: inline; margin-top: 8px;
  66. }
  67. .plan-period { font-size: 14px; color: #6B7280; }
  68. .plan-features { text-align: left; }
  69. .feature {
  70. display: block; padding: 6px 0; color: #4B5563; font-size: 14px;
  71. }
  72. .order-summary {
  73. background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 24px;
  74. }
  75. .summary-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; display: block; }
  76. .summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
  77. .summary-row.total { border-top: 1px solid #E5E7EB; margin-top: 8px; padding-top: 12px; font-weight: 700; }
  78. .pay-btn {
  79. width: 100%; height: 48px; background: #3B82F6; color: #fff;
  80. border: none; border-radius: 12px; font-size: 18px; line-height: 48px;
  81. }
  82. .pay-btn[disabled] { opacity: 0.6; }
  83. </style>