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 154 155 156 157 158 159 160 161 162 163 164 165 166
| <head> <meta charset="utf-8"> <title>会员注册</title> <link href="${pageContext.request.contextPath}/css/wedding-3.css" rel="stylesheet"/> <link href="${pageContext.request.contextPath}/css/wedding-2.css" rel="stylesheet"/> <link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <link href="${pageContext.request.contextPath}/bootstrapvalidator/css/bootstrapValidator.min.css" rel="stylesheet"> <script src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script> <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.min.js"></script> <script src="${pageContext.request.contextPath}/bootstrapvalidator/js/bootstrapValidator.min.js"></script>
<script>
var inter; function sendSMS() { var validator = $("#myForm").data('bootstrapValidator'); validator.validateField("user_tel"); var flag = validator.isValidField("user_tel"); if (flag) { inter = setInterval("showCount()",1000); $(".qrcode").attr("disabled",true); $.post("${pageContext.request.contextPath}/sms",{ "methodName":"sendSMS", "phoneNum":$("#user_tel").val() },function (data) { console.log(data); },"json"); } }
var count = 60; function showCount() { $(".qrcode").text(count+"S"); count--; if (count < 0 ) { clearInterval(inter); $(".qrcode").text("发送验证码"); count = 60; $(".qrcode").attr("disabled",false); } }
$(function () { $("#myForm").bootstrapValidator({ message:"this is no a valiad field", fields:{ user_tel:{ message: "手机号格式错误", validators:{ notEmpty:{ message:"手机号不能为空" }, stringLength:{ message:"手机号长度为11", min:11, max:11 }, regexp:{ message:"手机号格式不对", regexp: /^[1]{1}[1356789]{1}[0-9]+$/ } } }, user_password:{ message: "密码格式错误", validators:{ notEmpty:{ message:"密码不能为空" }, stringLength:{ message:"密码长度为6~8", min:6, max:8 }, regexp:{ message:"密码由小写字母、数字组成", regexp: /^[a-z0-9]+$/ }, different:{ message:"密码不能和手机号一致", field:"user_tel" } } }, qrCode:{ message:"验证码格式错误", validators:{ notEmpty:{ message:"验证码不能为空" }, stringLength:{ message:"验证码长度为4", min:4, max:4 } } } } }); }) </script> <style> .user-form-wraps{ width: 400px; } .user-form-button{ width: 320px; } </style> </head> <div id="public-toolbar" class="hidden_active user_adjust_public"> <div class="layout_center layout_clear"> <div class="page-logo layout_fl"> <a><img src="${pageContext.request.contextPath}/img/rxT54692503vu.jpg"></a> </div> <div class="page-tels layout_fr"> <span class="tel-show"> 全国免费咨询热线 </span> <span class="tel-pink"><strong>023-6766-4541</strong></span> </div> </div> </div> <div class="user-form" style="background:url(${pageContext.request.contextPath}/img/JQK51845110Xc.jpg)"> <div class="layout_center"> <div class="user-form-wrap"> <div class="user-form-wraps"> <div class="user-form-item"><strong class="user-form-title">会员注册</strong></div> <form id="myForm" action="${pageContext.request.contextPath}/user"> <input type="hidden" name="methodName" value="regist"/> <div class="user-form-item form-group"> <input name="user_tel" class="user-input" type="text" placeholder="手机号"> </div> <div class="user-form-item form-group"> <input name="user_password" class="user-input" type="password" placeholder="密码"> </div> <div class="user-form-item form-group"> <input name="qrCode" class="user-input user-input-adjust" type="text" placeholder="短信验证码"> <button type="button" class="qrcode" onclick="sendSMS()">发送验证码</button> </div> <div class="user-form-item"> <label> <input class="user-check" type="checkbox" checked="false" value="yes"> <span class="cos_span"> 登录即表示同意<a class="keyword-blue-pale">《119婚庆网用户协议》</a> </span> </label> </div> <div class="user-form-item form-group"> <button type="submit" class="user-form-button" style="font-weight: bold;">立即注册</button> </div> </form> <div class="user-form-item us_text_right"> <span class="cos_span"> <a href="${pageContext.request.contextPath}/center?methodName=toLogin">已有账户?立即登录</a> </span> </div> </div> </div> </div> </div>
|