Skip to content

Commit 3713bd6

Browse files
committedDec 6, 2018
update
1 parent 7d9a2e4 commit 3713bd6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎libs/commonFun.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ var bindGetCode = function (time, btn_text) {
7777
var tel = document.querySelector('.tel');
7878
var time = time; //时间间隔
7979
var telNumber = "";
80+
var counting = false;
8081
var countTime = time;
8182
// 倒计时
8283
var count = function () {
@@ -86,12 +87,13 @@ var bindGetCode = function (time, btn_text) {
8687
} else {
8788
countTime = time;
8889
btn.innerHTML = '获取验证码';
90+
counting = false;
8991
checkTel();
9092
}
9193
}
9294
// 检查手机号
9395
var checkTel = function () {
94-
if (telNumber.checkTel()) {
96+
if (telNumber.checkTel() && !counting) {
9597
btn.classList.add('active')
9698
} else {
9799
btn.classList.remove('active')
@@ -104,6 +106,7 @@ var bindGetCode = function (time, btn_text) {
104106
btn.addEventListener('click', function () {
105107
if (this.classList.contains('active')) {
106108
this.classList.remove('active');
109+
counting = true;
107110
count()
108111
}
109112
})

0 commit comments

Comments
 (0)
Please sign in to comment.