aalizzwell
aalizzwell
  • 发布:2016-07-19 11:28
  • 更新:2016-07-19 11:56
  • 阅读:2482

mui.open 窗体传值失败

分类:MUI

安卓4.2.1 Coolpad 7269使用mui.open打开新页面extras传值失败,android 4.3,iphone测试没问题,目前没有测试更多版本。

2016-07-19 11:28 负责人:无 分享
已邀请:
aalizzwell

aalizzwell (作者)

mui.plusReady(function() {  
            document.getElementById("btnScan").addEventListener("tap", function() {  
                id=plus.webview.currentWebview().id;  
                console.log("myId="+id);  
                mui.openWindow({  
                    id: "brscan",  
                    url: "brscan.html",  
                    "extras": {  
                        viewId: "ddddd",  
                        abc:id,  
                        a:1  
                    }  
                });  
            });  
});

新页面中:

(function(m, doc) {  
            m.init();  
            m.plusReady(function() {  
                self = plus.webview.currentWebview();  
                console.log("viewId="+self.viewId+",a="+self.a+",abc="+self.abc+",ddd="+self.ddd);  
                view = plus.webview.getWebviewById(viewId);  
            });  
        })(mui, document);
赵梦欢

赵梦欢 - 专注前端,乐于分享!

拓展参数extras页面传值的适用类型为新建页面时传值,若页面已经进行完成了loaded事件,比如需要打开的页面提前进行了预加载,此时会失效,这个时候需要适用mui.fire,同时注意接收参数的时机,需要在show事件完成时候接收参数。

详细可以参考这里:页面传参深入探究

  • aalizzwell (作者)

    没有进行预加载,是首次加载,有些机型可以

    2016-07-19 13:13

  • aalizzwell (作者)

    页面传值属于基础功能,请尽快完善

    2016-07-19 13:25

该问题目前已经被锁定, 无法添加新回复