<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="zhaq.aspx.cs" Inherits="TW.UI.memb.zhaq" %>

<!DOCTYPE html>
<html>
<head lang="en">
	
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv=X-UA-Compatible content=IE=EmulateIE9 />
<script type="text/javascript" src="/static/card/js/configweb.js"></script>
	<title>账户安全_<%=config.SiteName %></title>
	<link rel="stylesheet" href="/static/card/css/public.css" />
    <link rel="stylesheet" href="/static/card/css/userCenter.css" />
    <script type="text/javascript" src="/static/card/js/jquery-1.11.3.js"></script>
    <script type="text/javascript" src="/static/card/js/tools.js"></script>
	<link rel="stylesheet" href="/static/card/css/public.css" />
    <link rel="stylesheet" href="/static/card/css/userCenter.css" />
    <link rel="stylesheet" href="/static/card/css/userCenterNew.css" />
</head>
<body>
<form id="form1" runat=server>
<TW:Header ID="Header1" runat="server" />
<div class="content">
    <div class="container">
        <TW:UserHeader ID="UserHeader1" runat="server" />
        <div class="user-content clearfix">
            <TW:UserLeft ID="UserLeft1" runat="server" MenuId=2 SelLi=2 />
            
            <div class="user-right pull-left user-acc user-security">
                <h2 class="title text-color-666">账户安全 </h2> 
                <div class="safety-level safety-danger">
                    <span class="safety-tips">
                        <i class="icon-safety ico-shield"></i>
                        当前账户安全等级：
                    </span>
                    <div class="safety-result icon-safety">
                        <div class="score-wrap">
                            <span class="safety-score">0</span>
                            <span class="score-tag">分</span>
                        </div>                        
                    </div>
                    <a href="javascript:void(0);" class="safety-detection">立即体检</a>
                    <span class="safety-text">完成以下项目提高账户安全</span>
                </div>
                <ul class="safety-list">
                    <li class="clearfix">
                        <span class="ico-prefix icon-safety pull-left"></span>
                        <span class="login-password pull-left">登录密码</span>
                        <span class="line pull-left"></span>
                        <span class="detection pull-left">待检测...</span>
                        <span class="operate pull-left">
                            <a href="" class="safety-btn ">修改</a>
                        </span>
                    </li>
                    <li class="clearfix">
                        <span class="ico-prefix icon-safety pull-left"></span>
                        <span class="login-password pull-left">支付密码</span>
                        <span class="line pull-left"></span>
                        <span class="detection pull-left">待检测...</span>
                        <span class="operate pull-left">
                            <a href="/memb/bindpaypass.aspx" class="safety-btn ">立即设置</a>
                        </span>
                    </li>
                    <li class="clearfix">
                        <span class="ico-prefix icon-safety pull-left"></span>
                        <span class="login-password pull-left">手机绑定</span>
                        <span class="line pull-left"></span>
                        <span class="detection pull-left">待检测...</span>
                        <span class="operate pull-left">
                            <a href="/memb/bindmobile.aspx" class="safety-btn">立即绑定</a>
                        </span>
                    </li>                    
                     <li class="clearfix">
                        <span class="ico-prefix icon-safety pull-left"></span>
                        <span class="login-password pull-left">实名认证</span>
                        <span class="line pull-left"></span>
                        <span class="detection pull-left">待检测...</span>
                        <span class="operate pull-left">
                            <a href="/memb/smrz.aspx" class="safety-btn">立即认证</a>
                        </span>
                    </li>
                </ul>
            </div>    
        </div>
    </div>
</div>
<TW:Footer ID="Footer1" runat="server" />
<script type="text/javascript">
    $(function () {
        var safetyLevelDom = $(".safety-level"),
            safetyListDom = $(".safety-list li"),
            safetyLevelClass = ["safety-danger", "safety-warn", "safety-safe"],
            safetyLiClass = ["tips-warn", "tips-right"];

        var levelCheck = function (detail) {
            var level = i = score = 0, btnDom = $(".safety-btn");
            var timeout = setTimeout(function () { });
            for (var i in detail) {
                safetyListDom.eq(i).removeClass("tips-warn tips-right").addClass(safetyLiClass[detail[i].result]).find(".detection").text(detail[i].text).siblings(".operate").show();
                level += detail[i].result;
                score += detail[i].result * 25;
                detail[i].result == 1 ? btnDom.eq(i).hide() : btnDom.eq(i).show().css("display", "inline-block");
            }
            level = level > 3 ? 2 : (level > 2 ? 1 : 0);
            var scoreDom = safetyLevelDom.removeClass("safety-safe safety-warn safety-danger").addClass(safetyLevelClass[level]).find(".safety-score"), start = 0;
            var t = setInterval(function () {
                if (++start <= score) {
                    scoreDom.text(start);
                } else {
                    clearInterval(t);
                }
            }, 10);
        };
        $(".safety-detection").click(function () {
            var detail = {}, text = {
                0: {
                    0: "建议您定期更改密码以保护账户安全!",
                    1: "已设置"
                },
                1: {
                    0: "请设定您的支付密码!",
                    1: "已设置"
                },
                2: {
                    0: "为了便于您找回密码，接收验证码，请您绑定您常用的手机号哦！",
                    1: "已绑定"
                },
                3: {
                    0: "为了便于您购买商品，或找回账号请先进行实名认证!",
                    1: "已认证"
                }
            };
            $.post("?act=safetytest", {}, function (data) {
                detail[0] = {
                    text: text[0][data.result.checkLoginPassword],
                    result: data.result.checkLoginPassword
                };
                detail[1] = {
                    text: text[1][data.result.checkPayPassword],
                    result: data.result.checkPayPassword
                };
                detail[2] = {
                    text: text[2][data.result.checkTelBind],
                    result: data.result.checkTelBind
                };
                detail[3] = {
                    text: text[3][data.result.checkAuthentication],
                    result: data.result.checkAuthentication
                };
                levelCheck(detail);
            }, "json");

        });
    });
</script>

</form>
</body>
</html>