1.navigateTo 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 wx.navigateBack 可以返回到原页面。小程序中页面栈最多十层。
2.redirectTo 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。
3. reLaunch
Close all pages open to a page within the application
4. switchTab
Jump to tabBar page, and close all other non-tabBar page
// A page implementation jump
jump: function () {
let a = 1;
let b = 2;
wx.navigateTo({
url: '/page/b/b?data1=' + a + '&data2=' + b
})
}
// page B receive parameters
the onLoad: function (Options) {
// At this time, the parameter A transmitted the page received by the options, A page name, if the transmission parameters are called parameters data1 and data2, so want to get the page B A page transmission take parameter parameter name corresponding to
the let DATAl = options.data1;
the let DATA2 = options.data2; the console.log (DATAl); // result is outputted. 1 the console.log (DATA2); // output is the result of 2 }