Jump navigateTo applets micro-channel () and RedirectTo () Usage between


Original link: HTTPS: //blog.csdn.net/u013128651/article/details/79736410
  wx.navigateTo ({}), to retain the current page, jump to a page within the application,

Use wx.navigateBack can return, sometimes we also need to carry parameter jumps

Jump to page Deposit Deposit folder

wx.navigateTo ({
URL: '? / Pages / Deposit / Deposit merchantId =' + this.data.coach.coachId,
})
value way

Parameters passed in the page receiving the onLoad () function used can be taken to a value option.type

/ **
* Life Cycle function - listen for page loads
* /
onLoad: function (Options) {
this.setData ({
"machantId": options.machantId,
"merchantRecordId": options.merchantRecordId
})
}

OBJECT parameters:

Parameter Type Description Default
number of pages returned delta Number 1, if delta is greater than the existing number of pages, the return to the home.
Sample code:

// Note: when calling navigateTo jumps, calls the method page will be added to the stack, and redirectTo method does not. See the code example below

// here A page
wx.navigateTo ({
URL: '? ID = B. 1'
})

// where B is the page
wx.navigateTo ({
URL: '? =. 1 ID C'
})

C // page in navigateBack, will return to the page A
wx.navigateBack ({
Delta: 2
})

wx.redirectTo close the current page, jump to another page

wx.redirectTo({
url:"../Index/Index"
})

Guess you like

Origin www.cnblogs.com/Ph-one/p/11922114.html