一、首页调用
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}