diff --git a/public/themes/simpleboot3/user/center/edit_phone.html b/public/themes/simpleboot3/user/center/edit_phone.html index 54789e8..b571874 100644 --- a/public/themes/simpleboot3/user/center/edit_phone.html +++ b/public/themes/simpleboot3/user/center/edit_phone.html @@ -176,6 +176,8 @@ var curCount;//当前剩余秒数 var t=localStorage.getItem("time"); + InterValObj = window.setInterval(SetRemainTime,1000); + if(t!=null){ curCount=t; $(".nextstep").attr("disabled",true); @@ -192,12 +194,10 @@ curCount = count; var tel = $(".enterphone").val(); if(tel==""){ - alert("请输入手机号"); return false; } var reg= /^1[34578]\d{9}$/; if(!reg.test(tel)){ - alert("请输入正确的手机号"); return false; } localStorage.setItem("mobile",tel) @@ -207,7 +207,6 @@ // $(".sendcode").unbind() $(".sendcode").html( curCount + "秒"); $(".sendcode").css("color","#fff"); - InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器,1秒执行一次 }); diff --git a/public/themes/simpleboot3/user/center/edit_phone2.html b/public/themes/simpleboot3/user/center/edit_phone2.html index 71ae5fa..5f5b939 100644 --- a/public/themes/simpleboot3/user/center/edit_phone2.html +++ b/public/themes/simpleboot3/user/center/edit_phone2.html @@ -165,12 +165,10 @@ //发送验证码 var InterValObj; //timer变量,控制时间 - var count = 10; //间隔函数,1秒执行 + var count = 60; //间隔函数,1秒执行 var curCount='';//当前剩余秒数 var t=localStorage.getItem("time"); - - InterValObj = window.setInterval(SetRemainTime,1000); if(t!=null){ curCount=t; @@ -178,7 +176,6 @@ $(".sendcode").attr("disabled",true) var phone=localStorage.getItem("mobile"); $(".enterphone").val(phone) - }else{ curCount=60; window.clearInterval(InterValObj); @@ -188,12 +185,10 @@ $(".sendcode").click(function(){ var tel = $(".enterphone").val(); if(tel==""){ - alert("请输入手机号"); return false; } var reg= /^1[34578]\d{9}$/; if(!reg.test(tel)){ - alert("请输入正确的手机号"); return false; } localStorage.setItem("mobile",tel) @@ -216,8 +211,7 @@ $(".sendcode").html("重新获取证码"); $(".sendcode").css("color","#fff"); localStorage.clear(); - } - else { + } else { curCount--; localStorage.setItem("time",curCount); $(".sendcode").html(curCount + "秒");