测试环境:红米、Nexus5、华为
测试方式:
按照官方示例写一个index.html,里面调用mui.init初始化一个subpage,top:45px, bottom 51px,
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<script src="js/mui.min.js"></script>
<link href="css/mui.min.css" rel="stylesheet" />
<script type="text/javascript" charset="utf-8">
mui.init({
subpages: [{
url: "subpage.html",
id: "list.html",
styles: {
top: '45px',
bottom: '51px'
}
}]
});
mui.plusReady(function(){
document.getElementById("my_orders").addEventListener('tap', function() {
plus.nativeUI.toast("test1");
});
document.getElementById("preview_order_btn").addEventListener('tap', function() {
plus.nativeUI.toast("test2");
});
});
</script>
</head>
<body>
<header class="mui-bar mui-bar-nav bar-nav-theme">
<a class="mui-icon mui-action-menu mui-icon-compose mui-pull-left" id="my_orders"></a>
<h1 class="mui-title">title测试</h1>
<a class="mui-icon mui-action-menu mui-icon-contact mui-pull-right" id="my_account"></a>
</header>
<nav class="mui-bar mui-bar-tab bar-tab-theme">
<div style="padding:10px">
<div class="mui-pull-left" style="line-height: 50px;">
<span class="price" style="">¥<span id="total">0</span></span>
</div>
<div class="mui-pull-right">
<button style="margin-top:2px" class="mui-btn mui-btn-danger" id="preview_order_btn">选好了</button>
</div>
</div>
</nav>
</body>
</html>
subpage.html里随便写了一句话。
以上代码在IOS里正常使用。
在Android下index.html里的按钮都无点击。
1 个回复
DCloud_UNI_FXY
mui.plusReady换成mui.ready
plusReady是指plus已经初始化。
ready是指当前DOM已经初始化(DOMContentLoaded)