<extend name="Public/bases" />
<block name="body" >
  <link href="__CSS__/user.css" rel="stylesheet" >
  <body class="user">
    <header class="header">
      <div class="">
        <a href="{:U('User/index')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
        <h1 class="caption">设置</h1>
        <!-- <a href="userset.html" class="hbtn set">编辑资料</a> -->
      </div>
    </header>
    <div class="occupy"></div>
    <section class="trunker">
      <section class="container">
            <div class="t-table user-set-list">
              <ul class="table clearfix">
                <li class="table-row">
                  <span class="table-cell">头像</span>
                  <span class="table-cell">
                    <a href="javascript:;" class="portraitbtn"><img src="{$user['head_img']}" class="portrait"></a>
                  </span>
                </li>
                <li class="table-row">
                  <span class="table-cell">账号</span>
                  <span class="table-cell">
                    {$user.account}
                  </span>
                </li>
                <li class="table-row">
                  <span class="table-cell">昵称</span>
                  <span class="table-cell">
                    <a href="{:U('usernick')}" class="nick">{$user['nickname']}<i class="iconfont icon-drop-right"></i></a>
                  </span>
                </li>
                <li class="table-row">
                  <span class="table-cell">绑定手机</span>
                  <span class="table-cell">
                    <a href="{:U('userphone')}" class="auth on"><empty name="user.phone">去绑定<else/>已绑定</empty><i class="iconfont icon-drop-right"></i></a>
                  </span>
                </li>
             
                <li class="table-row">
                  <span class="table-cell">性别</span>
                  <span class="table-cell">
                    <a href="{:U('User/usersex')}" class="sex"><if condition="$user['sex'] == 0">男<else/>女</if><i class="iconfont icon-drop-right"></i></a>
                  </span>
                </li>

                <li class="table-row">
                  <span class="table-cell">实名认证</span>
                    <span class="table-cell">
                      <switch name='user["age_status"]'>
                        <case value="0">
                          <a href="{:U('User/userauth')}" class="auth on">未认证<i class="iconfont icon-drop-right"></i></a>
                        </case>
                        <case value="2">
                          <a href="{:U('User/userauth')}" class="auth on">已认证<i class="iconfont icon-drop-right"></i></a>
                        </case>
                        <case value="3">
                          <a href="{:U('User/userauth')}" class="auth on">未成年<i class="iconfont icon-drop-right"></i></a>
                        </case>
                        <default /><a href="{:U('User/userauth')}" class="auth on">未认证<i class="iconfont icon-drop-right"></i></a>
                      </switch>
                  </span>
                </li>
								<li class="table-row">
                  <span class="table-cell">绑定支付宝</span>
                  <span class="table-cell">
										<notempty name="user.alipay">
                    <a href="javascript:;" class="alipay on">{:str_replace(substr($user['alipay'],3,-3),'*****',$user['alipay'])},{:mb_substr($user['alipay_real_name'],0,1,'utf-8').'**'}</a>
										<else />
                    <a href="{:U('alipay')}" class="alipay on">未绑定<i class="iconfont icon-drop-right"></i></a>
										</notempty>
                  </span>
                </li>
                <li class="table-row">
                  <span class="table-cell">修改密码</span>
                  <span class="table-cell">
                    <a href="{:U('userpassword')}" class="password"><i class="iconfont icon-drop-right"></i></a>
                  </span>
                </li>
                <li class="table-row">
                  <span class="table-cell">管理收货地址</span>
                  <span class="table-cell"><a href="{:U('User/useraddresslist')}" class="address"><i class="iconfont icon-drop-right"></i></a></span>
                </li>
              </ul>
            </div>
            <div class="btnbox user-set-btnbox">
              <a href="javascript:;" class="btn jsquit">退出登录</a>
            </div>
      </section>
    </section>
    <div class="space"></div>

    <div class="pop pop-window">
      <div class="pop-box pop-sign">
        <div class="pop-wrap"></div>
      </div>
    </div>
    
    <div class="popmsg pop-dialog"></div>
    <script src="__JS__/pop.lwx.min.js"></script>
    <script>
      $(function() {
        var pmsg = $('.popmsg').pop();

        $('.portraitbtn').click(function() {
            //pmsg.msg('请到PC端网站或APP应用上更改');
            var pop = $('.pop').addClass('pop-head').pop();
            pop.open(800,'<h2 class="pop-title"><span>请到APP上更改头像</span><a href="javascript:;" class="pop-close">X</a></h2><div class="pop-btnbox"><a href="/media.php?s=/Index/download.html" class="pop-btn">去下载APP</a></div>');
            pop.find('.pop-close').click(function() {pop.close()});
        });

        $(".jsquit").click(function(){
          $.ajax({
            url:"{:U('base/logout')}",
            type:"post",
            dataType:"json",
            success:function(result){
              pmsg.msg(result.msg);
              setTimeout(function () {
                window.location.href = "{:U('Index/index')}";
              }, 2000);  
            },
            error:function(){
              
            }
          })
        })

      });

      
    </script>
  </body>
</block>