<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title></title>
    <%--<link rel="stylesheet" href="/Styles/manualvisit.css"/>--%>
    <script type="text/javascript" src="/Scripts/WeiXin/tip.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#getValidateCode').click(function () {
                var name = $('#txtName').val().trim();
                if (name === '') {
                    alert('请输入姓名');
                    return;
                }
                var companyName = $('#txtCompanyName').val().trim();
                if (companyName === '') {
                    alert('请输入公司名');
                    return;
                }
                var phoneNumber = $('#txtPhoneNumber').val().trim();
                if (phoneNumber === '') {
                    alert('请输入手机号');
                    return;
                }
                $.ajax({
                    url: '/ManualVisit/GetValidateCode/',
                    type: 'POST',
                    dataType: 'JSON',
                    data: { name: name, companyName: companyName, phoneNumber: phoneNumber },
                    success: function (r) {
                        //showTip(r.Message);
                        alert(r.Message);
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        alert('操作失败');
                    }
                });
            });
            $('#getManual').click(function () {
                var phoneNumber = $('#txtPhoneNumber').val().trim();
                if (phoneNumber === '') {
                    alert('请输入手机号');
                    return;
                }
                var validateCode = $('#txtValidateCode').val().trim();
                if (validateCode === '') {
                    alert('请输入验证码');
                    return;
                }
                $.ajax({
                    url: '/ManualVisit/GetManual/',
                    type: 'POST',
                    dataType: 'JSON',
                    data: { phoneNumber: phoneNumber, validateCode: validateCode },
                    success: function (r) {
                        if (r.IsSuccess) {
                            window.location.href = r.Target;
                        } else {
                            alert(r.Message);
                        }
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        alert('操作失败');
                    }
                });
            });
        });
    </script>
    <style type="text/css">
        .weixin-tip
        {
            display: none;
            background: rgba(38,55,92,0.7);
            border-radius: 20px;
            padding: 5px 50px;
            font-size: 12pt;
            color: #FFF;
            text-align: center;
            position: absolute;
            top: 0.1%;
            z-index: 9999;
            background-color: transparent;
        }
        body
        {
            background-image: url(../images/manual/bg.png);
        }
        .block
        {
            margin: 0px 10%;
            text-align: center;
            color: White;
            font-size: 22px;
        }
        .block input
        {
            width: 60%;
            margin: 10px 0;
            border: 0;
            font-size: 20px;
            padding: 4px 0;
            border-radius: 4px;
            text-indent: 5px;
        }
        .block button
        {
            padding: 8px;
            font-size: 18px;
            width: 100%;
        }
        #getValidateCode
        {
            background-image: url(../images/manual/btnValidateCode.png);
            background-size: 100% 100%;
            background-position: center center;
            display: block;
            width: 140px;
            height:112px;
        }
        #getManual
        {
            background-image: url(../images/manual/btnManual.png);
            background-size: 100% 100%;
            background-position: center center;
            display: block;
            width: 140px;
            height:112px;
        }
    </style>
</head>
<body>
    <div class="block" style="height: 50px;">
        &nbsp;</div>
    <div style="text-align: center;">
        <img alt="" src='../images/manual/title.png' width="314px" /></div>
    <div class="block" style="height: 30px;">
        &nbsp;</div>
    <div class="block">
        姓&nbsp;&nbsp;&nbsp;名：
        <input type="text" id="txtName" name="Name" maxlength="10" />
    </div>
    <div class="block">
        公司名：
        <input type="text" id="txtCompanyName" name="CompanyName" maxlength="20" />
    </div>
    <div class="block">
        手机号：
        <input type="text" id="txtPhoneNumber" name="PhoneNumber" maxlength="20" />
    </div>
    <div class="block">
        验证码：
        <input type="text" id="txtValidateCode" name="ValidateCode" maxlength="4" />
    </div>
    <br />
    <table style=" width:100%; text-align:center;">
        <tr align="center">
            <td><a id="getValidateCode" href="javascript:void(0)"></a></td>
            <td><a id="getManual" href="javascript:void(0)"></a></td>
        </tr>
    </table>
</body>
