redirect.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div class="app-content">
  3. <!-- <div class="prompt-text">加载中 . . .</div> -->
  4. </div>
  5. </template>
  6. <script>
  7. import { mapGetters, mapState, mapActions } from 'vuex'
  8. import { getWxQrCodeQuery } from '@/api/common'
  9. export default {
  10. data() {
  11. return {
  12. }
  13. },
  14. computed: {
  15. // ...mapGetters({ userInfo: 'getSelfInfo' })
  16. },
  17. onLoad(options) {
  18. uni.showLoading({
  19. title: '加载中...'
  20. })
  21. if (options.redirectUrl) {
  22. this.compatible()
  23. }
  24. // this._getWxQrCodeQuery(options.scene)
  25. },
  26. methods: {
  27. // _getWxQrCodeQuery(scene) {
  28. // getWxQrCodeQuery({ scene: scene }).then(res => {
  29. // uni.hideLoading()
  30. // if (res.data.url.indexOf('https://') > -1) {
  31. // const returnUrl = encodeURIComponent(res.data.url)
  32. // uni.navigateTo({
  33. // url: `/common/webview?returnUrl=${returnUrl}`
  34. // })
  35. // } else {
  36. // uni.redirectTo({
  37. // url: res.data.url
  38. // })
  39. // }
  40. // }).catch((e) => {
  41. // this.compatible()
  42. // })
  43. // },
  44. // 兼容,如果小程序码或者接口返回有误时进入登录页
  45. compatible() {
  46. uni.hideLoading()
  47. if (this.option.type == 'invite') {
  48. // #ifdef H5
  49. location.href = decodeURIComponent(this.option.redirectUrl)
  50. // #endif
  51. }
  52. // uni.redirectTo({
  53. // url: `/pages/page/login/index`
  54. // })
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .prompt-text {
  61. padding-top: 200px;
  62. text-align: center;
  63. }
  64. </style>