File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ var bindGetCode = function (time, btn_text) {
77
77
var tel = document . querySelector ( '.tel' ) ;
78
78
var time = time ; //时间间隔
79
79
var telNumber = "" ;
80
+ var counting = false ;
80
81
var countTime = time ;
81
82
// 倒计时
82
83
var count = function ( ) {
@@ -86,12 +87,13 @@ var bindGetCode = function (time, btn_text) {
86
87
} else {
87
88
countTime = time ;
88
89
btn . innerHTML = '获取验证码' ;
90
+ counting = false ;
89
91
checkTel ( ) ;
90
92
}
91
93
}
92
94
// 检查手机号
93
95
var checkTel = function ( ) {
94
- if ( telNumber . checkTel ( ) ) {
96
+ if ( telNumber . checkTel ( ) && ! counting ) {
95
97
btn . classList . add ( 'active' )
96
98
} else {
97
99
btn . classList . remove ( 'active' )
@@ -104,6 +106,7 @@ var bindGetCode = function (time, btn_text) {
104
106
btn . addEventListener ( 'click' , function ( ) {
105
107
if ( this . classList . contains ( 'active' ) ) {
106
108
this . classList . remove ( 'active' ) ;
109
+ counting = true ;
107
110
count ( )
108
111
}
109
112
} )
You can’t perform that action at this time.
0 commit comments