| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297 |
- <!DOCTYPE HTML>
- <html xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{admin/common/common}">
- <head>
- <title>忘记密码</title>
- <style>
- label.error {
- left: 15px;
- top: 29px
- }
- #filePicker div:nth-child(2) {
- width: 100% !important;
- height: 100% !important;
- }
- .ke-container {
- width: 100% !important;
- }
- .ke-swfupload-body {
- height: 265px
- }
- .ke-dialog-body {
- height: 340px !important;
- }
- .ke-dialog-default {
- height: 410px !important;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <article class="page-container">
- <form class="form form-horizontal" id="form-information-add">
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span></label>
- <div class="formControls col-xs-8 col-sm-9">
- <label>有“<span class="c-red">*</span>”的为必填项</label>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>账号名:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <div class="add_contact">
- <p><input type="text" required class="ml_50 width_200 input-text nick_name" th:name="nick_name"
- th:id="nick_name"
- placeholder="请输入账号名"/></p>
- </div>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>手机号:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <div class="add_contact">
- <p><input type="text" required isMobile="true" class="ml_50 width_200 input-text phone"
- placeholder="请输入手机号" th:name="phone" th:id="phone"/></p>
- <input id="verificationCode" onClick="getVerificationCode()" type="button"
- class="btn btn-primary radius" value="获取验证码"/>
- </div>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>验证码:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <div class="add_contact">
- <p><input type="text" required class="ml_50 width_200 input-text" th:name="validateNum"
- placeholder="请输入短信验证码"/></p>
- </div>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>新密码:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <div class="add_contact">
- <p><input type="password" required class="ml_50 width_200 input-text " th:name="password"
- placeholder="请至少输入六个字符" th:id="password"/></p>
- </div>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>确认密码:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <div class="add_contact">
- <p><input type="password" required class="ml_50 width_200 input-text " th:name="repassword"
- placeholder="请再次输入密码"/></p>
- </div>
- </div>
- </div>
- <div class="row cl">
- <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
- <button class="btn btn-primary radius" type="submit">提交</button>
- <button onClick="removeIframe();" class="btn btn-default radius" type="button"> 取消 </button>
- </div>
- </div>
- </form>
- </article>
- <script th:inline="javascript">
- /**
- * 取消
- */
- function removeIframe() {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- }
- var contact_index = 0;
- //获取验证码
- function getVerificationCode() {
- var nick_name = $("#nick_name").val();
- if (nick_name) {
- if (!nick_name.trim()) {
- errorMessage('请输入账号名!');
- return;
- }
- } else {
- errorMessage('请输入账号名!');
- return;
- }
- var phone = $("#phone").val();
- var v_regex = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
- if (phone) {
- if (v_regex.test(phone)) {
- //startCountDown();
- sendVerificationCode(phone, nick_name);
- } else {
- errorMessage('手机号码格式不正确!');
- }
- } else {
- errorMessage('请输入手机号码!');
- }
- }
- //校验手机号码是否已被使用
- function checkPhoneNumber(phone) {
- $.ajax({
- dataType: "json",
- contentType: "application/json;charset=utf-8",
- url: pagePath + "/company/companyInfoManage/getPhone",
- type: "get",
- sync: true,
- data: {
- phone: phone
- },
- success: function (result) {
- if (result) {
- sendVerificationCode(phone);
- } else {
- errorMessage('该手机号码已被注册!');
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- //发送验证码
- function sendVerificationCode(phone, nick_name) {
- $.ajax({
- contentType: "application/json;charset=utf-8",
- dataType: "json",
- url: pagePath + "/home/sendVerificationCodePhoneAndName",
- type: "get",
- sync: true,
- data: {
- phone: phone,
- nickname: nick_name
- },
- success: function (result) {
- if (result.success) {
- succeedMessage(result.message);
- startCountDown();
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- //验证码倒计时
- function startCountDown() {
- var second = 60;//时间默认值
- $("#verificationCode").attr("disabled", true);
- var timer = null;
- timer = setInterval(function () {
- $("#verificationCode").val(second + "秒后重发")
- second--;
- if (second < 0) {
- $("#verificationCode").attr("disabled", false);
- $("#verificationCode").val("获取验证码")
- clearInterval(timer);
- }
- }, 1000);
- }
- //保存企业信息
- $("#form-information-add").validate({
- rules: {
- nick_name: {
- minlength: 1,
- maxlength: 60,
- /*remote: {
- url: pagePath + "/company/companyInfoManage/getNickNameIsExist",
- type: "get",
- data: {
- nick_name: function () {
- return $("#nick_name").val();
- },
- id: ''
- }
- },*/
- },
- phone: {
- minlength: 1,
- maxlength: 20,
- /*remote: {
- url: pagePath + "/company/companyInfoManage/getPhone",
- type: "get",
- data: {
- company_name: function () {
- return $("#phone").val();
- },
- id: ''
- }
- },*/
- phone: true
- },
- isphone: {
- minlength: 1,
- maxlength: 20,
- phone: true
- },
- validateNum: {
- minlength: 1,
- maxlength: 20
- },
- password: {
- minlength: 6,
- maxlength: 20
- // password: true,
- },
- repassword: {
- minlength: 6,
- maxlength: 20,
- repassword: true
- }
- },
- messages: {
- phone: {
- remote: "该手机号码已被注册!"
- },
- nick_name: {
- remote: "账号名不存在!"
- }
- },
- //debug:true,
- onkeyup: false,
- focusCleanup: true,
- success: "valid",
- submitHandler: function (form) {
- $(form).ajaxSubmit({
- type: 'post',
- url: pagePath + "/home/reset",
- dataType: "json",
- success: function (data) {
- if (data.success) {
- succeedMessage(data.message);
- setTimeClose();
- } else {
- errorMessage(data.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- return false; // 非常重要,如果是false,则表明是不跳转,在本页上处理,也就是ajax,如果是非false,则传统的form跳转。
- }
- });
- </script>
- </body>
- </html>
|