index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <script setup lang="ts">
  2. import router from '@/router'
  3. definePage({
  4. name: 'exchangeSuccess',
  5. islogin: true,
  6. style: {
  7. navigationBarTitleText: '支付',
  8. navigationStyle: 'custom',
  9. },
  10. })
  11. // 页面参数
  12. const couponId = ref('')
  13. const batchNo = ref('')
  14. const expireDays = ref('')
  15. const discountMoney = ref(0)
  16. const amountMoney = ref(0)
  17. const StaticUrl = import.meta.env.VITE_STATIC_BASE_URL
  18. onLoad((options: any) => {
  19. couponId.value = options.couponId || ''
  20. batchNo.value = options.batchNo || ''
  21. expireDays.value = options.expireDays || ''
  22. discountMoney.value = Number(options.discountMoney) || 0
  23. amountMoney.value = Number(options.amountMoney) || 0
  24. })
  25. // 查看抵扣券
  26. function handleViewVoucher() {
  27. router.pushTab({ name: 'voucher' })
  28. useTabbar().setTabbarItemActive('voucher')
  29. }
  30. // 立即使用
  31. function handleUseNow() {
  32. // TODO: 跳转到使用页面
  33. router.pushTab({ name: 'home' })
  34. useTabbar().setTabbarItemActive('home')
  35. }
  36. </script>
  37. <template>
  38. <view class="min-h-100vh bg-#f5f5f5">
  39. <!-- 成功图标 -->
  40. <view class="flex flex-col items-center pt60rpx">
  41. <view class="h80rpx w80rpx flex items-center justify-center rounded-full bg-#9ED605">
  42. <wd-icon name="check" size="48rpx" color="#fff" />
  43. </view>
  44. <view class="mt20rpx text-32rpx text-#9ED605 font-semibold">
  45. 兑换成功
  46. </view>
  47. </view>
  48. <!-- 抵扣券信息卡片 -->
  49. <view class="mx24rpx mt40rpx rounded-16rpx bg-white px28rpx py32rpx">
  50. <view class="flex items-center">
  51. <view class="mr10rpx h30rpx w30rpx">
  52. <image
  53. class="h-full w-full"
  54. :src="`${StaticUrl}/smqjh-reful-juan.png`"
  55. />
  56. </view>
  57. <view class="text-30rpx font-semibold">
  58. 抵扣{{ discountMoney }}元(满{{ amountMoney }}可用)
  59. </view>
  60. </view>
  61. <view class="mt16rpx text-26rpx text-#999">
  62. 优惠券已放入"我的抵扣券"
  63. </view>
  64. </view>
  65. <!-- 券详情卡片 -->
  66. <view class="mx24rpx mt24rpx rounded-16rpx bg-white px28rpx py32rpx">
  67. <view class="text-28rpx text-#333">
  68. 券ID:{{ couponId }}
  69. </view>
  70. <view class="mt20rpx text-28rpx text-#333">
  71. 批次号:{{ batchNo }}
  72. </view>
  73. <view class="mt20rpx text-28rpx text-#333">
  74. 有效期:{{ expireDays }}天
  75. </view>
  76. </view>
  77. <!-- 温馨提示卡片 -->
  78. <view class="mx24rpx mt24rpx rounded-16rpx bg-white px28rpx py32rpx">
  79. <view class="mb20rpx text-28rpx font-semibold">
  80. 温馨提示:
  81. </view>
  82. <view class="text-26rpx text-#666 leading-44rpx">
  83. <view>·每单限用1张优惠券</view>
  84. <view class="mt8rpx">
  85. ·系统会自动选择最优优惠
  86. </view>
  87. <view class="mt8rpx">
  88. ·不支持油站无法使用
  89. </view>
  90. </view>
  91. </view>
  92. <view class="mt28rpx flex items-center justify-between gap20rpx px124rpx">
  93. <wd-button
  94. plain block
  95. size="large"
  96. custom-class="flex-1 view-btn"
  97. @click="handleViewVoucher"
  98. >
  99. 查看抵扣券
  100. </wd-button>
  101. <wd-button
  102. block
  103. size="large"
  104. custom-class="flex-1"
  105. @click="handleUseNow"
  106. >
  107. 立即使用
  108. </wd-button>
  109. </view>
  110. <!-- 占位 -->
  111. <view class="h200rpx" />
  112. </view>
  113. </template>
  114. <style lang="scss" scoped>
  115. :deep(.view-btn) {
  116. border-color: var(--them-color) !important;
  117. color: var(--them-color) !important;
  118. }
  119. </style>