wp_drifter
wp_drifter
  • 发布:2015-03-31 16:14
  • 更新:2017-05-08 13:42
  • 阅读:3525

父页面刷新如何做,卡了几天了

分类:MUI

环境:
父页面A打开子页面B方法用的官方demo:

 var subWebview = null,  
                template = null;  
        if (subWebview == null) {  
            //获取共用父窗体  
            template = plus.webview.getWebviewById("default-main");  
        }  
        if (template) {  
            subWebview = template.children()[0];  
            subWebview.loadURL(href);  
            //修改共用父模板的标题  
            mui.fire(template, 'updateHeader', {  
                title: title,  
                showMenu: false  
            });  
           template.show('slide-in-right', 150);  
                }

页面B不能增加修改任何代码,请问我如何当页面B关闭后刷新页面A?

2015-03-31 16:14 负责人:无 分享
已邀请:
wp_drifter

wp_drifter (作者)

刚发这个问题就想到一个方法,成功了,
用了demo的index.html创建list.html方法实现的
A页面代码:

  mui.openWindow({  
            id: url,  
            url: url,  
            extras: { title: title },  
            waiting: {  
                autoShow: true  
            }  
        });  

   window.addEventListener("pageflowrefresh", function (e) {  
        location.reload();  
    });  

创建了一个C页面
代码为:

 mui.init({  
                subpages: [{  
                    url: 'B页面' + GetRequest(),  
                    id: 'MyFlow.aspx',  
                    styles: {  
                        top: '48px',  
                        bottom: '0px'   
                    }  
                }]  
            });  
            function GetRequest() {  
                var url = location.search;    
                var theRequest="";  
                if (url.indexOf("?") != -1) {  
                    return theRequest = url.substring(url.indexOf("?"));  
                }  
                return theRequest;  
            }  
              var main = null;  
            mui.plusReady(function () {  
                var titleElem = document.getElementById("title")  

                titleElem.innerHTML = plus.webview.currentWebview().title;  
                titleElem.className = "mui-title mui-fadein";  
                 main = plus.webview.currentWebview().opener();  
            });  
            mui.back = function () {  

                mui.fire(main, "pageflowrefresh" );  
                plus.webview.currentWebview().close();  
            }

用C页面来加载B页面,

就可以实现我要的功能了,

贴出来供大家参考

开心就好

开心就好

亲测可用,谢谢分享

yungehaha

yungehaha

6666666

两好三坏

两好三坏

可以使用自定义事件 楼主棒棒哒

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