监听列表点击事件(打开新页面并实现页面传值)

来源:互联网 发布:java弹出消息框 编辑:程序博客网 时间:2024/06/07 14:57

父页:

<ul id="carNoList" class="mui-table-view"style="position:absolute;left:0px;top:80px;right:0px;"></ul>carNoList = document.getElementById('carNoList');//监听车号列表点击事件  //function choiceCarNo(){  mui("#carNoList").on('tap', 'li', function(){var carnochoosed = this.innerHTML.substring(4,11);mui.openWindow({    id: "carNoDetail",    url: "carNoDetail.html",    styles: {    top: '0px',    bottom: '0px',    left: '0px',    bounce: 'vertical',    bounceBackground: '#f8f8f8'    },    extras : {'carnochoosed':carnochoosed},    waiting: {    autoShow: false//title:'正在加载...',//等待对话框上显示的提示内容//    options:{//      width:waiting-dialog-widht,//等待框背景区域宽度,默认根据内容自动计算合适宽度//      height:waiting-dialog-height,//等待框背景区域高度,默认根据内容自动计算合适高度    }      });    });

子页:

window.onload = function(){needToinput= document.querySelector('.needToinput');operateButton= document.querySelector('.operateButton');carNoChoosed = document.getElementById('carNoChoosed');carDetailList = document.getElementById('carDetailList');//car_no = plus.webview.currentWebview().carnochoosed;//页面传值//document.getElementById("carNoChoosed").innerHTML = car_no;//getlist();mui.plusReady(function() {//needToinput= document.querySelector('.needToinput');//operateButton= document.querySelector('.operateButton');//needToinput.style.display = 'none';//operateButton.style.display = 'none';//carDetailList = document.getElementById('carDetailList');//car_no = plus.webview.currentWebview().carnochoosed;//页面传值//car_no = plus.webview.currentWebview().carnochoosed;//页面传值carNoChoosed.innerHTML = car_no;getlist();//关闭等待框    plus.nativeUI.closeWaiting();    //显示当前页面    mui.currentWebview.show();//获取原始窗口的高度var originalHeight=document.documentElement.clientHeight || document.body.clientHeight;//console.info("原始窗口的高度"+originalHeight);window.onresize=function(){//软键盘弹起与隐藏  都会引起窗口的高度发生变化    var resizeHeight=document.documentElement.clientHeight || document.body.clientHeight;    //console.info("软键盘弹起后窗口的高度"+resizeHeight);if(resizeHeight*1<originalHeight*1){ //resizeHeight<originalHeight证明窗口被挤压了plus.webview.currentWebview().setStyle({                height:originalHeight            });}}});  }


阅读全文
0 0