Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

retrieve_password_mobile.htm 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>找回密码-{eyou:global name='web_name' /}</title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
  9. <link href="{eyou:global name='web_cmspath' /}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
  10. {eyou:static file="users/skin/css/basic.css" /}
  11. {eyou:static file="users/skin/css/eyoucms.css" /}
  12. {eyou:include file="users/skin/css/diy_css.htm" /}
  13. {eyou:static file="/public/static/common/js/jquery.min.js"/}
  14. {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
  15. {eyou:static file="users/skin/js/global.js" /}
  16. {eyou:static file="/public/static/common/js/mobile_global.js"/}
  17. </head>
  18. <body class="reg retrieve">
  19. <div class="register_index ey-member">
  20. <div class="container">
  21. <form name='theForm' id="theForm" class="form-register panel-body fv-form">
  22. <div class="mip-reg-logo"><a href="{eyou:global name='web_cmsurl' /}" class="ey-logo"><img src="{eyou:global name='web_logo'/}" /></a></div>
  23. <div class="mip-reg-heading">找回密码</div>
  24. <div class="form-group">
  25. <div class="input-group">
  26. <span class="input-group-addon"><i class="fa fa-mobile"></i></span>
  27. <input type="text" name="mobile" id="mobile" class="form-control" placeholder="手机号码" maxlength="11"/>
  28. </div>
  29. </div>
  30. <div class="form-group">
  31. <div class="input-group btn-direction">
  32. <span class="input-group-addon"><i class="fa fa-shield"></i></span>
  33. <div class="formText">
  34. <input type="text" class="form-control" id="mobile_code" name="mobile_code" placeholder="手机验证码" />
  35. </div>
  36. <input type="button" id="mobile_button" onclick="get_mobile_code();" class="btn btn-primary sento" value="获取验证码" />
  37. </div>
  38. </div>
  39. {eyou:eq name="$is_vertify" value="1"}
  40. <div class="form-group">
  41. <div class="input-group input-group-icon">
  42. <span class="input-group-addon"><i class="fa fa-shield"></i></span>
  43. <div class="formText">
  44. <input type="text" name="vertify" id="vertify" autocomplete="off" class="form-control" placeholder="图片验证码" />
  45. <img src="{eyou:url link='api/Ajax/vertify' vars='type=users_retrieve_password' /}" class="chicuele" id="imgVerifys" onClick="fleshVerify();">
  46. </div>
  47. </div>
  48. </div>
  49. {/eyou:eq}
  50. <button class="btn btn-lg btn-primary btn-block" style="width: 100%;" onclick="check_submit();" type="button">下一步</button>
  51. <div class="login_link"><a href="{eyou:url link='user/Users/login' /}">返回登录</a></div>
  52. </form>
  53. </div>
  54. </div>
  55. <script type="text/javascript">
  56. $(document).keydown(function(event){
  57. if(event.keyCode ==13) check_submit();
  58. });
  59. function fleshVerify(){
  60. var src = "{eyou:url link='api/Ajax/vertify' vars='type=users_retrieve_password' /}";
  61. if (src.indexOf('?') > -1) {
  62. src += '&';
  63. } else {
  64. src += '?';
  65. }
  66. src += 'r='+ Math.floor(Math.random()*100);
  67. $('#imgVerifys').attr('src', src);
  68. }
  69. function check_submit()
  70. {
  71. var mobile = $("#mobile").val();
  72. // 手机号是否为空
  73. if (!mobile) {
  74. $("#mobile").focus();
  75. layer.msg('请输入手机号码!', {time: 1500});
  76. return false;
  77. }
  78. // 手机格式不正确
  79. var reg = /^1[0-9]{10}$/i;
  80. if (!reg.test(mobile)) {
  81. $("#mobile").focus();
  82. layer.msg('请输入正确的手机号码!', {time: 1500});
  83. return false;
  84. }
  85. var mobile_code = $("#mobile_code").val();
  86. // 手机验证码是否为空
  87. if (!mobile_code) {
  88. $("#mobile_code").focus();
  89. layer.msg('请输入手机验证码!', {time: 1500});
  90. return false;
  91. }
  92. layer_loading('正在处理');
  93. $.ajax({
  94. url: "{eyou:url link='user/Users/retrieve_password_mobile' /}",
  95. data: $('#theForm').serialize(),
  96. type:'post',
  97. dataType:'json',
  98. success:function(res){
  99. layer.closeAll();
  100. if (res.code == 1) {
  101. window.location.href = res.url;
  102. } else {
  103. layer.msg(res.msg, {time: 2000, icon: 5});
  104. }
  105. },
  106. error : function(e) {
  107. layer.closeAll();
  108. showErrorAlert(e.responseText);
  109. }
  110. });
  111. };
  112. function get_mobile_code() {
  113. var mobile = $("#mobile").val();
  114. // 手机号是否为空
  115. if (!mobile) {
  116. $("#mobile").focus();
  117. layer.msg('请输入手机号码!', {time: 1500});
  118. return false;
  119. }
  120. // 手机格式不正确
  121. var reg = /^1[0-9]{10}$/i;
  122. if (!reg.test(mobile)) {
  123. $("#mobile").focus();
  124. layer.msg('请输入正确的手机号码!', {time: 1500});
  125. return false;
  126. }
  127. // 设置为不可点击
  128. $("#mobile_button").val('获取中…').attr('disabled', 'disabled');
  129. layer_loading('正在处理');
  130. $.ajax({
  131. url: '{$RootDir}/index.php?m=api&c=Ajax&a=SendMobileCode&_ajax=1',
  132. data: {mobile: mobile, is_mobile: true, source: 4},
  133. type:'post',
  134. dataType:'json',
  135. success:function(res){
  136. layer.closeAll();
  137. if (res.code == 1) {
  138. countdown();
  139. layer.msg(res.msg, {time: 1500});
  140. } else {
  141. $("#mobile_button").val('获取验证码').removeAttr("disabled");
  142. showErrorAlert(res.msg);
  143. }
  144. },
  145. error : function(e) {
  146. layer.closeAll();
  147. $("#mobile_button").val('获取验证码').removeAttr("disabled");
  148. showErrorAlert(e.responseText);
  149. }
  150. });
  151. };
  152. function countdown() {
  153. // 倒计时
  154. var setTime;
  155. var time = 120;
  156. setTime = setInterval(function() {
  157. if(0 >= time){
  158. clearInterval(setTime);
  159. return;
  160. }
  161. time--;
  162. $("#mobile_button").val(time+'秒').attr('disabled', 'disabled');
  163. if(time == 0) $("#mobile_button").val('获取验证码').removeAttr("disabled");
  164. }, 1000);
  165. };
  166. </script>
  167. </body>
  168. </html>