forgot.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <extend name="Public:base" />
  2. <block name="head_script">
  3. <link href="__CSS__/member.css" rel="stylesheet" type="text/css">
  4. <link href="__PUBLIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  5. </block>
  6. <block name="content">
  7. <div>
  8. <div class="container">
  9. <div class="row">
  10. <div id="content" class="col-sm-9">
  11. <div class="page-title">
  12. <h1>忘记密码?</h1>
  13. </div>
  14. <p>输入您账户的邮箱,系统将把重置的密码发到您的邮箱上。</p>
  15. <div class="alert alert-success hidden" role="alert">
  16. <button type="button" class="close"><span aria-hidden="true">&times;</span></button>
  17. <div id="success">密码重置成功,已发送到您的邮箱</div>
  18. </div>
  19. <fieldset>
  20. <div class="form-group required clearfix">
  21. <label class="col-sm-2 control-label" for="input-password">电子邮箱</label>
  22. <div class="col-sm-10">
  23. <input id="email" class="form-control" type="text" name="email" />
  24. </div>
  25. </div>
  26. </fieldset>
  27. <div class="buttons clearfix">
  28. <div class="left" style="margin-left:15px;">
  29. <button class="button continue " id="submit" type="submit">提交</button>
  30. </div>
  31. </div>
  32. </div>
  33. <include file="User/side" />
  34. </div>
  35. </div>
  36. </div>
  37. </block>
  38. <block name="foot_script">
  39. <script type="text/javascript">
  40. $('.button').click(function(){
  41. $.ajax({
  42. url: '{$action}',
  43. type: 'post',
  44. data: $('input[type=\'text\']'),
  45. dataType: 'json',
  46. beforeSend: function() {
  47. $('#submit').attr('disabled', true);
  48. $('#submit').after('<span class="wait">&nbsp;<img src="__IMG__/loading.gif" alt="" /></span>');
  49. },
  50. complete: function() {
  51. $('#submit').attr('disabled', false);
  52. $('.wait').remove();
  53. },
  54. success: function(json) {
  55. $('.warning, .error').remove();
  56. if (json['redirect']) {
  57. $('.alert-success').removeClass('hidden');
  58. setTimeout(function(){
  59. location = json['redirect']
  60. },5000);
  61. } else if (json['error']) {
  62. if (json['error']['email']) {
  63. $("input[name='email']").after('<span class="error">' + json['error']['email'] + '</span>');
  64. }
  65. }
  66. },
  67. error: function(xhr, ajaxOptions, thrownError) {
  68. alert('修改失败');
  69. }
  70. });
  71. });
  72. $('.close').click(function(){
  73. $(this).parent().addClass('hidden');
  74. });
  75. </script>
  76. </block>