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