作者 李涵
1 个管道 的构建 通过 耗费 1 秒

合并分支 'juan' 到 'master'

Juan



查看合并请求 !383
@@ -179,6 +179,9 @@ @@ -179,6 +179,9 @@
179 if(t!=null){ 179 if(t!=null){
180 curCount=t; 180 curCount=t;
181 $(".nextstep").attr("disabled",true); 181 $(".nextstep").attr("disabled",true);
  182 + $(".sendcode").attr("disabled",true)
  183 + var phone=localStorage.getItem("mobile");
  184 + $(".enterphone").val(phone)
182 185
183 }else{ 186 }else{
184 curCount=60; 187 curCount=60;
@@ -187,34 +190,43 @@ @@ -187,34 +190,43 @@
187 } 190 }
188 $(".sendcode").click(function(){ 191 $(".sendcode").click(function(){
189 curCount = count; 192 curCount = count;
  193 + var tel = $(".enterphone").val();
  194 + if(tel==""){
  195 + alert("请输入手机号");
  196 + return false;
  197 + }
  198 + var reg= /^1[34578]\d{9}$/;
  199 + if(!reg.test(tel)){
  200 + alert("请输入正确的手机号");
  201 + return false;
  202 + }
  203 + localStorage.setItem("mobile",tel)
190 //设置button效果,开始计时 204 //设置button效果,开始计时
191 $(".sendcode").attr("disabled",true); 205 $(".sendcode").attr("disabled",true);
192 $(".nextstep").attr("disabled",true); 206 $(".nextstep").attr("disabled",true);
193 // $(".sendcode").unbind() 207 // $(".sendcode").unbind()
194 $(".sendcode").html( curCount + "秒"); 208 $(".sendcode").html( curCount + "秒");
195 - $(".sendcode").css("color","#666666"); 209 + $(".sendcode").css("color","#fff");
196 210
197 - InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器,1秒执行一次 211 + InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器,1秒执行一次
198 }); 212 });
199 213
200 //timer处理函数 214 //timer处理函数
201 function SetRemainTime() { 215 function SetRemainTime() {
202 216
203 -  
204 -  
205 if (curCount == 0) { 217 if (curCount == 0) {
206 window.clearInterval(InterValObj);//停止计时器 218 window.clearInterval(InterValObj);//停止计时器
207 $(".sendcode").removeAttr("disabled");//启用按钮 219 $(".sendcode").removeAttr("disabled");//启用按钮
208 $(".nextstep").removeAttr("disabled"); 220 $(".nextstep").removeAttr("disabled");
209 $(".sendcode").html("重新发送验证码"); 221 $(".sendcode").html("重新发送验证码");
210 - $(".sendcode").css("color","#FE0A01"); 222 + $(".sendcode").css("color","#fff");
211 localStorage.clear(); 223 localStorage.clear();
212 } 224 }
213 else { 225 else {
214 curCount--; 226 curCount--;
215 localStorage.setItem("time",curCount); 227 localStorage.setItem("time",curCount);
216 $(".sendcode").html(curCount + "秒"); 228 $(".sendcode").html(curCount + "秒");
217 - $(".sendcode").css("color","#666666"); 229 + $(".sendcode").css("color","#fff");
218 } 230 }
219 } 231 }
220 </script> 232 </script>
@@ -175,6 +175,9 @@ @@ -175,6 +175,9 @@
175 if(t!=null){ 175 if(t!=null){
176 curCount=t; 176 curCount=t;
177 $(".nextstep").attr("disabled",true); 177 $(".nextstep").attr("disabled",true);
  178 + $(".sendcode").attr("disabled",true)
  179 + var phone=localStorage.getItem("mobile");
  180 + $(".enterphone").val(phone)
178 181
179 }else{ 182 }else{
180 curCount=60; 183 curCount=60;
@@ -183,13 +186,24 @@ @@ -183,13 +186,24 @@
183 } 186 }
184 //启动计时器,1秒执行一次 187 //启动计时器,1秒执行一次
185 $(".sendcode").click(function(){ 188 $(".sendcode").click(function(){
  189 + var tel = $(".enterphone").val();
  190 + if(tel==""){
  191 + alert("请输入手机号");
  192 + return false;
  193 + }
  194 + var reg= /^1[34578]\d{9}$/;
  195 + if(!reg.test(tel)){
  196 + alert("请输入正确的手机号");
  197 + return false;
  198 + }
  199 + localStorage.setItem("mobile",tel)
186 curCount = count; 200 curCount = count;
187 //设置button效果,开始计时 201 //设置button效果,开始计时
188 $(".sendcode").attr("disabled",true); 202 $(".sendcode").attr("disabled",true);
189 $(".nextstep").attr("disabled",true); 203 $(".nextstep").attr("disabled",true);
190 // $(".sendcode").unbind() 204 // $(".sendcode").unbind()
191 $(".sendcode").html( curCount + "秒"); 205 $(".sendcode").html( curCount + "秒");
192 - $(".sendcode").css("color","#666666"); 206 + $(".sendcode").css("color","#fff");
193 InterValObj = window.setInterval(SetRemainTime,1000); //启动计时器,1秒执行一次 207 InterValObj = window.setInterval(SetRemainTime,1000); //启动计时器,1秒执行一次
194 208
195 }); 209 });
@@ -200,14 +214,14 @@ @@ -200,14 +214,14 @@
200 $(".sendcode").removeAttr("disabled");//启用按钮 214 $(".sendcode").removeAttr("disabled");//启用按钮
201 $(".nextstep").removeAttr("disabled"); 215 $(".nextstep").removeAttr("disabled");
202 $(".sendcode").html("重新获取证码"); 216 $(".sendcode").html("重新获取证码");
203 - $(".sendcode").css("color","#FE0A01"); 217 + $(".sendcode").css("color","#fff");
204 localStorage.clear(); 218 localStorage.clear();
205 } 219 }
206 else { 220 else {
207 curCount--; 221 curCount--;
208 localStorage.setItem("time",curCount); 222 localStorage.setItem("time",curCount);
209 $(".sendcode").html(curCount + "秒"); 223 $(".sendcode").html(curCount + "秒");
210 - $(".sendcode").css("color","#FE0A01"); 224 + $(".sendcode").css("color","#fff");
211 225
212 } 226 }
213 } 227 }