@using PageAdmin.Utils;
@{
    Layout = null;
    string lastTime = null, lastIp = null, logins = null;
    dynamic userData = ViewBag.CurrentUserData;
    if (userData != null)
    {
        lastTime = userData.LastDate.ToString("yyyy-MM-dd HH:mm:ss");
        lastIp = userData.LastIp.ToString();
        logins = userData.Logins.ToString();
    }
    CurrentUser user = (CurrentUser)ViewBag.CurrentUser;
    int bindEmailState = (int)ViewBag.EmailBindState;
    int bindMobileState = (int)ViewBag.MobileBindState;
    string securityLevel = "低";
    if (bindEmailState == 1 && bindMobileState == 1)
    {
        securityLevel = "高";
    }
    else if (bindEmailState == 1 || bindMobileState == 1)
    {
        securityLevel = "中";
    }

}
<!DOCTYPE HTML>
<HTML>
<head>
    <title>PageAdmin网站管理系统</title>
    <meta name="Author" content="PageAdmin CMS" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="/Incs/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/Incs/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="~/Areas/Member/Css/Home.css" type="text/css">
    <script src="/Js/jquery.min.js" type="text/javascript"></script>
    <script src="/Js/basic.js" type="text/javascript"></script>
    <script src="/Js/UI/ui.js" type="text/javascript"></script>
    <!--[if lte IE 9]>
    <script src="/Incs/bootstrap/js/respond.min.js"></script>
    <script src="/Incs/bootstrap/js/html5.js"></script>
    <![endif]-->
    <script src="/Incs/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</head>
<body>

    <div class="main clearfix">

            <div class="account-info clearfix">
                <div class="account-left"><i class="fa fa-user-circle"></i></div>
                <div class="account-body">
                    <h4>
                        欢迎您，@(user.UserName)
                        <small>&nbsp;&nbsp;&nbsp;&nbsp;用户组：@ViewBag.MemberGroupName </small>
                        @if(!string.IsNullOrEmpty(ViewBag.DepartmentName)){<small>&nbsp; &nbsp; &nbsp; 部门：@ViewBag.DepartmentName </small>}
                    </h4>
                    <p>
                        这是您第 @logins 次登录，上次登录日期：@lastTime，登录Ip:@lastIp
                    </p>
                    <p class="security">
                        <i class="fa fa-shield fa-lg"></i><span>安全等级：@securityLevel</span>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <i class="fa fa-envelope fa-lg @(bindEmailState==1?"":"no-bind")"></i><span>@(bindEmailState == 1 ? "已绑定" : "未绑定")</span>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <i class="fa fa-mobile-phone fa-lg fa-2 @(bindMobileState==1?"":"no-bind")"></i><span>@(bindMobileState == 1 ? "已绑定" : "未绑定")</span>
                    </p>

                </div>
            </div>

            <div class="panel">
                <div class="panel-heading clearfix">
                    <span class="left">网站公告</span>
                </div>
                <div class="panel-body list-body">
                    <ul id="noticeList" class="title-list">
                        <li class="item list-template-item clearfix">
                            <a class="title" href="{_url}" target="_blank">{title}</a>
                            <span class="date">{thedate}</span>
                        </li>
                    </ul>
                </div>
                <script type="text/javascript">
                    $("#noticeList").ListBind({ url:'@Url.Action("GetWebNotice")?number=8', showFooter: false });
                </script>
            </div>

            <div class="panel security-info">
                <div class="panel-heading">账户安全</div>
                <div class="panel-body">
                    <table class="table">
                        <tr>
                            <td align="center" width="10%">
                                <i class="fa fa-check"></i>
                            </td>
                            <td><strong>登录密码</strong></td>
                            <td width="40%">安全性高的密码可以使帐号更安全,建议您定期更换密码。</td>
                            <td align="center">已设置</td>
                            <td align="center"><a href="@Url.Action("ModifyPassword","MyLogin",new { area = "member" })" class="text-blue">修改密码</a></td>
                        </tr>
                        <tr>
                            <td align="center" width="10%">
                                <i class="fa @(bindEmailState==1?"fa-check":"fa-close")"></i>
                            </td>
                            <td><strong>邮箱绑定</strong></td>
                            <td width="40%">邮箱将是您的最基本账户资料，在保证安全的同时还可以使用邮箱登录。</td>
                            <td align="center">@(bindEmailState == 1 ? "已绑定" : "未绑定")</td>
                            <td align="center"><a href="@Url.Action("EmailBind","MyLogin",new { area = "member" })" class="btn btn-sm btn-primary">@(bindEmailState == 1 ? "修改绑定" : "立即绑定")</a></td>
                        </tr>
                        <tr>
                            <td align="center" width="10%">
                                <i class="fa @(bindMobileState==1?"fa-check":"fa-close")"></i>
                            </td>
                            <td><strong>手机绑定</strong></td>
                            <td width="40%">绑定手机后，您的手机号可以直接用于登录、找回密码等。</td>
                            <td align="center">@(bindMobileState == 1 ? "已绑定" : "未绑定")</td>
                            <td align="center"><a href="@Url.Action("MobileBind","MyLogin",new { area = "member" })" class="btn btn-sm btn-primary">@(bindMobileState == 1 ? "修改绑定" : "立即绑定")</a></td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>

    <script type="text/javascript">
        var $main = $(".main");
    </script>
</body>
</HTML>
