<!--{include file="<!--{$tplpath}-->block_header.tpl"}-->
<!-------------------------------------- 头部结束 -------------------------------------->
    <link rel="stylesheet" href="<!--{$skinpath}-->assets/css/main.css">

<!-------------------------------------- 主体开始 -------------------------------------->
<style>

    .bind-form label {
        display: inline-block;
        *zoom: 1;
        *display: inline;
        width: 60px;
        font-size: 14px;
        margin-left: 20px;
    }
</style>
<div class="page-main user-main">
  <div class="container">
    <!--{if !empty($check)}-->
    <div class="row">
      <div class="span4">
          <div class="uc-box uc-sub-box">
              <div class="uc-nav-box">
                  <div class="box-hd">
                      <h3 class="title">个人中心</h3>
                  </div>
                  <div class="box-bd">
                      <ul class="uc-nav-list J_navList">
                          <li><a class="J_noRandom" href="index.php?c=user">我的个人中心</a></li>
                          <li><a class="J_noRandom" href="./index.php?c=user&a=user_info">个人信息</a></li>
                          <li><a class="J_noRandom" href="./index.php?c=user&a=profit">我的收益</a></li>
                          <li><a class="J_noRandom" href="index.php?c=user&a=share">我的推广</a></li>
                          <li><a class="J_noRandom" href="./index.php?c=user&a=user_address">收货地址</a></li>
                          <li  class="active"><a class="J_noRandom" href="./index.php?c=user&a=user_edit">修改密码</a></li>
                      </ul>
                  </div>
              </div>
              <div class="uc-nav-box">
                  <div class="box-hd">
                      <h3 class="title">订单中心</h3>
                  </div>
                  <div class="box-bd">
                      <ul class="uc-nav-list J_navList">
                          <li><a class="J_noRandom" href="./index.php?c=user&a=order_list">我的订单</a></li>
                      </ul>
                  </div>
              </div>
          </div>
      </div>
      <div class="span16">
        <div class="uc-box uc-main-box">
          <div class="uc-content-box order-list-box">
            <div class="box-hd">
              <h1 class="title">帐号密码</h1>
            </div>
            <div class="box-bd" style="margin-top: 5%;">

                  <div class="bind-form">

                      <input class="input-text J_addressInput" type="password" id="oldpwd" name="oldpwd" placeholder="请输入原密码" value="" style="height: 20px; width: 180px;">
                  </div>
                  <br/>
                  <div class="bind-form">

                      <input class="input-text J_addressInput" type="password" id="newpwd" name="newpwd" placeholder="请输入新密码" value=""  style="height: 20px; width: 180px;">
                  </div>
                  <br/>
                  <div class="bind-form">

                      <input class="input-text J_addressInput" type="password" id="aginpwd" name="aginpwd" placeholder="请再次输入新密码" value="" style="height: 20px; width: 180px;">
                  </div>
                  <div class="action" style="margin-left: 20px; margin-top: 5%;">
                      <a class="btn btn-primary" href="javascript:void(0)" id="edit_btn">修改</a>
                  </div>

            </div>
          </div>
        </div>
      </div>
    </div>
      <!--{else}-->
      <a class="btn btn-primary" href="./index.php?c=user&a=login">去登录</a>
      <!--{/if}-->
  </div>
</div>

<script>
    $(function(){
        $("#edit_btn").bind("click", function(){ //提交

            $oldpwd=$("[name=oldpwd]").val();
            $newpwd=$("[name=newpwd]").val();
            $aginpwd=$("[name=aginpwd]").val();

            $.ajax({
                type: "POST",
                url: "index.php?c=user&a=ajaxeditpwd",
                cache: false,
                data: {oldpwd:$oldpwd,newpwd:$newpwd,aginpwd:$aginpwd},
                dataType: "json",
                success: function(data) {
                    var json = eval(data);
                    var response = json.response;
                    var result = json.result;
                    if (response == "1") {
                        layer.msg(result, {icon: 1});

                        setTimeout( function(){
                            window.location.reload();
                        }, 1 * 1000 );//延迟5000毫米

                    }
                    else {
                        layer.msg(result, {icon: 5});
                    }
                },


            });

        });

    });
</script>


<!--{include file="<!--{$tplpath}-->botton.tpl"}-->