No Description
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.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. </head>
  17. <body class="reg retrieve">
  18. <div class="register_index ey-member">
  19. <div class="container">
  20. <form name='theForm' id="theForm" class="form-register panel-body fv-form">
  21. <div class="mip-reg-logo"><a href="{eyou:global name='web_cmsurl' /}" class="ey-logo"><img src="{eyou:global name='web_logo'/}" /></a></div>
  22. <div class="mip-reg-heading"><a class="nav-item " href="javascript:void(0)" style="cursor: unset;">找回密码</a></div>
  23. <div class="form-group group_z">
  24. <input type="text" name="email" id="email" class="form-control" placeholder="邮箱地址"/>
  25. </div>
  26. <div class="form-group group_z">
  27. <div class="formText">
  28. <input type="text" class="form-control" id="email_code" name="email_code" placeholder="邮箱验证码" />
  29. </div>
  30. <input type="button" id="email_code_button" onclick="send_email();" class="btn btn-primary sento" value="点击发送" />
  31. </div>
  32. {eyou:eq name="$is_vertify" value="1"}
  33. <div class="form-group group_z">
  34. <div class="input-group input-group-icon">
  35. <div class="formText">
  36. <input type="text" name="vertify" id="vertify" autocomplete="off" class="form-control" placeholder="图片验证码" />
  37. <img src="{eyou:url link='api/Ajax/vertify' vars='type=users_retrieve_password' /}" class="chicuele" id="imgVerifys" onClick="fleshVerify();">
  38. </div>
  39. </div>
  40. </div>
  41. {/eyou:eq}
  42. <button class="btn btn-lg btn-primary btn-block group_z" style="width: 100%;" onclick="check_submit();" type="button">下一步</button>
  43. <div class="login-link clearfix"><a class="fr tr" href="{eyou:url link='user/Users/login' /}">返回登录</a></div>
  44. </form>
  45. </div>
  46. </div>
  47. <script type="text/javascript">
  48. $(document).keydown(function(event){
  49. if(event.keyCode ==13){
  50. check_submit();
  51. }
  52. });
  53. function fleshVerify(){
  54. var src = "{eyou:url link='api/Ajax/vertify' vars='type=users_retrieve_password' /}";
  55. if (src.indexOf('?') > -1) {
  56. src += '&';
  57. } else {
  58. src += '?';
  59. }
  60. src += 'r='+ Math.floor(Math.random()*100);
  61. $('#imgVerifys').attr('src', src);
  62. }
  63. function check_submit()
  64. {
  65. var email = $('#email').val();
  66. var reg = /^[a-z0-9]([a-z0-9\\.]*[-_]{0,4}?[a-z0-9-_\\.]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+([\.][\w_-]+){1,5}$/i;
  67. // 邮箱格式不正确
  68. if(!reg.test(email)){
  69. layer.msg('邮箱格式不正确,请正确输入邮箱地址!', {time: 1500});
  70. return false;
  71. }
  72. var email_code = $('#email_code').val();
  73. if(email_code == ''){
  74. layer.msg('邮箱验证码不能为空', {time: 1000});
  75. return false;
  76. }
  77. layer_loading('正在处理');
  78. $.ajax({
  79. // async:false,
  80. url: "{eyou:url link='user/Users/retrieve_password' /}",
  81. data: $('#theForm').serialize(),
  82. type:'post',
  83. dataType:'json',
  84. success:function(res){
  85. layer.closeAll();
  86. if (res.code == 1) {
  87. window.location.href = res.url;
  88. } else {
  89. layer.msg(res.msg, {time: 2000, icon: 5});
  90. }
  91. },
  92. error : function(e) {
  93. layer.closeAll();
  94. showErrorAlert(e.responseText);
  95. }
  96. });
  97. };
  98. function send_email(email){
  99. var email = $('#email').val();
  100. var reg = /^[a-z0-9]([a-z0-9\\.]*[-_]{0,4}?[a-z0-9-_\\.]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+([\.][\w_-]+){1,5}$/i;
  101. // 邮箱格式不正确
  102. if(!reg.test(email)){
  103. layer.msg('邮箱格式不正确,请正确输入邮箱地址!', {time: 1500});
  104. return false;
  105. }
  106. $("#email_code_button").val('发送中…');
  107. $("#email_code_button").attr('disabled', 'disabled');
  108. layer_loading('正在处理');
  109. $.ajax({
  110. url: "{eyou:url link='user/Smtpmail/send_email' /}",
  111. data: {email:email,title:'找回密码',type:'retrieve_password',scene:4},
  112. type:'post',
  113. dataType:'json',
  114. success:function(res){
  115. layer.closeAll();
  116. if(res.code == 1){
  117. countdown();
  118. layer.msg(res.msg, {time: 1000});
  119. }else{
  120. $("#email_code_button").val('点击发送');
  121. $("#email_code_button").removeAttr("disabled");
  122. showErrorAlert(res.msg);
  123. }
  124. },
  125. error : function(e) {
  126. layer.closeAll();
  127. $("#email_code_button").val('点击发送');
  128. $("#email_code_button").removeAttr("disabled");
  129. showErrorAlert(e.responseText);
  130. }
  131. });
  132. };
  133. function countdown(){
  134. // 倒计时
  135. var setTime;
  136. var time = {php}echo config('global.email_send_time');{/php};
  137. setTime = setInterval(function(){
  138. if(0 >= time){
  139. clearInterval(setTime);
  140. return;
  141. }
  142. time--;
  143. $("#email_code_button").val(time+'秒');
  144. $("#email_code_button").attr('disabled', 'disabled');
  145. if(time == 0){
  146. $("#email_code_button").val('点击发送');
  147. $("#email_code_button").removeAttr("disabled");
  148. }
  149. },1000);
  150. }
  151. </script>
  152. </body>
  153. </html>