How to jump to the mini program development page?

青灯夜游
Release: 2020-04-29 17:10:25
forward
2582 people have browsed it

How to jump to the mini program development page?

In previous APP or web products, users can browse multiple pages when using them, and the servers of these products can carry enough data. The characteristic of mini programs is their small size. In order to avoid causing trouble to users when using mini programs, WeChat mini programs stipulate that the page path can only be five levels. Please try to avoid multi-level interactions.

Page jump involves multiple page levels

The first one: wx.navigateTo(OBJECT)

Keep the current page, jump to a page in the application, and use wx.navigateBack to return to the original page.

OBJECT parameter description:

url String The path of the page within the application that needs to be jumped. Parameters can be included after the path. Parameters and paths are separated by ?, parameter keys and parameter values ​​are connected by =, and different parameters are separated by &; for example, 'path?key=value&key2=value2'

success Function interface calls the callback function successfully

fail Function The callback function that fails to call the interface

complete Function The callback function that ends the interface call (will be executed if the call is successful or failed)

onLoad:function(options) {
wx.navigateTo({
url:\'../index/index\' })}
Copy after login

Second type: wx. redirectTo(OBJECT)

Close the current page and jump to a page within the application.

OBJECT parameter description:

url String The path to the page within the application that needs to be jumped

success Function The callback function for successful interface calls

fail Function interface Callback function that fails to call

complete Function Callback function that ends the interface call (will be executed if the call is successful or failed)

onLoad:function(options) {
 wx.redirectTo({
url:\'../index/index\' }) }
Copy after login

Third type: wx.navigateBack(OBJECT)

Close the current page and return to the previous page or multi-level page. You can get the current page stack through getCurrentPages()) to determine how many levels need to be returned.

OBJECT parameter description:

delta Number The number of pages returned. If delta is greater than the existing number of pages, return to the homepage.

onLoad:function(options) {
var pages =getCurrentPages()
var num =pages.length
navigateBack:function(){
 wx.navigateBack({
 delta: num
})}}
Copy after login

Recommended: "小program development tutorial"

The above is the detailed content of How to jump to the mini program development page?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!