codecamp

tt.onNavigateToMiniProgram

基础库 1.33.0 开始支持本方法,低版本需做兼容处理

监听跳转到其它游戏的事件。


参数

function callback

监听事件的回调函数。

callback 回调函数接收的对象属性

属性类型说明
errCodeNumber跳转结果状态码
errMsgString跳转结果信息
fromString跳转途径来源

errCode 取值说明

说明
0跳转成功
1跳转失败
2用户取消

from 取值说明

说明
showMoreGamesModaltt.showMoreGamesModal 显示的弹窗
createMoreGamesButtontt.createMoreGamesButton 更多游戏按钮打开的弹窗


示例

// 监听小游戏跳转
tt.onNavigateToMiniProgram(function(res) {
  console.log("open other games", res);
});
tt.showMoreGamesModal
tt.offNavigateToMiniProgram
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定