redirectPageMixin.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. module.exports = {
  2. data() {
  3. return {}
  4. },
  5. onLoad() {
  6. },
  7. methods: {
  8. /**
  9. * @param {Object} info
  10. * @description 页面跳转逻辑判断
  11. * @description state: 1:审核通过 2:待审核 3:未审核 4:审核驳回
  12. */
  13. $jumpPage(info){
  14. let url = '';
  15. // 跳转类型
  16. let type = 'navigateTo';
  17. const { is_has_green_house, state } = info;
  18. // 审核通过
  19. if(state == 1){
  20. // 直接跳转首页
  21. if(is_has_green_house == 1){
  22. url = '/pages/view/index/home';
  23. type = 'switchTab';
  24. }
  25. // 跳转至棚屋引导页
  26. if(is_has_green_house == 0){
  27. // 上次登录 已经确认暂不创建棚屋
  28. console.log(this.$getStorage('createRoomStatus'))
  29. if(this.$getStorage('createRoomStatus') && this.$getStorage('createRoomStatus') == 1){
  30. url = '/pages/view/index/home';
  31. type = 'switchTab';
  32. }
  33. // 直接跳转棚屋引导页
  34. else{
  35. url = '/pages/view/certification/passUser/passUser';
  36. type = 'redirectTo';
  37. }
  38. }
  39. }
  40. // 待审核状
  41. if(state == 2){
  42. url = '/pages/view/certification/ingUser/ingUser';
  43. type = 'redirectTo';
  44. }
  45. // 未审核
  46. if(state == 3){
  47. // 认证引导页面
  48. url = '/pages/view/certification/guideUser/guideUser';
  49. type = 'redirectTo';
  50. }
  51. // 审核驳回
  52. if(state == 4){
  53. url = '/pages/view/certification/unpassUser/unpassUser';
  54. type = 'redirectTo';
  55. }
  56. // 页面跳转
  57. if(url){
  58. this.$u.route({
  59. url: url,
  60. type: type
  61. })
  62. }
  63. },
  64. },
  65. }