{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录界面</title>
    <link rel="stylesheet" href="{% static '/lib/css/swiper.min.css' %}">
    <link rel="stylesheet" href="{% static '/lib/font/fontIcon/iconfont.css' %}">
    <link rel="stylesheet" href="{% static '/lib/font-awesome/4.5.0/css/font-awesome.css' %}">
    <!-- <link rel="stylesheet" href="{% static '/lib/css/video-js.min.css' %}"> -->
    <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css">
    <link rel="stylesheet" href="{% static '/lib/css/reset.css' %}">
    <link rel="stylesheet" href="{% static '/css/common.css' %}">
    <link rel="stylesheet" href="{% static '/css/header.css' %}">
    <link rel="stylesheet" href="{% static '/css/login.css' %}">
</head>

<body>
    <div class="header">
        <div class="headerTop wrapper">
            <div class="logoTxt">
                <a href="">
                    <h1>休闲农业旅游网</h1>
                    <p>www.XXNYLY.CN</p>
                </a>
            </div>
            <div class="LocateCover">
                <div class="currCity">
                    <span>全国</span>
                    <i class="fa fa-map-marker" aria-hidden="true"></i>
                </div>
                <div class="selectCityCover">
                    <ul>
                        <li>河南</li>
                        <li>河南</li>
                        <li>河南</li>
                        <li>河南</li>
                    </ul>
                </div>
            </div>
            <div class="searchCover">
                <div class="searchBoxBj">
                    <input type="text" placeholder="请输入农庄名称">
                    <button>搜索</button>
                </div>
            </div>
            <div class="loginCover">
                <a href="login2" target="_blank">登录</a>
                <a href="" target="_blank">注册</a>
            </div>
        </div>
        <!-- 登录内容 -->
    </div>
    <!-- 主体部分 -->
    <div class="content">
        <!-- 登录框 -->
        <div class="loginBj">
            <div class="borderline">
                <div class="loginBox">
                    <div class="title">用户登录</div>
                    <div class="loginInp">
                        <input type="text" id="username" placeholder="用户名">
                    </div>
                    <div class="loginInp">
                        <input type="password" id="password" placeholder="密码">
                        <a href="">忘记密码？</a>
                    </div>
                    <div class="loginBtnCover">
                        <button id="loginBtn" onclick="login()">登 录</button>
                    </div>
                    <div class="remPswCover">
                        <div class="remPwdInpBox">
                            <input type="checkbox" id="remPwdFlag">
                            <div></div>
                        </div>
                        <label for="remPwdFlag">记住密码</label>
                    </div>
                </div>
            </div>
        </div>
        <div class="wrapper">
            <!-- 合作伙伴 -->
            <div class="partnerCover">
                <div class="title">
                    <i class="fa fa-handshake-o" aria-hidden="true"></i>
                    <span>合作伙伴 </span>
                </div>
                <div class="partnerInner">
                    <ul class="partnerInnerList">
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li class="partnerInnerItem">
                            <a href="">
                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
                            </a>
                        </li>
                        <li style="clear: both;"></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!-- 底部版权 -->
    <div class="footer bjColor">
        <div class="wrapper">
            <div class="floatDiv">
                <div class="copyrightTxt">
                    <div>休闲农业旅游网</div>
                    <div>联系人：李四　　联系电话：13811111111</div>
                    <div>地址：河南省郑州市XXXXXXXXXXXXXXXXXXXXXXXXXX</div>
                </div>
                <div class="WeChatCode">
                    <img src="{% static '/imgs/WeChatCode.jpg' %}" alt="">
                    <p>关注公众号</p>
                </div>
            </div>
            <div class="copyright">
                版权所有XXXXXXXXXXXXXXXXXXXXXX
            </div>
        </div>
    </div>
    <!-- 返回顶部 -->
    <div id="back2top" class="back2top" style="display: block;">
        <a href="javascript:void(0);" onclick="goUp()" title="返回顶部">&nbsp;</a>
    </div>

    <script src="{% static '/lib/js/jquery-2.1.4.min.js'%}"></script>
    <script
        src="https://webapi.amap.com/maps?v=1.4.15&key=3939967b919a8003377dd113fc445a3d&plugin=AMap.Driving"></script>
    <!-- <script src="{% static '/lib/layui/layui.js'%}"></script> -->
    <!-- <script src="{% static '/js/index2.js'%}"></script> -->
    <script>

        // 登录
        function login() {
            var username = $("#username").val();
            var password = $("#password").val();
            if (!username) {
                $("#username").focus();
                return;
            }
            if (!password) {
                $("#password").focus();
                return;
            }

            // $('.notLogin').toggle();
            // $('.isLogin').toggle();
            // window.open("back_manage");

            $.ajax({
                url: 'user_land',
                data: {
                    username: username,
                    password: password
                },
                type: 'post',
                dataType: 'json',
                success: function (data) {
                    if (data.code == 1) {
                        // var hrefstr = 'person_farm?name=' + data.username;
                        window.location = 'home2'
                        // $('.isLogin').toggle();
                        // $('#person_farm').attr('href', hrefstr)
                        // $('.userPhoto').attr('src', data.user_img)
                        // $('.notLogin').hide();
                        // $('.isLogin').show();
                    } else if (data == 0) {
                        $('body').append('<div class="hint">用户不存在</div>')
                        setTimeout(function () {
                            $('.hint').remove();
                        }, 1000)
                    } else if (data == 2) {
                        $('body').append('<div class="hint">用户名错误</div>')
                        setTimeout(function () {
                            $('.hint').remove();
                        }, 1000)
                    } else if (data == 3) {
                        $('body').append('<div class="hint">密码错误</div>')
                        setTimeout(function () {
                            $('.hint').remove();
                        }, 1000)
                    } else {
                        $('body').append('<div class="hint">登录失败</div>')
                        setTimeout(function () {
                            $('.hint').remove();
                        }, 1000)
                    }
                },
                error: function (type) {

                }
            })
        }
    </script>
</body>

</html>