Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="loading-content">
  3. <u-loading mode="circle" color="#01243A" size="40"></u-loading>
  4. <view
  5. v-if="state.isGoHome >= 2"
  6. class="go-home"
  7. @click="goHome()">
  8. 返回首页
  9. </view>
  10. </view>
  11. </template>
  12. <script setup lang="ts">
  13. import { onMounted, reactive } from 'vue'
  14. import { onLoad, onShow } from '@dcloudio/uni-app'
  15. import { getUrlParameters, navTo } from '@/utils/utils'
  16. const routeMap = [
  17. {type: '1', route: '/pages/order/channel'},
  18. ]
  19. const state = reactive({
  20. isGoHome: 0
  21. })
  22. // 二维码地址参数
  23. interface urlParams {
  24. inType?: string; // 跳转类型 1: 渠道订单
  25. }
  26. // 测试地址: https://qtzl.etcjz.cn/zhywpt-issuer/to_mini.html?inType=1&testCode=66
  27. onLoad((option) => {
  28. console.log(option)
  29. // 如果有q,证明是扫描二维码进入的页面
  30. if (option.q) {
  31. let codeUrl = decodeURIComponent(option.q)
  32. let params: urlParams = getUrlParameters(codeUrl)
  33. console.log(params)
  34. if (params && params.inType) {
  35. let info = routeMap.find(item => item.type == params.inType)
  36. if (info && info.route) {
  37. navTo(info.route)
  38. uni.redirectTo({
  39. url: info.route
  40. })
  41. } else {
  42. goHome()
  43. }
  44. } else {
  45. goHome()
  46. }
  47. } else {
  48. goHome()
  49. }
  50. })
  51. onShow(() => {
  52. state.isGoHome += 1
  53. })
  54. const goHome = () => {
  55. console.log(111)
  56. navTo('/pages/index/index')
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .loading-content{
  61. // height: 800rpx;
  62. // display: flex;
  63. // flex-direction: column;
  64. // justify-content: center;
  65. // align-items: center;
  66. width: 100%;
  67. height: 100vh;
  68. background-color: #fff;
  69. display: flex;
  70. flex-direction: column;
  71. justify-content: center;
  72. align-items: center;
  73. z-index: 200;
  74. }
  75. .go-home{
  76. margin-top: 42rpx;
  77. width: 240rpx;
  78. text-algin: center;
  79. display: flex;
  80. align-items: center;
  81. justify-content: center;
  82. height: 88rpx;
  83. background: radial-gradient(at 0% 0%, #01243A 0%, #004576 100%);
  84. border-radius: 40rpx;
  85. font-size: 30rpx;
  86. font-weight: 400;
  87. color: #fff!important;
  88. line-height: 88rpx;
  89. }
  90. </style>