Applet - Jump

wx.switchTab () tabBar jump to the page, and close all other non-tabBar page

wx.reLaunch () Close all pages within the application to open a page

wx.redirectTo () Close the current page, jump to a page within the application. But you can not jump to the page tabBar

Several methods corresponding to replace (), the function does not return

wx.navigateTo () to retain the current page, jump to a page within the application. TabBar but can not jump to the page. Use wx.navigateBack () can return to the original page. Applet page stack up to ten layers

After the top left corner of the page jump to return the small arrow, need to return when using wx.navigateTo ()

Parameter passing:
1, the general jump in this way, directly behind? Splicing mass participation, after the jump page onLoad lifecycle options is received parameters

2, in the label by data- pass over parameters in this way:
<view bindtap="toReservation" data-servicetype="1" data-shopid="{{shopId}}" data-title="洗澡套餐">
 
In the event function using the event object to acquire e:
toReservation (e) {
const servicetype = e.currentTarget.dataset.servicetype || 1;
const title = e.currentTarget.dataset.title || '';
const shopId = e.currentTarget.dataset.shopid || '';
}


wx.navigateBack () Closes the current page, return to the previous page or multilevel page. Can get the current page stack by getCurrentPages, decisions need to return several layers
 

 

 

 
 
 
 

Guess you like

Origin www.cnblogs.com/wuqilang/p/12076037.html