Ingen beskrivning
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.htm 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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-envelope-o"></i></span>
  27. <input type="text" name="email" id="email" class="form-control" placeholder="邮箱地址"/>
  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-envelope-o"></i></span>
  33. <div class="formText">
  34. <input type="text" class="form-control" id="email_code" name="email_code" placeholder="邮箱验证码" />
  35. </div>
  36. <input type="button" id="email_code_button" onclick="send_email();" 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){
  58. check_submit();
  59. }
  60. });
  61. function fleshVerify(){
  62. var src = "{eyou:url link='api/Ajax/vertify' vars='type=users_retrieve_password' /}";
  63. if (src.indexOf('?') > -1) {
  64. src += '&';
  65. } else {
  66. src += '?';
  67. }
  68. src += 'r='+ Math.floor(Math.random()*100);
  69. $('#imgVerifys').attr('src', src);
  70. }
  71. function check_submit()
  72. {
  73. var email = $('#email').val();
  74. var reg = /^[a-z0-9]([a-z0-9\\.]*[-_]{0,4}?[a-z0-9-_\\.]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+([\.][\w_-]+){1,5}$/i;
  75. // 邮箱格式不正确
  76. if(!reg.test(email)){
  77. layer.msg('邮箱格式不正确,请正确输入邮箱地址!', {time: 1500});
  78. return false;
  79. }
  80. var email_code = $('#email_code').val();
  81. if(email_code == ''){
  82. layer.msg('邮箱验证码不能为空', {time: 1000});
  83. return false;
  84. }
  85. layer_loading('正在处理');
  86. $.ajax({
  87. // async:false,
  88. url: "{eyou:url link='user/Users/retrieve_password' /}",
  89. data: $('#theForm').serialize(),
  90. type:'post',
  91. dataType:'json',
  92. success:function(res){
  93. layer.closeAll();
  94. if (res.code == 1) {
  95. window.location.href = res.url;
  96. } else {
  97. layer.msg(res.msg, {time: 2000, icon: 5});
  98. }
  99. },
  100. error : function(e) {
  101. layer.closeAll();
  102. showErrorAlert(e.responseText);
  103. }
  104. });
  105. };
  106. function send_email(email){
  107. var email = $('#email').val();
  108. var reg = /^[a-z0-9]([a-z0-9\\.]*[-_]{0,4}?[a-z0-9-_\\.]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+([\.][\w_-]+){1,5}$/i;
  109. // 邮箱格式不正确
  110. if(!reg.test(email)){
  111. layer.msg('邮箱格式不正确,请正确输入邮箱地址!', {time: 1500});
  112. return false;
  113. }
  114. $("#email_code_button").val('发送中…');
  115. $("#email_code_button").attr('disabled', 'disabled');
  116. layer_loading('正在处理');
  117. $.ajax({
  118. url: "{eyou:url link='user/Smtpmail/send_email' /}",
  119. data: {email:email,title:'找回密码',type:'retrieve_password',scene:4},
  120. type:'post',
  121. dataType:'json',
  122. success:function(res){
  123. layer.closeAll();
  124. if(res.code == 1){
  125. countdown();
  126. layer.msg(res.msg, {time: 1000});
  127. }else{
  128. $("#email_code_button").val('点击发送');
  129. $("#email_code_button").removeAttr("disabled");
  130. showErrorAlert(res.msg);
  131. }
  132. },
  133. error : function(e) {
  134. layer.closeAll();
  135. $("#email_code_button").val('点击发送');
  136. $("#email_code_button").removeAttr("disabled");
  137. showErrorAlert(e.responseText);
  138. }
  139. });
  140. };
  141. function countdown(){
  142. // 倒计时
  143. var setTime;
  144. var time = {php}echo config('global.email_send_time');{/php};
  145. setTime = setInterval(function(){
  146. if(0 >= time){
  147. clearInterval(setTime);
  148. return;
  149. }
  150. time--;
  151. $("#email_code_button").val(time+'秒');
  152. $("#email_code_button").attr('disabled', 'disabled');
  153. if(time == 0){
  154. $("#email_code_button").val('点击发送');
  155. $("#email_code_button").removeAttr("disabled");
  156. }
  157. },1000);
  158. }
  159. </script>
  160. </body>
  161. </html>