| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- var laveTime=20;
- function getCarCylinderInfo(){
-
- var carNo = $("#carNo").textbox('getValue');
- var regNo = $("#regNo").textbox('getValue');
- if(carNo){
- carCylinderInfo(carNo,regNo);
- }else{
- showMsg('提示', '车牌号必填!',5*1000);
- }
-
-
-
- }
- function carCylinderInfo(carNo,regNo){
- showProgress('提示','请稍等','查询加载中……');
- $.ajax({
- type:"POST",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- data:{
- "carNo":carNo,
- "regNo":regNo
- },
- url:"ajax/getCarCylinderInfo",
- success:function (data){
- $.messager.progress('close');
- var vData = $.parseJSON(data);
- if(vData.result==1){
- //window.open("jsp/carCylinderResult.jsp","_blank");
- window.location.href = 'jsp/carCylinderResult.jsp';
- //IE6
- window.event.returnValue = false;
- }
- }
- });
- }
- function getVCode(){
- var phone = $("#phone").textbox('getValue');
- if(phone){
- $("#vCode").linkbutton("disable");
- setInterval('setlaveTime(laveTime)',1000);
- $.ajax({
- type:"POST",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- data:{
- "phone":phone
- },
- url:"ajax/getVCode",
- success:function (data){
- $.messager.progress('close');
- var vData = $.parseJSON(data);
- showMsg('验证码', '您的验证码是:'+vData.code, 20*1000);
- document.getElementById("gettedCode").innerHTML="您获得的验证码是:"+vData.code;
- }
- });
- }else{
- showMsg('提示', '请输入手机号!', 5000);
- }
- }
-
- function setlaveTime(time){
- if(time>0){
- laveTime=time-1;
- document.getElementById("atext").innerHTML=laveTime+"秒后,可再次获取";
- }else{
- $("#vCode").linkbutton("enable");
- document.getElementById("atext").innerHTML="获取验证码";
- }
-
- }
- function testVCode(){
- if($("#codeform").form('validate')){
- showProgress('提示','请稍等','验证中……');
- $("#codeform").form("submit",{
- url: "ajax/testVCode",
- onsubmit: function () {
- return $(this).form("validate");
- },
- success: function (data) {
- $.messager.progress('close');
- var pData = $.parseJSON(data);
- switch(pData.result){
- case 0:{
- document.getElementById("errorInfo").innerHTML="验证码验证成功:跳转中……,请稍等!";
- showMsg('成功提示', '验证码验证成功:跳转中……,请稍等!', 2000);
- //window.open("jsp/peoplePage.jsp","_self");
-
- window.location.href = 'jsp/peoplePage.jsp';
- //IE6
- window.event.returnValue = false;
- }
- break;
- case -1:{
- document.getElementById("errorInfo").innerHTML="获取验证码失败:请刷新重试!";
- showMsg('异常提示', '获取验证码失败:请刷新重试!', 2000);
- }
- break;
- case -2:{
- document.getElementById("errorInfo").innerHTML="验证码不符:请检查验证码!";
- showMsg('异常提示', '验证码不符:请检查验证码!', 2000);
- }
- break;
- default:{
- document.getElementById("errorInfo").innerHTML="其他异常:请联系管理员!";
- showMsg('异常提示', '其他异常:请联系管理员!', 2000);
- };
- }
- },
- error:function(e){
- cancelAppend(index);
- $.messager.progress('close');
- console.log(e);
- },
- xhrFields: {
- withCredentials: true
- }
- });
- }else{
- showMsg('提示', '请输入手机号/验证码', 5000);
- }
- }
|