index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <route lang="json">
  2. {
  3. "style": {
  4. "navigationBarTitleText": "",
  5. "navigationBarBackgroundColor": "#fff"
  6. }
  7. }
  8. </route>
  9. <script setup lang="ts">
  10. import { success } from '../../../../../core/libs/svgs'
  11. import { useUserStore } from '../../../../../store'
  12. import { useRouter } from '../../../../../core/utils/router'
  13. const userStore = useUserStore()
  14. const router = useRouter()
  15. const handle2Orders = () => {
  16. router.replace('/pages-sub/mine/orders/index')
  17. }
  18. const handle2Mall = () => {
  19. const pages = getCurrentPages()
  20. const mallIndex = pages.findIndex((it) => it.route === 'pages/home/mall/index')
  21. if (mallIndex > -1) {
  22. console.log(pages.length - mallIndex - 1)
  23. router.back(pages.length - mallIndex - 1)
  24. } else {
  25. router.replace('/pages-sub/home/mall/index')
  26. }
  27. }
  28. onLoad(() => {})
  29. </script>
  30. <template>
  31. <div class="flex-grow flex flex-col px-3.5 justify-center items-center gap-7 bg-white">
  32. <wd-img width="60" height="60" :src="success" custom-class="mb-4.5"></wd-img>
  33. <div class="mb-10 text-black/90 text-xl font-normal font-['PingFang_SC'] leading-none">
  34. 兑换成功
  35. </div>
  36. <div class="w-full">
  37. <wd-button block :round="false" @click="handle2Orders">查看订单</wd-button>
  38. </div>
  39. <div class="w-full">
  40. <wd-button block :round="false" @click="handle2Mall">返回商城</wd-button>
  41. </div>
  42. </div>
  43. </template>