a.wxml
<button type="primary" bindtap="navigateTo">navigateTo</button>//导航跳转
<button type="primary" bindtap="redirecTo">redirecTo</button>//重定向跳转
<button type="primary" bindtap="switchTabTo">switchTabTo</button>//底部导航跳转
a.ts
//导航跳转
navigateTo:function(){
wx.navigateTo({
url:'../bb/bb?title=helloworld',
success:function(res){
console.log(res)
},
fail:function(){},
complete:function(){ }
})
},
//重定向跳转
redirecTo:function(){
wx.redirectTo({
url:'../bb/bb?title=helloworld',
success:function(res){
console.log(res)
},
fail:function(){},
complete:function(){}
})
},
//底部导航跳转
switchTabTo:function(){
wx.switchTab({
url:'../cc/cc',
success:function(res){
console.log(res)
},
fail:function(){
},
complete:function(){
}
})
},