暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

retrieve_password_mobile.htm 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. <div class="input-group">
  25. <input type="text" name="mobile" id="mobile" class="form-control" placeholder="手机号码" maxlength="11"/>
  26. </div>
  27. </div>
  28. <div class="form-group group_z">
  29. <div class="input-group btn-direction">
  30. <div class="formText">
  31. <input type="text" class="form-control" id="mobile_code" name="mobile_code" placeholder="手机验证码" />
  32. </div>
  33. <input type="button" id="mobile_button" onclick="get_mobile_code();" class="btn btn-primary sento" value="获取验证码" />
  34. </div>
  35. </div>
  36. {eyou:eq name="$is_vertify" value="1"}
  37. <div class="form-group group_z">
  38. <div class="input-group input-group-icon">
  39. <div class="formText">
  40. <input type="text" name="vertify" id="vertify" autocomplete="off" class="form-control" placeholder="图片验证码" />
  41. <img src="{eyou:url link='api/Ajax/vertify' vars='type=users_retrieve_password' /}" class="chicuele" id="imgVerifys" onClick="fleshVerify();">
  42. </div>
  43. </div>
  44. </div>
  45. {/eyou:eq}
  46. <button id="submitButton" class="btn btn-lg btn-primary btn-block group_z h60 disabled-button" style="width: 100%;" onclick="check_submit();" type="button" disabled="disabled">下一步</button>
  47. <div class="login-link clearfix"><a class="fr tr" href="{eyou:url link='user/Users/login' /}">返回登录</a></div>
  48. </form>
  49. </div>
  50. </div>
  51. <script type="text/javascript">
  52. $(document).keydown(function(event){
  53. if(event.keyCode ==13) check_submit();
  54. });
  55. function fleshVerify(){
  56. var src = "{eyou:url link='api/Ajax/vertify' vars='type=users_retrieve_password' /}";
  57. if (src.indexOf('?') > -1) {
  58. src += '&';
  59. } else {
  60. src += '?';
  61. }
  62. src += 'r='+ Math.floor(Math.random()*100);
  63. $('#imgVerifys').attr('src', src);
  64. }
  65. var input = document.getElementById('mobile');
  66. var input = document.getElementById('mobile_code');
  67. {eyou:eq name="$is_vertify" value="1"}
  68. var input = document.getElementById('vertify');
  69. {/eyou:eq}
  70. var submitButton = document.getElementById('submitButton');
  71. input.addEventListener('input', function() {
  72. if (input.value.length > 0) {
  73. submitButton.disabled = false;
  74. submitButton.classList.remove('disabled-button');
  75. submitButton.classList.add('enabled-button');
  76. } else {
  77. submitButton.disabled = true;
  78. submitButton.classList.remove('enabled-button');
  79. submitButton.classList.add('disabled-button');
  80. }
  81. });
  82. function check_submit()
  83. {
  84. var mobile = $("#mobile").val();
  85. // 手机号是否为空
  86. if (!mobile) {
  87. $("#mobile").focus();
  88. layer.msg('请输入手机号码!', {time: 1500});
  89. return false;
  90. }
  91. // 手机格式不正确
  92. var reg = /^1[0-9]{10}$/i;
  93. if (!reg.test(mobile)) {
  94. $("#mobile").focus();
  95. layer.msg('请输入正确的手机号码!', {time: 1500});
  96. return false;
  97. }
  98. var mobile_code = $("#mobile_code").val();
  99. // 手机验证码是否为空
  100. if (!mobile_code) {
  101. $("#mobile_code").focus();
  102. layer.msg('请输入手机验证码!', {time: 1500});
  103. return false;
  104. }
  105. layer_loading('正在处理');
  106. $.ajax({
  107. url: "{eyou:url link='user/Users/retrieve_password_mobile' /}",
  108. data: $('#theForm').serialize(),
  109. type:'post',
  110. dataType:'json',
  111. success:function(res){
  112. layer.closeAll();
  113. if (res.code == 1) {
  114. window.location.href = res.url;
  115. } else {
  116. layer.msg(res.msg, {time: 2000, icon: 5});
  117. }
  118. },
  119. error : function(e) {
  120. layer.closeAll();
  121. showErrorAlert(e.responseText);
  122. }
  123. });
  124. };
  125. function get_mobile_code() {
  126. var mobile = $("#mobile").val();
  127. // 手机号是否为空
  128. if (!mobile) {
  129. $("#mobile").focus();
  130. layer.msg('请输入手机号码!', {time: 1500});
  131. return false;
  132. }
  133. // 手机格式不正确
  134. var reg = /^1[0-9]{10}$/i;
  135. if (!reg.test(mobile)) {
  136. $("#mobile").focus();
  137. layer.msg('请输入正确的手机号码!', {time: 1500});
  138. return false;
  139. }
  140. // 设置为不可点击
  141. $("#mobile_button").val('获取中…').attr('disabled', 'disabled');
  142. layer_loading('正在处理');
  143. $.ajax({
  144. url: '{$RootDir}/index.php?m=api&c=Ajax&a=SendMobileCode&_ajax=1',
  145. data: {mobile: mobile, is_mobile: true, source: 4},
  146. type:'post',
  147. dataType:'json',
  148. success:function(res){
  149. layer.closeAll();
  150. if (res.code == 1) {
  151. countdown();
  152. layer.msg(res.msg, {time: 1500});
  153. } else {
  154. $("#mobile_button").val('获取验证码').removeAttr("disabled");
  155. showErrorAlert(res.msg);
  156. }
  157. },
  158. error : function(e) {
  159. layer.closeAll();
  160. $("#mobile_button").val('获取验证码').removeAttr("disabled");
  161. showErrorAlert(e.responseText);
  162. }
  163. });
  164. };
  165. function countdown() {
  166. // 倒计时
  167. var setTime;
  168. var time = 120;
  169. setTime = setInterval(function() {
  170. if(0 >= time){
  171. clearInterval(setTime);
  172. return;
  173. }
  174. time--;
  175. $("#mobile_button").val(time+'秒').attr('disabled', 'disabled');
  176. if(time == 0) $("#mobile_button").val('获取验证码').removeAttr("disabled");
  177. }, 1000);
  178. };
  179. </script>
  180. </body>
  181. </html>