May 19, 2021 WeChat Mini Program Development Document
Base library 1.3.0 starts to support, and low versions need to be compatible
iOS WeChat Client version 6.5.9 is starting to support, Android client is about to start supporting in version 6.5.10, please use iOS client for debugging first
Open another small program associated with the same public number.
OBJECT parameter description:
The name of the argument | Type | Required | Description |
---|---|---|---|
appId | String | Is | The little program app Id to open |
path | String | Whether | The open page path opens the home page if it is empty |
extraData | Object | Whether |
The data that needs to be passed to the target program, which can be obtained in
App.onLaunch()
App.onShow()
Details
|
envVersion | String | Whether | The version of the program to open, the valid value develop(development), trial (experience), release (official), this parameter is valid only if the current gadget is a development or experience version, and if the current gadget is an experance or a general release, the open program must be a formal version. The default is release |
success | Function | Whether | The interface calls a successful callback function |
fail | Function | Whether | The interface calls the failed callback function |
complete | Function | Whether | Callback function at end of interface call (call succeeds, fails are executed) |
Success returns a description of the parameters:
The name of the argument | Type | Description |
---|---|---|
errMsg | String | The result of the call |
Example code:
wx.navigateToMiniProgram({
appId: '',
path: 'pages/index/index?id=123',
extraData: {
foo: 'bar'
},
envVersion: 'develop',
success(res) {
// 打开成功
}
})
Base library 1.3.0 starts to support, and low versions need to be compatible
iOS WeChat Client version 6.5.9 is starting to support, Android client is about to start supporting in version 6.5.10, please use iOS client for debugging first
Return to the last small program, which can only be called successfully if the current small program is opened by another small program
OBJECT parameter description:
The name of the argument | Type | Required | Description |
---|---|---|---|
extraData | Object | Whether |
Data needs to be returned to the last small program,
App.onShow()
Details
|
success | Function | Whether | The interface calls a successful callback function |
fail | Function | Whether | The interface calls the failed callback function |
complete | Function | Whether | Callback function at end of interface call (call succeeds, fails are executed) |
Success returns a description of the parameters:
The name of the argument | Type | Description |
---|---|---|
errMsg | String | The result of the call |
Example code:
wx.navigateBackMiniProgram({
extraData: {
foo: 'bar'
},
success(res) {
// 返回成功
}
})