useRouter.vue 706 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <view class="pages">
  3. </view>
  4. </template>
  5. <script>
  6. export default {
  7. data() {
  8. return {
  9. params:{
  10. token:'',
  11. }
  12. }
  13. },
  14. onShow() {
  15. let self = this;
  16. uni.getStorage({
  17. key : 'userInfo',
  18. success:function(res){
  19. console.log('userInfo customerType',res.data.customerType);
  20. if(res.data.customerType =='1'){
  21. console.log('个人用户');
  22. self.$api.href('/pages/building/building')
  23. // self.$api.href('/pages/mall/mall');
  24. }else{
  25. self.$api.href('/pages/use/use')
  26. };
  27. }
  28. });
  29. },
  30. onLoad(option) {
  31. console.log('this',this)
  32. },
  33. methods: {
  34. }
  35. }
  36. </script>
  37. <style >
  38. /* @import url("./index.css"); */
  39. </style>