

English
Open another applet.
Platform Difference Description
App | H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 抖音小程序 | QQ小程序 | 京东小程序 |
---|---|---|---|---|---|---|---|
x (see below) | x | √ | √ | √ | √(1.15.0+) | √ | √ |
OBJECT parameter description
Attribute | Type | Default | Required | Description | Platform Difference Description |
---|---|---|---|---|---|
appId | string | Yes | The applet appId to be opened (fill in the App Key for Baidu applet) | ||
path | string | No | Open page path, if empty, open home page | ||
extraData | object | 否 | 需要传递给目标小程序的数据,目标小程序可在 App.vue 的 onLaunch 或onShow 中获取到这份数据。 | ||
envVersion | string | release | 否 | 要打开的小程序版本,有效值: develop(开发版),trial(体验版),release(正式版)。仅在当前小程序为开发版或体验版时此参数有效。如果当前小程序是正式版,则打开的小程序必定是正式版。 | 支付宝小程序、微信小程序、抖音小程序 |
success | function | No | Callback function for successful interface call | ||
fail | function | No | Callback function for interface call failure | ||
complete | function | No | The callback function of the end of the interface call (the call will be executed if the call succeeds or fails) |
Sample code
uni.navigateToMiniProgram({
appId: '',
path: 'pages/index/index?id=123',
extraData: {
'data1': 'test'
},
success(res) {
// open successfully
}
})
Jump back to the previous applet, only when another applet jumps to the current applet can it be called successfully.
Platform Difference Description
App | H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 抖音小程序 | 飞书小程序 | QQ小程序 | 快手小程序 | 京东小程序 |
---|---|---|---|---|---|---|---|---|---|
x | x | √ | √ | √ | √ | x | √ | √ | √ |
OBJECT parameter description
Attribute | Type | Required | Description |
---|---|---|---|
extraData | Object | No | The data that needs to be returned to the previous applet, the last applet can get this data in onShow of App.vue |
success | function | No | Callback function for successful interface call |
fail | function | No | Callback function for interface call failure |
complete | function | No | The callback function of the end of the interface call (the call will be executed if the call succeeds or fails) |
Sample code
uni.navigateBackMiniProgram({
extraData: {
'data1': 'test'
},
success(res) {
// return success
}
})
WeChat applet jump to applet (half-screen mode) (supported from WeChat base library 2.20.1)
When the applet needs to open another applet for the user to perform shortcut operations, the applet to be opened can be jumped in the form of a half screen.
Call process
embeddedAppIdList
field in the global configuration manifest.json
-->mp-weixin
node and declare the applet that needs half-screen jumping. If it is not configured, it will switch to the normal applet and jump to the applet. No configuration is required since version 2.23.1 and above.Configuration example:
{
"mp-weixin" : {
"embeddedAppIdList": ["wxe5f52902cf4de896"]//需要半屏跳转的小程序appid
}
}
property | type | default value | required | description |
---|---|---|---|---|
appId | string | Yes | the applet to open appId | |
path | string | No | The path of the page to open, if empty, open the home page. The part after the ? in the path will become the query, and the query data can be obtained in the callback functions of onLaunch , onShow and Page.onLoad of App.vue of the applet. For small games, you can only pass in the query part to achieve the effect of passing parameters, for example: pass in "?foo=bar". See details | |
extraData | object | No | The data that needs to be passed to the target applet. The target applet can obtain this data in onLaunch or onShow of App.vue . See details | |
envVersion | string | release | No | The version of the applet to open, valid values: develop (development version), trial (experience version), release (official version). This parameter is valid only when the current Mini Program is the development version or the trial version. If the current applet is the official version, the opened applet must be the official version. |
shortLink | string | No | Mini program link, when this parameter is passed, appId and path can be omitted. The link can be obtained through [Mini Program Menu] -> [Copy Link]. | |
success | function | No | Callback function for successful interface call | |
fail | function | No | Callback function for interface call failure | |
complete | function | No | Callback function for the end of the interface call (the call will be executed if the call succeeds or fails) |
Sample code
uni.openEmbeddedMiniProgram({
appId: '',
path: 'pages/index/index?id=123',
extraData: {
'data1': 'test'
},
success(res) {
// open successfully
}
})
Usage Restrictions
After March 18, 2022, the use process has the following restrictions. If all the following conditions are not met, it will be automatically switched to the normal applet jump applet, which will not affect the user's use:
embeddedAppIdList
field and declare it in the global configuration manifest.json
-->mp-weixin
node;Before March 18, 2022, the use process has the following restrictions. If all of the following conditions are not met, it will be automatically switched to the normal applet jumping applet, which will not affect the user's use: