<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>质量检测系统登录</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="css/mui.min.css">
<script src="js/mui.min.js"></script>
</head>
<body>
<header class="mui-bar mui-bar-nav" >
<a class="mui-icon mui-icon-bars mui-pull-left"></a>
<a id="info" class="mui-icon mui-icon-info-filled mui-pull-right" style="color: #999;"></a>
<h1 class="mui-title" >质量检测系统登录</h1>
</header>
<div class="mui-content-padded">
<form class="mui-input-group">
<div class="mui-input-row">
<label>Input</label>
<input type="text" placeholder="普通输入框">
</div>
<div class="mui-input-row">
<label>用户名:</label>
<input type="text" id="userId" class="mui-input-speech mui-input-clear" placeholder="请输入用户名">
</div>
<div class="mui-input-row">
<label>密码:</label>
<input type="password" id="userpwd" class="mui-input-speech mui-input-clear" placeholder="请输入密码">
</div>
<div class="mui-button-row">
<button class="mui-btn mui-btn-primary" id="confirm" >确认</button>
<button class="mui-btn mui-btn-primary" onclick="window.close();">取消</button>
</div>
</form>
<h4 class="mui-content-padded">获得响应:</h4>
<code id="response" ></code>
</div>
<script>
mui.plusReady(function(){
mui.back = function(){
var btn = ["确定","取消"];
mui.confirm('确认关闭当前窗口?','Hello MUI',btn,function(e){
if(e.index==0){
mui.currentWebview.close();
}
});
}
});
</script>
</html>
5 个回复
DCloud_UNI_CHB
没有显示confirm框直接退出?
木子lee (作者)
没有,直接就退出了。 所以感到很奇怪。
DCloud_UNI_CHB
把你的测试工程作为附件发上来吧,应该是代码问题;
2014-12-23 12:02
木子lee (作者)
DCloud_UNI_CHB
增加一行:
另外,mui.back的复写不用放在mui.plusReady方法中。
木子lee (作者)
可以了,非常感谢。