微信网站链接网站建设,wordpress使用cdn,网上支付网站怎摸做,sem扫描电子显微镜微信小程序页面跳转目前有以下方法#xff08;不全面的欢迎补充#xff09;#xff1a;
1. 利用小程序提供的 API 跳转#xff1a;
// 保留当前页面#xff0c;跳转到应用内的某个页面#xff0c;使用wx.navigateBack可以返回到原页面。
// 注意#xff1a;调用 navig…微信小程序页面跳转目前有以下方法不全面的欢迎补充
1. 利用小程序提供的 API 跳转
// 保留当前页面跳转到应用内的某个页面使用wx.navigateBack可以返回到原页面。
// 注意调用 navigateTo 跳转时调用该方法的页面会被加入堆栈但是 redirectTo
wx.navigateTo({url: page/home/home?user_id111
})
// 关闭当前页面返回上一页面或多级页面。可通过 getCurrentPages() 获取当前的页面栈决定需要返回几层。wx.navigateTo({url: page/home/home?user_id111 // 页面 A
})
wx.navigateTo({url: page/detail/detail?product_id222 // 页面 B
})
// 跳转到页面 A
wx.navigateBack({delta: 2
})
// 关闭当前页面跳转到应用内的某个页面。
wx.redirectTo({url: page/home/home?user_id111
})
// 跳转到tabBar页面在app.json中注册过的tabBar页面同时关闭其他非tabBar页面。
wx.switchTab({url: page/index/index
})
// 关闭所有页面打开到应用内的某个页面。
wx.reLanch({url: page/home/home?user_id111
})
2. wxml 页面组件跳转可以通过设置open-type属性指明页面跳转方式
// navigator 组件默认的 open-type 为 navigate
navigator url/page/navigate/navigate?titlenavigate hover-classnavigator-hover跳转到新页面/navigator
// redirect 对应 API 中的 wx.redirect 方法
navigator url../../redirect/redirect/redirect?titleredirect open-typeredirect hover-classother-navigator-hover在当前页打开/navigator
// switchTab 对应 API 中的 wx.switchTab 方法
navigator url/page/index/index open-typeswitchTab hover-classother-navigator-hover切换 Tab/navigator
// reLanch 对应 API 中的 wx.reLanch 方法
navigator url../../redirect/redirect/redirect?titleredirect open-typeredirect hover-classother-navigator-hover关闭所有页面打开到应用内的某个页面/navigator
// navigateBack 对应 API 中的 wx.navigateBack 方法
navigator url/page/index/index open-typenavigateBack hover-classother-navigator-hover关闭当前页面返回上一级页面或多级页面/navigator