1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <extend name="Public:base" />
- <block name="head_script">
- <link href="__CSS__/member.css" rel="stylesheet" type="text/css">
- <link href="__PUBLIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
- </block>
- <block name="content">
- <div>
- <div class="container">
- <div class="row">
-
- <div id="content" class="col-sm-9">
- <div class="page-title">
- <h1>修改密码</h1>
- </div>
-
- <div class="alert alert-success hidden" role="alert">
- <button type="button" class="close"><span aria-hidden="true">×</span></button>
- <div id="success">修改成功</div>
- </div>
-
- <fieldset>
- <div class="form-group required clearfix">
- <label class="col-sm-2 control-label" for="input-password">密码</label>
- <div class="col-sm-10">
- <input id="input-password" class="form-control" type="password" name="password">
- </div>
- </div>
- <div class="form-group required clearfix">
- <label class="col-sm-2 control-label" for="input-password-1">密码确认</label>
- <div class="col-sm-10">
- <input id="input-password-1" class="form-control" type="password" name="password_re">
- </div>
- </div>
- </fieldset>
- <div class="buttons clearfix">
- <div class="left" style="margin-left:15px;">
- <button class="button continue " type="submit">提交</button>
- </div>
- </div>
-
- </div>
- <include file="User/side" />
- </div>
- </div>
- </div>
- </block>
- <block name="foot_script">
- <script type="text/javascript">
- $('.button').click(function(){
- $.ajax({
- url: '{$action}',
- type: 'post',
- data: $('input[type=\'password\']'),
- dataType: 'json',
- beforeSend: function() {
- $('#submit').attr('disabled', true);
- $('#submit').after('<span class="wait"> <img src="__IMG__/loading.gif" alt="" /></span>');
- },
- complete: function() {
- $('#submit').attr('disabled', false);
- $('.wait').remove();
- },
- success: function(json) {
- $('.warning, .error').remove();
-
- if (json['redirect']) {
- $('.alert-success').removeClass('hidden');
- setTimeout(function(){
- location = json['redirect']
- },2000);
- } else if (json['error']) {
-
- if (json['error']['password']) {
- $("input[name='password']").after('<span class="error">' + json['error']['password'] + '</span>');
- }
-
- if (json['error']['password_re']) {
- $("input[name='password_re']").after('<span class="error">' + json['error']['password_re'] + '</span>');
- }
-
- }
- },
- error: function(xhr, ajaxOptions, thrownError) {
- alert('修改失败');
- }
- });
- });
- $('.close').click(function(){
- $(this).parent().addClass('hidden');
- });
- </script>
- </block>
|