3***@qq.com
3***@qq.com
  • 发布:2016-07-21 18:01
  • 更新:2016-07-22 10:38
  • 阅读:1187

第二次openWindow跳转后下拉加载不执行

分类:MUI

从index页面第一次open进入order页面,下拉刷新正确执行,数据加载,点击order页面内容跳转几张页面后,提交内容后,open返回order页面,下拉加载在手机上失效

2016-07-21 18:01 负责人:无 分享
已邀请:
Trust

Trust - 少说废话

请上传相关代码。

3***@qq.com

3***@qq.com (作者)

index页面:
//跳转order页面
$('.inOrder').on('tap',function(){
mui.openWindow({
url:'html/order/order.html',
id:'order.html'
})
})

order页面:
<script type="text/javascript">
$('#username').text(localStorage.name);
//启用双击监听
mui.init({
gestureConfig:{
doubletap:true
},
subpages:[{
url:'pullrefresh_sub.html',
id:'pullrefresh_sub.html',
styles:{
top: '45px',
bottom: '0px',
}
}]
});

    var contentWebview = null;  
    document.querySelector('header').addEventListener('doubletap',function () {  
        if(contentWebview==null){  
            contentWebview = plus.webview.currentWebview().children()[0];  
        }  
        contentWebview.evalJS("mui('#pullrefresh').pullRefresh().scrollTo(0,0,100)");  
    });  
</script>  

pullrefresh_sub(下拉容器页面)
<script>
mui.init({
pullRefresh: {
container: '#pullrefresh',
down: {
contentrefresh: '正在更新数据...',
callback: pulldownRefresh
},
}
});
/**

  • 下拉刷新具体业务实现
    */
    function pulldownRefresh() {
    setTimeout(function() {
    $.ajax({
    内容。。。。。。。
    });
    mui('#pullrefresh').pullRefresh().endPulldownToRefresh()
    }, 300);

        }  
        var count = 0;  
        /**  
  • 上拉加载具体业务实现
    */
    if (mui.os.plus) {
    mui.plusReady(function() {
    setTimeout(function() {
    mui('#pullrefresh').pullRefresh().pulldownLoading();
    }, 1000);
    });
    } else {
    mui.ready(function() {
    mui('#pullrefresh').pullRefresh().pulldownLoading();
    });
    }
    </script>

order-form(第二次跳转order的页面)
//跳转order页面
$('#btn').on('tap',function(){
var callBack = function(success){
if(success){
localStorage.removeItem('operationIndex');
sessionStorage.removeItem('statusObj');
mui.toast('保存成功');
mui.openWindow({
url:'../order/order.html',
id:'../order/order.html'
});
}else{
mui.toast('保存失败');
}
}
document.getElementById('iframe').contentWindow.submitForm(_url,callBack);
});

  • Trust

    请直接上传相关文件,方便调试。

    2016-07-22 10:37

  • 3***@qq.com (作者)

    已经解决,是文件更换路径openWindow id写成路径后跳转不执行,谢谢

    2016-07-22 12:02

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