tt.onNavigateToMiniProgram
基础库 1.33.0 开始支持本方法,低版本需做兼容处理。
监听跳转到其它游戏的事件。
参数
function callback
监听事件的回调函数。
callback 回调函数接收的对象属性
| 属性 | 类型 | 说明 |
|---|---|---|
| errCode | Number | 跳转结果状态码 |
| errMsg | String | 跳转结果信息 |
| from | String | 跳转途径来源 |
errCode 取值说明
| 值 | 说明 |
|---|---|
| 0 | 跳转成功 |
| 1 | 跳转失败 |
| 2 | 用户取消 |
from 取值说明
| 值 | 说明 |
|---|---|
| showMoreGamesModal | tt.showMoreGamesModal 显示的弹窗 |
| createMoreGamesButton | tt.createMoreGamesButton 更多游戏按钮打开的弹窗 |
示例
// 监听小游戏跳转
tt.onNavigateToMiniProgram(function(res) {
console.log("open other games", res);
});