forked from liulangnan/aui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdialog_frm.html
More file actions
78 lines (76 loc) · 2.81 KB
/
dialog_frm.html
File metadata and controls
78 lines (76 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>AUI快速完成布局</title>
<link rel="stylesheet" type="text/css" href="../css/aui.css" />
</head>
<body>
<p class="aui-padded-10 aui-text-center">Dialog样式</p>
<div class="aui-content-padded">
<div class="aui-btn aui-btn-block aui-btn-info" tapmode onclick="openDialog('text')">基本dialog</div>
</div>
<div class="aui-content-padded">
<div class="aui-btn aui-btn-block aui-btn-primary" tapmode onclick="openDialog('callback')">带有回调的dialog</div>
</div>
<div class="aui-content-padded">
<div class="aui-btn aui-btn-block aui-btn-warning" tapmode onclick="openDialog('input')">带有输入框的dialog</div>
</div>
</body>
<script type="text/javascript" src="../script/api.js" ></script>
<script type="text/javascript" src="../script/aui-dialog.js" ></script>
<script type="text/javascript">
apiready = function () {
api.parseTapmode();
}
var dialog = new auiDialog();
function openDialog(type){
switch (type) {
case "text":
dialog.alert({
title:"弹出提示",
msg:'这里是内容',
buttons:['取消','确定']
},function(ret){
console.log(ret)
})
break;
case "callback":
dialog.alert({
title:"弹出提示",
msg:'这里是内容',
buttons:['取消','确定']
},function(ret){
if(ret){
dialog.alert({
title:"提示",
msg:"您点击了第"+ret.buttonIndex+"个按钮",
buttons:['确定']
});
}
})
break;
case "input":
dialog.prompt({
title:"弹出提示",
text:'默认内容',
type:'number',
buttons:['取消','确定']
},function(ret){
if(ret.buttonIndex == 2){
dialog.alert({
title:"提示",
msg: "您输入的内容是:"+ret.text,
buttons:['确定']
});
}
})
break;
default:
break;
}
}
</script>
</html>