index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <route lang="json5">
  2. {
  3. style: {
  4. navigationBarTitleText: '确认订单',
  5. navigationBarBackgroundColor: '#fff',
  6. },
  7. }
  8. </route>
  9. <script setup lang="ts">
  10. import TiltedButton from '@/components/tilted-button.vue'
  11. import Product from '../components/product.vue'
  12. import { shoppingBag } from '@designer-hub/assets/src/assets/svgs/index'
  13. import InvertedTrapezoidButton from '@/components/inverted-trapezoid-button.vue'
  14. import TrapeziumButton from '@/components/trapezium-button.vue'
  15. import Card from '@/components/card.vue'
  16. import SectionHeading from '@/components/section-heading.vue'
  17. import BottomAppBar from '@/components/bottom-app-bar.vue'
  18. import { requestToast } from '../../../../core/utils/common'
  19. import { orderPay } from '../../../../core/libs/requests'
  20. import { useUserStore } from '../../../../store'
  21. import { storeToRefs } from 'pinia'
  22. import { useRouter } from '../../../../core/utils/router'
  23. const router = useRouter()
  24. const userStore = useUserStore()
  25. const { userInfo } = storeToRefs(userStore)
  26. const products = ref([{}, {}, {}])
  27. const show = ref(false)
  28. const a = ref(1)
  29. const data = ref()
  30. const handlePay = async () => {
  31. const { code } = await requestToast(
  32. () =>
  33. orderPay({
  34. ...data.value,
  35. }),
  36. { success: true, successTitle: '兑换成功' },
  37. )
  38. if (code === 0) {
  39. router.push('/pages/home/mall/purchased/success/index')
  40. }
  41. }
  42. onLoad(async (query: { data: string }) => {
  43. data.value = JSON.parse(query.data)
  44. })
  45. </script>
  46. <template>
  47. <view class="flex-grow flex flex-col px-3.5 py-5.5 gap-6">
  48. <Card>
  49. <div class="flex flex-col gap-6">
  50. <template v-for="(it, i) in data.list" :key="i">
  51. <div class="flex gap-3">
  52. <div class="w-16 h-16 bg-[#f6f6f6] rounded-lg">
  53. <wd-img width="100%" height="100%" :src="it.orderImgUrl"></wd-img>
  54. </div>
  55. <div class="flex flex-col justify-between flex-1">
  56. <div class="text-black/40 text-base font-normal font-['PingFang_SC'] leading-normal">
  57. {{ it.productName }}
  58. </div>
  59. <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal">
  60. {{ it.points }}积分
  61. </div>
  62. </div>
  63. <div>
  64. <div class="text-black/90 text-sm font-normal font-['PingFang_SC'] leading-[10.18px]">
  65. ×{{ it.nums }}
  66. </div>
  67. </div>
  68. </div>
  69. </template>
  70. </div>
  71. </Card>
  72. <Card>
  73. <div class="flex flex-col gap-8">
  74. <SectionHeading title="总积分" :end-text="data.totalsPoints" size="sm"></SectionHeading>
  75. <!-- <div @click="show = true">
  76. <SectionHeading title="优惠券" end-text="已选2张" end-arrow size="sm"></SectionHeading>
  77. </div> -->
  78. <SectionHeading
  79. title="实付积分"
  80. :end-text="data.totalsCurrPoints"
  81. size="sm"
  82. ></SectionHeading>
  83. </div>
  84. </Card>
  85. <BottomAppBar fixed placeholder>
  86. <div class="h-[63px] bg-white backdrop-blur-[20px] flex px-3.5 items-center justify-between">
  87. <div class="flex">
  88. <div class="text-[#ef4343] text-2xl font-normal font-['D-DIN Exp'] leading-normal">
  89. {{ data.totalsCurrPoints }}
  90. </div>
  91. <div class="text-black/40 text-base font-normal font-['PingFang_SC'] leading-[34px]">
  92. 积分
  93. </div>
  94. </div>
  95. <div class="">
  96. <TrapeziumButton size="large">
  97. <div
  98. class="w-[49px] h-[22px] text-white text-base font-normal font-['PingFang_SC'] leading-tight"
  99. >
  100. <div
  101. class="w-[65px] h-[22px] text-white text-base font-normal font-['PingFang_SC'] leading-tight"
  102. @click="handlePay"
  103. >
  104. 确认兑换
  105. </div>
  106. </div>
  107. </TrapeziumButton>
  108. </div>
  109. </div>
  110. </BottomAppBar>
  111. <wd-action-sheet title="优惠券" v-model="show">
  112. <view class="">
  113. <wd-tabs>
  114. <wd-tab title="可用优惠券"></wd-tab>
  115. <wd-tab title="不可用优惠券"></wd-tab>
  116. </wd-tabs>
  117. <div class="bg-[#f6f6f6] p-3.5">
  118. <div class="bg-white rounded-2xl p-3.5 flex gap-2.5">
  119. <div class="w-[94px] h-[94px] bg-[#f6f6f6] rounded-[10px]"></div>
  120. <div class="flex flex-col justify-around flex-1">
  121. <div class="text-black text-sm font-normal font-['PingFang_SC'] leading-normal">
  122. GELATO咖啡兑换券
  123. </div>
  124. <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal">
  125. 2024/04/01-2024/05/30
  126. </div>
  127. <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal">
  128. 使用说明
  129. </div>
  130. </div>
  131. <div class="flex items-center">
  132. <div class="w-4 h-4 rounded-full border border-black/60 border-solid"></div>
  133. </div>
  134. </div>
  135. </div>
  136. <!-- <wd-button block :round="false">确认</wd-button> -->
  137. </view>
  138. </wd-action-sheet>
  139. </view>
  140. </template>
  141. <style scoped lang="scss"></style>