1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
| $(function () { createCode(); $("#register").click(function(){ if(!checkForm()){ return; } var zjhm = aesMinEncrypt($("#zjhm").val()); var name = aesMinEncrypt($("#name").val()); var dzyx = aesMinEncrypt($("#dzyx").val()); var mm = aesMinEncrypt($("#mm").val()); var sjhm = aesMinEncrypt($("#sjhm").val());
var params = {'yzm':$("#J_codetext").val(), 'dsrlx':"1", 'zjlx':"1", 'zjhm': zjhm, 'name': name, 'dzyx': dzyx, 'mm': mm, 'sjhm': sjhm}; $.ajax({ url:"/user/create", data:params, type : 'post', cache : false, dataType : 'json', success : function(data) { console.log(data); if(data.success){ console.log(data); layer.open({ content : "注册成功", time : 1, }); autoLogin($("#zjhm").val(),$("#mm").val()); }else{ layer.open({ content : data.msg, time : 1, }); createCode(); } } }); });
function checkForm(){ var name = $("#name").val(); if(name == null || name == ""){ layer.open({ content : "请输入姓名", time : 1, }); return false; } var zjhm = $("#zjhm").val(); if(zjhm == null || zjhm == ""){ layer.open({ content : "请输入证件号码", time : 1, }); return false; } var sjhm = $("#sjhm").val(); if(sjhm == null || sjhm == ""){ layer.open({ content : "请输入手机号码", time : 1, }); return false; } var mm = $("#mm").val(); if(mm == null || mm == ""){ layer.open({ content : "请输入密码", time : 1, }); return false; } var qrmm = $("#qrmm").val(); if(qrmm == null || qrmm == ""){ layer.open({ content : "请输入确认密码", time : 1, }); return false; } if (mm != qrmm) { layer.open({ content : "密码与确认密码不一致", time : 1, }); return false; } if(!validate()){ layer.open({ content : "验证码输入错误", time : 1, }); return false; } if (!$("#ydxy").is(':checked')) { layer.open({ content : "请同意《微信预约立案协议》", time : 1, }); return false; } return true; } }); function autoLogin(idcard, password) { $.post('/user/doLogin', { idcard : idcard, password : password, }, function(data) { if (data.success) { var to = getValue('to'); if (to != null && to != '') { if (to == 'bz') url = '../prereapply.html'; if (to == 'ycbz') url = '../personalIndex.html'; if (to == 'yyla') url = '../personalPor.html'; if(to=='set') url = '../personalSeting.html'; if(to=="yy") url = '../order.html'; if(to=="rz") url = '../authe/inputCode.html'; if(to=="grzxsfyz") url = '../authe/personalAuthe.html'; if(to=="wdaj") url = '../wdaj/ajlb.html'; } window.setTimeout(redrect, 1000); } }); }
function validate() { var inputCode = document.getElementById("J_codetext").value.toUpperCase(); var codeToUp = code.toUpperCase(); if (inputCode.length <= 0) { createCode(); return false; } else if (inputCode != codeToUp) { document.getElementById("J_codetext").value = ""; createCode(); return false; } else { createCode(); return true; } }
|