当前位置: 代码迷 >> 综合 >> 微信小程序底部带tab导航判断用户是否注册,如果没有注册,跳转到注册页的方法
  详细解决方案

微信小程序底部带tab导航判断用户是否注册,如果没有注册,跳转到注册页的方法

热度:48   发布时间:2024-01-24 02:11:33.0

一、首页调用

if (this.globalData.user != null && this.globalData.user != "" && typeof this.globalData.user != 'undefined') {//用户已注册}else{  //用户未注册,则跳转到注册页面   wx.navigateTo({url: '/pages/userReg/userReg',})  return      }  

二、其他tab页调用

if (this.globalData.user != null && this.globalData.user != "" && typeof this.globalData.user != 'undefined') {//用户已注册} else {//用户未注册//1、先切换到首页这个tab页wx.switchTab({url: '/pages/index/index',})//2、跳转到用户注册页wx.navigateTo({url: '/pages/userReg/userReg',})return}

 

  相关解决方案