<!--
Name:找回密码-申请
Page:P_ForgetPassword
-->
<div class="nbbox clearfix">
<div class="userbox">
    <div class="mt clearfix">
        <h2>{tag:忘记密码}</h2>
    </div>
    <div class="mc clearfix">
    <div class="dl-table clearfix">
    <dl id="dl-email">
        <dt>{tag:您的邮箱}：</dt>
        <dd><input name="Email" id="Email" shop="true" type="text" size="30" class="input" /></dd>
    </dl>
    <dl id="dl-username" style="display:none">
        <dt>{tag:登录帐号}：</dt>
        <dd><input name="UserName" id="UserName" shop="true" type="text" size="30" class="input" /></dd>
    </dl>
    <dl>
        <dt>{tag:找回方式}：</dt>
        <dd>
        <%if (ShopCache.GetBaseConfig().MailSign.ToLower().Contains("getpwd")){ %>
        <label><input type="radio" name="type" value="0" shop="true" onclick="GetType();" checked /><%=Tag("Email")%></label>
        <label><input type="radio" name="type" value="1" shop="true" onclick="GetType();" /><%=Tag("安全问题")%></label>
        <%}else{%>
        <label><input type="radio" name="type" value="1" shop="true" onclick="GetType();" checked /><%=Tag("安全问题")%></label>
        <%} %>
        <%if (ShopCache.GetBaseConfig().SMS_sendmode.Contains("SMSTPL_getnewpwd")){ %>
        <label><input type="radio" name="type" value="2" shop="true" onclick="GetType();" /><%=Tag("手机短信")%></label>
        <%} %>
        </dd>
    </dl>
    <%if (SYS.Verifycode_ForgetPassword == "1"){ %>
    <dl>
        <dt>{tag:验证码}：</dt>
        <dd><input name="verifycode" type="text" shop="true" id="verifycode" shop="true" size="6" class="input" /><img class="verifycode" id="img1" src="<%=WebPath%>/code.aspx" /><img src="{/image}reload.gif" class="refresh" title="{tag:点击刷新验证码}" onclick="refresh('img1')" /></dd>
    </dl>
    <%} %>
    <dl class="dl-btn">
        <dt></dt>
        <dd><a href="javascript:void(0)" onclick="submit();" class="btn btn-11"><s></s>{tag:提交}</a></dd>
    </dl>
    <dl class="dl-msg">
        <dt></dt>
        <dd><div id="msg"></div></dd>
    </dl>
    </div>
    </div>
</div>
</div>
<script type="text/javascript">
    function submit() {
        var Email = $("#Email").val();
        var UserName = $("#UserName").val();
        var type = $("input[name='type']:checked").val();
        if (type == 0) {
            if (Email == "") {
                CheckNO("Email", "{tag:请输入您的邮箱}");
                return false;
            }
            var postData = GetFormJsonData("shop");
            var url = path + "/ajax/ajax_user.aspx?__Action=User_forgetpwd&type=0";
            RequestAjax(url, postData, function () { $("#msg").html("{tag:找回密码邮件已发送至您的邮箱，请查收}"); MsgBoxClose(); });
        } else {
            if (UserName == "") {
                CheckNO("UserName", "{tag:请输入您的登录账号}");
                return false;
            }
            var postData = GetFormJsonData("shop");
            var url = path + "/ajax/ajax_user.aspx?__Action=User_forgetpwd&type=" + type + "";
            RequestAjax(url, postData, function (res) { if (type == 1) { location.href = res.url; } else { MsgBox(1, "{tag:新密码已发送至您的手机，请查收}", res.url); } });
        }
    }
    function GetType() {
        var type = $("input[name='type']:checked").val();
        if (type == 0) {
            $("#dl-email").show();
            $("#dl-username").hide();
        } else {
            $("#dl-email").hide();
            $("#dl-username").show();
        }
    }
    GetType();
</script>