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="email" class="form-control" type="text" name="email" value="{$account.email|default=''}" />
- </div>
- </div>
- <div class="form-group clearfix">
- <label class="col-sm-2 control-label" for="input-password-1">手机号码</label>
- <div class="col-sm-10">
- <input id="tel" class="form-control" type="text" name="tel" value="{$account.telephone|default=''}" />
- </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=\'text\']'),
- 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']['email']) {
- $("input[name='email']").after('<span class="error">' + json['error']['email'] + '</span>');
- }
-
- if (json['error']['tel']) {
- $("input[name='tel']").after('<span class="error">' + json['error']['tel'] + '</span>');
- }
-
- }
- },
- error: function(xhr, ajaxOptions, thrownError) {
- alert('修改失败');
- }
- });
- });
- $('.close').click(function(){
- $(this).parent().addClass('hidden');
- });
- </script>
- </block>
|