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

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>微信智能房控</title>
    <link type="text/css" rel="Stylesheet" href="/Styles/WeiXin/tip.css" />
    <link type="text/css" rel="Stylesheet" href="/Styles/WeiXin/login.css" />
    <script type="text/javascript" src="/Scripts/jquery.min.js"></script>
    <script type="text/javascript" src="/Scripts/WeiXin/common.js"></script>
    <script type="text/javascript" src="/Scripts/WeiXin/tip.js"></script>
    <script type="text/javascript">

        $(function () {
            $('#txtRoomNumber').val($('#hidRoomNumber').val());

            $('#login').click(function () {

                var roomNumber = $('#txtRoomNumber').val().trim();
                if (roomNumber === '') {
                    showTip('请输入房间号。');
                    //$('#txtRoomNumber').focus();
                    return;
                }

                var identity = $('#txtIdentity').val().trim();
                if (identity === '') {
                    showTip('请输入身份证号后四位。');
                    //$('#txtIdentity').focus();
                    return;
                }

                $.ajax({
                    url: '/WeiXin/Login/',
                    type: 'POST',
                    dataType: 'JSON',
                    data: {RoomNumber: roomNumber, Identity: identity },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        showTip('登录失败。');
                    },
                    success: function (r) {
                        if (r.IsSuccess) {
                            window.location.href = r.Target;
                        } else {
                            showTip(r.Message);
                        }
                    }
                });

            });
        });
    </script>
</head>
<body>
	<input id="hidRoomNumber" type="hidden" value='<%=ViewData["RoomNumber"] %>' />
    <%--<div class="logo">
        <img src="/images/weixin/LOGIN/LOGO.png" alt="微信智能房控" style="margin-left: 8%; margin-top: 5%;
            width: 80%;" />
    </div>--%>
    <table id="login-panel" cellpadding="10">
        <tr>
            <td>
                <input class="roomNumber" id="txtRoomNumber" type="text" maxlength="6" placeholder="请输入房间号" />
            </td>
        </tr>
        <tr>
            <td>
                <input class="identity" id="txtIdentity" type="text" maxlength="6" placeholder="请输入验证码" />
            </td>
        </tr>
        <tr>
            <td>
                <a id="login" href="javascript:void(0)">登录房间</a>
            </td>
        </tr>
    </table>
    <div style="left: 0; top: 100px; position: relative; width: 100%; height: 30px; z-index: 100;
        text-align: center; -moz-background-size: cover; -webkit-background-size: cover;
        -o-background-size: cover; background-size: cover;">
        <%--<font style="/* line-height: 30px; */" color="white">
            <label style="font-size: 14pt;">
                专利号</label><br />
            <label style="font-size: 13pt;">
                ZL 2005&nbsp;2&nbsp;0782940.0</label><br /></font>--%>
        <label style="font-size: 14pt;">
            微信智能房控</label>
    </div>
</body>
</html>
