<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>账号资料-Smartcost</title>
    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/web/building_saas/css/main.css">
    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
    <!-- JS. -->
    <script src="/lib/jquery/jquery.min.js"></script>
    <script src="/lib/tether/tether.min.js"></script>
    <script src="/lib/bootstrap/bootstrap.min.js"></script>
    <script type="text/javascript" src="/lib/bootstrap/bootstrap-paginator.js"></script>
    <script src="/web/building_saas/js/global.js"></script>
</head>

<body>
<div class="header">
    <%include ../../common/html/header.html %>
</div>
<div class="main">
    <div class="poj-manage container-fluid">
        <div class="row">
            <div class="col-lg-2">
                <div class="poj-cate mt-3">
                    <ul class="nav nav-pills flex-column">
                        <li class="nav-item">
                            <a class="nav-link" href="/user/info">账号资料</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link active" href="/user/safe">账号安全</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="user-buy.html">产品购买</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="/user/preferences">偏好设置</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="col-lg-10">
                <div class="col-lg-4">
                    <legend class="my-3">账号安全</legend>
                    <from>
                        <div class="form-group">
                            <label class="form-control-label">登录密码</label>
                            <div class="form-control-static">
                                <button class="btn btn-secondary btn-sm">修改密码</button>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="form-control-label">邮箱地址</label>
                            <p class="form-control-static mb-0"><%= userData.email %><span
                                    class="badge badge-default">未验证</span></p>
                            <button class="btn btn-secondary btn-sm">验证邮箱</button>
                            <button class="btn btn-secondary btn-sm">更换邮箱</button>
                            <p class="form-control-static mb-0"><%= userData.email %><span
                                    class="badge badge-success">已验证</span></p>
                            <button class="btn btn-secondary btn-sm">更换邮箱</button>
                        </div>
                        <div class="form-group">
                            <label class="form-control-label">手机号码</label>
                            <p class="form-control-static mb-0"><%= userData.mobile %></p>
                            <button class="btn btn-secondary btn-sm">更换手机</button>
                            <div class="form-control-static">
                                <button class="btn btn-secondary btn-sm">添加手机</button>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="form-control-label">异常登录提醒</label>
                            <div class="form-control-static">
                                <label class="custom-control custom-checkbox" data-toggle="modal"
                                       data-target="#phoneTips">
                                    <input type="checkbox" class="custom-control-input">
                                    <span class="custom-control-indicator"></span>
                                    <span class="custom-control-description">开启</span>
                                </label>
                                <p class="text-muted">
                                    账号出现异常登录时将给你的手机号码发送通知。
                                </p>
                            </div>
                        </div>
                    </from>
                </div>
                <div class="mt-5">
                    <legend>访问日志</legend>
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th>系统</th>
                            <th>浏览器</th>
                            <th>访问日期</th>
                            <th>地址</th>
                        </tr>
                        </thead>
                        <tbody>
                        <% logList.forEach(function (log){ %>
                        <tr>
                            <td><%= log.message.os %></td>
                            <td><%= log.message.browser %></td>
                            <td><%= moment(log.create_time).format('YYYY-MM-DD HH:mm:ss') %></td>
                            <td><%= log.message.ip_info %>（<%= log.message.ip %>）</td>
                        </tr>
                        <% }) %>
                        </tbody>
                    </table>
                    <%include ../../common/html/page.html %>
                </div>
            </div>
        </div>
    </div>
</div>
<!--弹出异常登录提醒-->
<div class="modal fade" id="phoneTips" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-body">
                <p>开启异常登录提醒，需要先为您的通行账号添加手机号码。</p>
                <p><a class="btn btn-primary btn-sm" href="#">去添加手机</a></p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    autoFlashHeight();
</script>

</html>
