Closed gyt0412 closed 6 years ago
1.9.1
Web
1、chrome打开页面:https://abcmouse.qq.com/h5/ 2、F12打开调试面板 3、打开另一个无关页面后,并切换到该页面,再切换回1中打开的页面,看Log,会出现2条 [DcReportAction] onAppReport():pauseApp和[DcReportAction] onAppReport():resumeApp。
调用代码: onLoad: function () { // 设置为常驻节点 cc.game.addPersistRootNode(this.node);
cc.game.on(cc.game.EVENT_HIDE, this.onAppPause); cc.game.on(cc.game.EVENT_SHOW , this.onAppResume); this.onAppStart();//初始化需要自己触发 }, onAppPause:function(){ cclog.d(TAG,"onAppPause"); if(!window.GlobalReport.isNative){ DcReportAction.onAppReport('pauseApp'); } }, onAppResume:function(){ cclog.d(TAG,"onAppResume"); if(!window.GlobalReport.isNative){ DcReportAction.onAppReport('resumeApp'); } }
谢谢反馈,这个问题在 1.10 已经修复了。鉴于很多人最近都来反馈,我们会提取到 1.9.3
明白了,谢谢神速回复!
Creator version?(版本号)
1.9.1
Affected platform?(受影响的平台)
Web
How to reproduce?(如何重现)
1、chrome打开页面:https://abcmouse.qq.com/h5/ 2、F12打开调试面板 3、打开另一个无关页面后,并切换到该页面,再切换回1中打开的页面,看Log,会出现2条 [DcReportAction] onAppReport():pauseApp和[DcReportAction] onAppReport():resumeApp。
Demo project?(demo 项目)
调用代码: onLoad: function () { // 设置为常驻节点 cc.game.addPersistRootNode(this.node);