integralPopup.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <script setup lang="ts">
  2. import type { CouponExchangeVo } from '@/api/globals'
  3. const props = defineProps<{ couponId: string }>()
  4. const show = defineModel({ default: false })
  5. const couponInfo = ref<CouponExchangeVo>()
  6. async function getCouponInfo() {
  7. const res = await Apis.app.get_smqjh_system_app_api_coupon_exchangeinfo({ params: { couponId: props.couponId } })
  8. couponInfo.value = res.data
  9. }
  10. watch(show, () => {
  11. if (show.value) {
  12. getCouponInfo()
  13. }
  14. })
  15. </script>
  16. <template>
  17. <Zpopup v-model="show" bg="#fff">
  18. <view v-if="couponInfo" class="px24rpx py28rpx">
  19. <view class="text-center text-32rpx font-semibold">
  20. 积分兑换
  21. </view>
  22. <view class="mt20rpx flex items-center">
  23. <view class="jf-box mr16rpx flex-shrink-0 rounded-16rpx p20rpx">
  24. <view class="text-center text-48rpx text-#FF4D3A font-semibold">
  25. ¥ {{ couponInfo.discountMoney }}
  26. </view>
  27. <view class="my8rpx text-center">
  28. {{ couponInfo.promotionType === 1 ? `满${couponInfo.amountMoney}减${couponInfo.discountMoney}` : `立减${couponInfo.discountMoney}` }}
  29. </view>
  30. </view>
  31. <view class="ml20rpx">
  32. <view class="text-32rpx font-semibold">
  33. 兑换需{{ couponInfo.pointsMoney }}积分
  34. </view>
  35. <view class="text-#aaa">
  36. <view class="mt10rpx">
  37. 已兑换:{{ couponInfo.inventoryActual }}/{{ couponInfo.inventoryTotal }}
  38. </view>
  39. <view class="mt10rpx">
  40. 兑换期截至: {{ couponInfo.couponEndTime }}
  41. </view>
  42. <view class="mt10rpx">
  43. 使用有效期:兑换后{{ couponInfo.expirationDate }}天有效
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
  49. <view class="text-28rpx font-semibold">
  50. 使用规则:
  51. </view>
  52. <view class="text-#aaa">
  53. <view class="mt20rpx">
  54. ·订单满20元可用
  55. </view>
  56. <view class="mt20rpx">
  57. ·每单限用1张,不与其他优惠同享
  58. </view>
  59. <view class="mt20rpx">
  60. ·兑换成功后,不可再逆兑换成积分
  61. </view>
  62. </view>
  63. <view class="mt24rpx text-28rpx font-semibold">
  64. 适用油站:
  65. </view>
  66. <view class="text-#aaa">
  67. <view class="mt20rpx flex items-center">
  68. <wd-icon name="check-circle-filled" size="30rpx" color="#52C41A" class="mr10rpx" /> 全部合作油站
  69. </view>
  70. <view class="mt20rpx flex items-center">
  71. <wd-icon name="close-circle-filled" size="30rpx" color="#FF4A39" class="mr10rpx" /> 部分特殊油站不可用
  72. </view>
  73. </view>
  74. </view>
  75. <FixedLayout>
  76. <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
  77. <view class="box-border w-full flex items-center justify-end gap20rpx px24rpx">
  78. <wd-button type="info" @click="show = false">
  79. 取消
  80. </wd-button>
  81. <wd-button @click="useUserStore().handleExchange(couponInfo)">
  82. 确认兑换
  83. </wd-button>
  84. </view>
  85. </FixedLayout>
  86. </Zpopup>
  87. </template>
  88. <style scoped>
  89. .jf-box{
  90. background: linear-gradient( 180deg, #FFC2BC 0%, rgba(255,238,238,0.16) 57.27%, #FFEFEF 100%);
  91. }
  92. </style>