Skip to content

Commit 1386a02

Browse files
committed
v1.1.3
1 parent a147bcd commit 1386a02

File tree

3 files changed

+27
-51
lines changed

3 files changed

+27
-51
lines changed

html/alert_frm.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
<div class="aui-btn aui-btn-block aui-btn-info" tapmode onclick="alertTxt()">简单自定义</div>
2424
<div class="aui-btn aui-btn-block aui-btn-info" tapmode onclick="alertCustom()">自定义消息内容样式</div>
2525
</div>
26+
<div class="aui-content-padded">
27+
<p>结果:<span id="result"></span></p>
28+
</div>
2629
</body>
2730
<script type="text/javascript" src="../script/api.js" ></script>
2831
<script type="text/javascript" src="../script/aui-alert.js" ></script>
@@ -33,7 +36,7 @@
3336
},function(ret){
3437
//处理回调函数
3538
if(ret){
36-
alert("你点击了第"+ret+"个按钮");
39+
$api.text($api.byId("result"),"你点击了第"+ret+"个按钮");
3740
}
3841
})
3942
}
@@ -50,9 +53,9 @@
5053
//处理回调函数
5154
if(ret){
5255
if(ret==0){
53-
alert("AUI没有得到你的认可我们会继续努力");
56+
$api.text($api.byId("result"),"AUI没有得到你的认可我们会继续努力");
5457
}else{
55-
alert("感谢你对AUI的支持");
58+
$api.text($api.byId("result"),"感谢你对AUI的支持");
5659
}
5760
}
5861
})
@@ -73,7 +76,7 @@
7376
//处理回调函数
7477
if(ret){
7578
if(ret==0){
76-
alert("感谢支持");
79+
$api.text($api.byId("result"),"感谢支持");
7780
}
7881
}
7982
})

