add code
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<meta name="HandheldFriendly" content="true"/>
|
||||
<meta name="MobileOptimized" content="320"/>
|
||||
<title>Hello H5+</title>
|
||||
<script type="text/javascript" src="../js/common.js"></script>
|
||||
<script type="text/javascript">
|
||||
function pickDate() {
|
||||
outSet( "打开系统日期选择框:");
|
||||
var dDate=new Date();
|
||||
dDate.setFullYear(2014,0,1);
|
||||
var minDate=new Date();
|
||||
minDate.setFullYear(2010,0,1);
|
||||
var maxDate=new Date();
|
||||
maxDate.setFullYear(2016,11,31);
|
||||
outLine( "[date] "+dDate );
|
||||
outLine( "[minDate] "+minDate );
|
||||
outLine( "[maxDate] "+maxDate );
|
||||
plus.nativeUI.pickDate( function(e) {
|
||||
var d=e.date;
|
||||
outLine( "选择的日期:"+d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate() );
|
||||
},function(e){
|
||||
outSet( "未选择日期:"+e.message );
|
||||
},{title:"请选择日期",date:dDate,minDate:minDate,maxDate:maxDate});
|
||||
}
|
||||
function pickTime() {
|
||||
outSet( "打开系统时间选择框:");
|
||||
var dTime=new Date();
|
||||
dTime.setHours(6,0);
|
||||
outLine( "[time] "+dTime );
|
||||
plus.nativeUI.pickTime(function(e){
|
||||
var d=e.date;
|
||||
outLine( "选择的时间:"+d.getHours()+":"+d.getMinutes() );
|
||||
},function (e){
|
||||
outSet( "取消选择时间!" );
|
||||
},{title:"请选择时间",is24Hour:true,time:dTime});
|
||||
}
|
||||
function showAlert(){
|
||||
outSet( "弹出系统提示对话框:" );
|
||||
plus.nativeUI.alert("系统提示框内容\n第二行内容",function(e){
|
||||
var i=e.index;
|
||||
if(i<0){
|
||||
outLine( "按\"返回\"键关闭提示框!" );
|
||||
}else{
|
||||
outLine( "提示框已关闭!" );
|
||||
}
|
||||
},"nativeUI","好");
|
||||
}
|
||||
function showConfirm(){
|
||||
outSet( "弹出系统确认对话框:" );
|
||||
var bts=["是","否","取消"];
|
||||
plus.nativeUI.confirm("系统确认对话框内容\n第二行内容",function(e){
|
||||
var i=e.index;
|
||||
outLine( "按\""+((i>=0)?bts[e.index]:"返回")+"\"关闭!" );
|
||||
},"nativeUI",bts);
|
||||
}
|
||||
function showPrompt(){
|
||||
outSet( "弹出系统输入对话框:" );
|
||||
var bts=["确认","取消"];
|
||||
plus.nativeUI.prompt("请输入内容",function(e){
|
||||
var i=e.index;
|
||||
outLine( "按\""+((i>=0)?bts[e.index]:"返回")+"\"关闭:"+e.value );
|
||||
},"nativeUI","内容",bts);
|
||||
}
|
||||
function showActionSheet(){
|
||||
outSet( "弹出系统选择按钮框:" );
|
||||
var bts=[{title:"警告",style:"destructive"},{title:"按钮1"},{title:"按钮2"},{title:"按钮3"}];
|
||||
plus.nativeUI.actionSheet({title:"ActionSheet标题",cancel:"取消",buttons:bts},
|
||||
function(e){
|
||||
outLine( "选择了\""+((e.index>0)?bts[e.index-1].title:"取消")+"\"");
|
||||
}
|
||||
);
|
||||
}
|
||||
function showToast(){
|
||||
plus.nativeUI.toast("您好!正在使用HBuilder开发应用!",{duration:"long"});
|
||||
}
|
||||
function showWaiting(){
|
||||
var nw = clicked('nativeui_waiting.html',false,false,{popGesture:'none'});
|
||||
nw.addEventListener("close",function(){
|
||||
plus.nativeUI.closeWaiting();
|
||||
},false);
|
||||
}
|
||||
</script>
|
||||
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8"/>
|
||||
</head>
|
||||
<body>
|
||||
<header id="header">
|
||||
<div class="nvbt iback" onclick="back()"></div>
|
||||
<div class="nvtt">nativeUI</div>
|
||||
<div class="nvbt idoc" onclick="openDoc('NativeUI Document','/doc/nativeUI.html')"></div>
|
||||
</header>
|
||||
<div id="dcontent" class="dcontent">
|
||||
<ul class="dlist">
|
||||
<li class="ditem" onclick="pickDate()">系统日期选择框</li>
|
||||
<li class="ditem" onclick="pickTime()">系统时间选择框</li>
|
||||
<li class="ditem" onclick="showAlert()">提示框</li>
|
||||
<li class="ditem" onclick="showConfirm()">确认框</li>
|
||||
<li class="ditem" onclick="showPrompt()">输入框</li>
|
||||
<li class="ditem" onclick="showActionSheet()">弹出菜单ActionSheet</li>
|
||||
<li class="ditem" onclick="showToast()">自动消失提示框</li>
|
||||
</ul>
|
||||
<br/>
|
||||
<div class="button" onclick="showWaiting()">等待框</div>
|
||||
</div>
|
||||
<div id="output">
|
||||
nativeUI管理系统原生界面,可用于弹出系统原生提示对话框窗口、时间日期选择对话框、等待对话框等。
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript" src="../js/immersed.js" ></script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user