index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view class="contentindex">
  3. <view class="box-header">
  4. <view class="images">
  5. <image src="https://cdn.bjtdba.com/vod/image/2022-08-09/20220809134301741.gif" mode="widthFix"></image>
  6. </view>
  7. <view class="texts">
  8. 正在加载…
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import {
  15. selectMerchant
  16. } from '@/commit/api.js'
  17. import {
  18. encryptDes,
  19. decryptDes
  20. } from '@/encryption/index.js' // 引用路径根据自己的文件结构而定
  21. import
  22. Base64
  23. from 'base-64'
  24. export default {
  25. data() {
  26. return {
  27. }
  28. },
  29. onLoad() {
  30. console.log('进来了')
  31. let authorization = uni.getStorageSync('authorization')
  32. let userinfo = uni.getStorageSync('userinfo')
  33. let uid = userinfo.uid
  34. // 用户状态判断
  35. if (authorization) {
  36. selectMerchant({
  37. uid: uid
  38. }).then(data => {
  39. if (data.data.status == 200) {
  40. let selectmerchant = data.data.data
  41. uni.setStorageSync('selectmerchant', selectmerchant)
  42. if (authorization && uid) {
  43. if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
  44. uni.redirectTo({
  45. url: "/openmerchant/guide/index" //有或者没有商户 没有金额支付and激活码支付
  46. });
  47. return
  48. } else if (selectmerchant.merId > 0 && (selectmerchant.status == 1 || selectmerchant.status == 5)) {
  49. uni.switchTab({
  50. url: '/pages/cashier/index' //已开通商户
  51. });
  52. return
  53. } else if (selectmerchant.merId >= 0 && (selectmerchant.status == 3 || selectmerchant.status == 4)) {
  54. uni.redirectTo({
  55. url: '/openmerchant/shopentry/process?mer_id=' + selectmerchant.merId //已开通商户未填写资料
  56. });
  57. return
  58. } else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
  59. uni.redirectTo({
  60. url: '/openmerchant/shopentry/processaudit?submitCode=' + 3 //已开通商户待审核
  61. });
  62. return
  63. } else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
  64. uni.redirectTo({
  65. url: '/openmerchant/shopentry/processaudit?submitCode=' + 2 //已开通商户审核拒绝
  66. });
  67. return
  68. }
  69. } else {
  70. uni.redirectTo({
  71. url: "/pages/user/login/index"
  72. });
  73. }
  74. }
  75. }, fail => {
  76. uni.showToast({
  77. title: fail,
  78. icon: "none"
  79. })
  80. }).catch(err => {
  81. console.log(err)
  82. })
  83. } else {
  84. uni.redirectTo({
  85. url: "/pages/user/login/index"
  86. });
  87. }
  88. },
  89. methods: {}
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .contentindex {
  94. width: 100%;
  95. height: 100%;
  96. background: transparent;
  97. position: fixed;
  98. margin: auto;
  99. left: 0;
  100. right: 0;
  101. top: 0;
  102. bottom: 0;
  103. display: flex;
  104. justify-content: center;
  105. align-items: center;
  106. .box-header {
  107. text-align: center;
  108. line-height: 100rpx;
  109. display: flex;
  110. flex-direction: column;
  111. justify-content: space-between;
  112. align-items: center;
  113. .images {
  114. width: 128rpx;
  115. height: 128rpx;
  116. image {
  117. width: 100%;
  118. height: 100%;
  119. }
  120. }
  121. .texts {
  122. width: 150rpx;
  123. height: 42rpx;
  124. font-size: 30rpx;
  125. line-height: 42rpx;
  126. color: #333333;
  127. margin-top: 61rpx;
  128. }
  129. }
  130. }
  131. </style>