html/aui_alert_frm.html

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<link rel="stylesheet" type="text/css" href="../css/aui.css" />
88
</head>
99
<style>
10-
1110
* {
1211
margin:0;
1312
}
@@ -19,12 +18,8 @@
1918
}
2019
body{
2120
background: rgba(0,0,0,0.3);
22-
-webkit-animation: fadeIn .15s ease both;
2321
overflow: hidden;
2422
}
25-
body.fadeOut {
26-
-webkit-animation: fadeOut .15s ease both;
27-
}
2823
#aui-box {
2924
position: absolute;
3025
width: 80%;
@@ -33,8 +28,7 @@
3328
left: 50%;
3429
margin-left: -40%;
3530
background: #ffffff;
36-
opacity: 1;
37-
overflow: hidden;
31+
-webkit-animation: fadeIn .3s;
3832
}
3933
#aui-box-header {
4034
padding: 10px 15px 0 15px;
@@ -51,28 +45,16 @@
5145
overflow: hidden;
5246
font-size: 1em;
5347
}
54-
#aui-box-footer:after {
55-
border-top: 1px solid #dbdbdb;
56-
display: block;
57-
content: '';
58-
position: absolute;
59-
top: 0;
60-
right: 0;
61-
bottom: 0;
62-
left: 0;
63-
-webkit-transform-origin: 0 0;
64-
-webkit-transform: scale(1);
65-
pointer-events: none;
66-
}
67-
#aui-box-footer .aui-box-btn,
68-
#aui-box-footer .aui-box-btn {
48+
.aui-box-btn {
6949
float: left;
7050
text-align: center;
7151
position: relative;
7252
padding: 15px 0;
53+
z-index: 999;
7354
}
7455
.aui-box-btn:after {
7556
border-right: 1px solid #dbdbdb;
57+
border-top: 1px solid #dbdbdb;
7658
display: block;
7759
content: '';
7860
position: absolute;
@@ -84,7 +66,7 @@
8466
-webkit-transform: scale(1);
8567
pointer-events: none;
8668
}
87-
.aui-alert-btn:last-child:after {
69+
.aui-box-btn:last-child:after {
8870
border-right: 0;
8971
}
9072
@media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
@@ -97,21 +79,14 @@
9779
}
9880
@-webkit-keyframes fadeIn {
9981
from { background: rgba(0,0,0,0);opacity: 0; }
100-
to { background: rgba(0,0,0,0.3);opacity: 1; }
101-
}
102-
@-webkit-keyframes fadeOut {
103-
from {}
104-
to {opacity: 0;background: rgba(0,0,0,0);}
82+
to { opacity: 1; }
10583
}
10684
</style>
10785
<body>
10886
<div id="aui-box">
10987
<div id="aui-box-header"></div>
11088
<div id="aui-box-body"></div>
111-
<div id="aui-box-footer">
112-
<div class="aui-box-btn" data-index="1" data-status="1" tapmode style="width:50%">确定</div>
113-
<div class="aui-box-btn" data-index="1" data-status="1" tapmode style="width:50%">确定</div>
114-
</div>
89+
<div id="aui-box-footer"></div>
11590
</div>
11691
</body>
11792
<script type="text/javascript" src="../script/api.js" ></script>
@@ -134,7 +109,6 @@
134109
btnHtml += '<div class="aui-box-btn" id="btn-'+i+'" data-status="1" tapmode onclick="btnClick('+i+')" style="color:'+btnColor+';width:'+btnWidth+'%">'+buttons[i]+'</div>';
135110
}
136111
$api.html($api.byId("aui-box-footer"),btnHtml);
137-
138112
var frameHeight = api.frameHeight;
139113
var boxHeight = $api.offset($api.byId("aui-box")).h;
140114
if(frameHeight - boxHeight > 100){
@@ -147,24 +121,16 @@
147121
var contMaxHeight = frameHeight/3;
148122
var boxTop = (frameHeight-contMaxHeight)/3;
149123
}
150-
151124
$api.css($api.byId("aui-box-body"),"max-height:"+contMaxHeight+"px;color:"+contColor+"");
152125
$api.css($api.byId("aui-box"),"top:"+boxTop+"px;opacity:1;border-radius:"+radius+"px");
153126
api.parseTapmode();
154127
}
155128
function btnClick(index){
156-
var btnDom = $api.byId("btn-"+index);
157-
if($api.attr(btnDom,'data-status')=='1'){
158-
api.sendEvent({
159-
name: 'auiAlertEvent',
160-
extra: {buttonIndex:index}
161-
});
162-
$api.addCls($api.dom("body"),"fadeOut");
163-
$api.attr(btnDom,'data-status',0)
164-
setTimeout(function(){
165-
api.closeFrame();
166-
},150)
167-
}
129+
api.sendEvent({
130+
name: 'auiAlertEvent',
131+
extra: {buttonIndex:index}
132+
});
133+
api.closeFrame();
168134
}
169135
</script>
170136
</html>

html/demo_form_frm.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<div class="aui-input-row">
3838
<input type="number" class="aui-input" id="code" placeholder="请输入收到的验证码"/>
3939
<span class="aui-input-addon">
40-
<div class="aui-btn" id="sendVerify" tapmode onclick="getVerify()">获取验证码</div>
40+
<div class="aui-btn" id="sendVerify" status="1" tapmode onclick="getVerify()">获取验证码</div>
4141
</span>
4242
</div>
4343

@@ -69,7 +69,12 @@
6969
}
7070
function getVerify() {
7171
var sendVerify = $api.byId('sendVerify');
72+
var status = $api.attr(sendVerify,'status');
73+
if(status!=1){
74+
return;
75+
}
7276
$api.removeAttr(sendVerify,'onclick');
77+
api.parseTapmode();
7378
$api.html(sendVerify,'<span id="GetVerify">120</span>S');
7479
times = 119;
7580
isinerval = setInterval("CountDown()", 1000);
@@ -82,6 +87,8 @@
8287
if (times < 1) {
8388
var sendVerify = $api.byId('sendVerify');
8489
$api.attr(sendVerify,'onclick','get_verify()');
90+
$api.attr(sendVerify,'status','1');
91+
api.parseTapmode();
8592
$api.html(sendVerify,'重新获取');
8693
clearInterval(isinerval);
8794
return;

0 commit comments

Comments
 (0)