| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429 |
- {% load staticfiles %}
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>河南云飞物联网平台</title>
- <link rel="stylesheet" href="{% static '/css/style.css' %}">
- <!-- <link rel="stylesheet" href="{% static '/css/layui.css' %}" />
- <link rel="stylesheet" href="{% static '/css/layer.css' %}" /> -->
- <link href="{% static '/css/popup-box.css' %}" rel="stylesheet" type="text/css" media="all" />
- <style type="text/css">
- body {
- background: url(static/img/1.jpg) no-repeat 0px 0px;
- background-size: cover;
- font-family: 'Open Sans', sans-serif;
- background-attachment: fixed;
- background-position: center;
- }
- /* 将标题整体向下移动 */
- h1 {
- margin-top: 50px;
- }
- /* 将登录框整体向下移动 */
- .w3layouts {
- margin-top: 120px;
- }
- a:visited {
- border: none;
- }
- #denglu {
- width: 130px;
- height: 38px;
- float: right;
- margin-top: 34px;
- background: transparent;
- border: 1px solid #c4e1b5;
- border-radius: 25px;
- color: #26d11bcc;
- }
- #denglu:hover {
- background-color: #4a8c1e;
- color: white;
- cursor: pointer;
- }
- #zhuce {
- float: left;
- /* width:130px;
- height:45px; */
- }
- #ljzc {
- width: 130px;
- height: 42px;
- float: left;
- margin-top: 0px;
- border: 1px solid #c4e1b5;
- border-radius: 25px;
- }
- #ljdl {
- width: 130px;
- height: 42px;
- float: right;
- margin-top: 0px;
- border: 1px solid #c4e1b5;
- border-radius: 25px;
- }
- #ljzc:hover {
- background-color: #4a8c1e;
- color: white;
- }
- #ljdl:hover {
- background-color: #4a8c1e;
- color: white;
- }
- .signin-agile {
- background: rgba(255, 255, 255, 0.4);
- }
- a.book.popup-with-zoom-anim.button-isi.zoomIn.animated {
- border: 1px solid #c4e1b5;
- padding: 8px 34px;
- color: #26d11bcc;
- }
- /* 新增样式 */
- .book-form h3 {
- margin-bottom: 1.2em;
- }
- .retrieveMsgBox label {
- width: 18%;
- text-align: right;
- display: inline-block;
- margin-right: 10px;
- }
- .retrieveMsgBox input {
- width: 70%;
- }
- .retrieveMsgBox .codeInput {
- width: 30%;
- }
- #sendCode {
- width: 25%;
- padding: 15px;
- border: 1px solid #7d7d7d;
- outline: none;
- font-size: 14px;
- margin-bottom: 20px;
- border-radius: 25px;
- cursor: pointer;
- margin-left: 70px;
- }
- #sendCode.defaultColor {
- background: #70ad47;
- color: #fff;
- }
- /* a.book.popup-with-zoom-anim.button-isi.zoomIn.animated {
- border: 1px solid #fff;
- padding: 8px 34px;
- color: #fff;
- display: inline-block;
- margin-top: 35px;
- border-radius: 20px;
- transition: 0.5s all;
- -webkit-transition: 0.5s all;
- -moz-transition: 0.5s all;
- -o-transition: 0.5s all;
- -ms-transition: 0.5s all;
- outline: none;
- } */
- </style>
- <!--<link href='//fonts.googleapis.com/css?family=Open+Sans:400,300italic,300,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'>
- <link href='//fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
- -->
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="keywords" content="Sign In And Sign Up Forms Widget Responsive, Login Form Web Template, Flat Pricing Tables, Flat Drop-Downs, Sign-Up Web Templates, Flat Web Templates, Login Sign-up Responsive Web Template, Smartphone Compatible Web Template, Free Web Designs for Nokia, Samsung, LG, Sony Ericsson, Motorola Web Design"
- />
- </head>
- <body>
- <h1>河南云飞科技物联网平台</h1>
- <div class="w3layouts">
- <div class="signup-agileinfo">
- <h3>河南云飞科技发展有限公司</h3>
- <p>        河南云飞科技发展有限公司是一家专业研发和销售农业科学仪器设备的企业。 致力于农林植保仪器设备、环境气象仪器、土壤检测仪器、农产品质量安全仪器的技术开发、销售。
- 主营产品包括植保机械、其他专用仪器仪表、灭蚊灯、农业实验设备等。
- </p>
- <!-- <div>
- <img src="static/img/yfkj.jpg" style="opacity:0.4;float:left;margin-top:0px;" width="150" height="150" alt="云飞科技logo" />
- </div> -->
- </div>
- <div class="signin-agile">
- <h2>登录</h2>
- <form action="" method="post"> {% csrf_token %}
- <input type="text" id="username" class="name" placeholder="用户名" required="" value={{user_name}}>
- <div class="col-sm-5 col-sm-offset-4 margint10">
- <span class="color-background2 " style="color:#FF0015;">
- </span>
- </div>
- <input type="password" id="password" class="password" onkeypress="if (event.keyCode == 13) sub();" placeholder="密码" required=""
- value={{pass_word}}>
- <ul>
- <li>
- <input type="checkbox" id="brand1" check="" value="">
- <label for="brand1">
- <span> </span>记住密码</label>
- </li>
- </ul>
- <div class="col-sm-5 col-sm-offset-4 margint10">
- <span class="color-background2 " style="color:#FF0015;">
- </span>
- </div>
- <a class="popup-with-zoom-anim" data-wow-delay=".5s" href=".wangji">忘记密码?</a>
- <br>
- <div class="clear"></div>
- <!-- <a class="book popup-with-zoom-anim button-isi zoomIn animated" type="submit" name="submit" >登      录</a> -->
- <input id="denglu" onclick="sub()" type="button" value="登录">
- <div class="more">
- <!-- <a id="zhuce" class="book popup-with-zoom-anim button-isi zoomIn animated" data-wow-delay=".5s" href=".zhuce">用户注册</a> -->
- </div>
- </form>
- </div>
- <div class="clear"></div>
- </div>
- <div class="footer-w3l">
- <p class="agileinfo">Copyright©2007-2018 All Rrights Resvered 版权所有:河南云飞科技发展有限公司</p>
- </div>
- <div class="pop-up">
- <div id="small-dialog" class="mfp-hide book-form zhuce">
- <h3>用户注册</h3>
- <form action="" method="post"> {% csrf_token %} {{ username.label_tag }}
- <p class="retrieveMsgBox">
- <label for="">用户名:</label>
- <input type="text" id="reUsername" placeholder="请输入用户名" required="" />
- </p>
- <p class="retrieveMsgBox">
- <label for="">邮件:</label>
- <input type="text" id="email" class="email" placeholder="请输入邮件" required="" />
- <p class="retrieveMsgBox">
- <label for="">手机:</label>
- <input type="text" id="user_phone" class="user_phone" placeholder="请输入手机" required="" />
- </p>
- <p class="retrieveMsgBox">
- <label for="">密码:</label>
- <input type="password" id="rePassword" class="password" placeholder="请输入密码" required="" />
- </p>
- <p class="retrieveMsgBox">
- <label for="">重复密码:</label>
- <input type="password" id="rePassword2" class="password2" placeholder="请重复密码" required="" />
- </p>
- <p class="retrieveMsgBox">
- <input type="button" id="ljzc" onclick="register()" value="立即注册">
- <input type="button" id="ljdl" onclick=location.reload(); value="返回登录">
- </p>
- </form>
- </div>
- <div id="small-dialog" class="mfp-hide book-form wangji">
- <h3>找回密码</h3>
- <form action="#" method="post">
- <p class="retrieveMsgBox">
- <label for="">用户名:</label>
- <input type="text" name="Name" placeholder="请输入用户名" required="" />
- </p>
- <p class="retrieveMsgBox">
- <label for="">手机号:</label>
- <input type="text" name="Email" class="email" placeholder="请输入手机号" required="" />
- </p>
- <p class="retrieveMsgBox">
- <label for="">验证码:</label>
- <input type="password" name="Password" class="password codeInput" placeholder="请输入验证码" required="" />
- <input type="button" id="sendCode" class="" value="获取验证码">
- </p>
- <p class="retrieveMsgBox">
- <label for=""></label>
- <input type="submit" value="立即找回">
- </p>
- </form>
- </div>
- </div>
- <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
- <script src="{% static '/lib/layui/layui.all.js' %}"></script>
- <script src="{% static '/js/jquery.magnific-popup.js' %}" type="text/javascript"></script>
- <script type="text/javascript" src="{% static '/js/modernizr.custom.53451.js' %}"></script>
- <script type="application/x-javascript">
- addEventListener("load", function() {
- setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); }
- </script>
- <script>
- $(document).ready(function () {
- $('.popup-with-zoom-anim').magnificPopup({
- type: 'inline',
- fixedContentPos: false,
- fixedBgPos: true,
- overflowY: 'auto',
- closeBtnInside: true,
- preloader: false,
- midClick: true,
- removalDelay: 300,
- mainClass: 'my-mfp-zoom-in'
- });
- });
- </script>
- <script type="text/javascript">
- $.ajaxSetup({
- data: { csrfmiddlewaretoken: '{{ csrf_token }}' },
- });
- window.onload = function () {
- if (username != "" && password != "") {
- document.getElementById('brand1').checked = "checked";
- } else {
- document.getElementById('brand1').checked = "";
- }
- }
- function sub() {
- var username = $("#username").val();
- var password = $("#password").val();
- var brand1 = $("#brand1").val();
- if (username == "" || password == "") {
- layer.msg('请正确输入用户名和密码!', { time: 2000 });
- return;
- }
- if (document.getElementById('brand1').checked == true) {
- console.log("111:", document.getElementById('brand1').checked)
- document.getElementById('brand1').value = "remember";
- }
- else {
- console.log("222:", document.getElementById('brand1').checked)
- document.getElementById('brand1').value = "no";
- }
- $.ajax({
- type: "post",
- url: "login",
- data: {
- "username": username.trim(),
- "password": password.trim(),
- "brand1": document.getElementById('brand1').value,
- },
- dataType: "json",
- success: function (data) {
- if (data == 0) {
- //layer.msg("登录成功!",{time:2000});
- // location.href = 'home';
- }
- else if (data == 1) {
- //location.reload();
- layer.msg("该用户名不存在!", { time: 2000 });
- }
- else if (data == 2) {
- layer.msg("该用户不可用", { time: 2000 });
- }
- else if (data == 3) {
- layer.msg("密码错误,请重新输入!", { time: 2000 });
- }
- }
- });
- return;
- }
- //用户注册:用户注册:
- function register() {
- var username = $("#reUsername").val();
- var email = $("#email").val();
- var user_phone = $("#user_phone").val();
- var password = $("#rePassword").val();
- var password2 = $("#rePassword2").val();
- console.log(username, email, user_phone, password, password2)
- if (username == "" || email == "" || user_phone == "" || password == "" || password2 == "") {
- layer.msg('请将注册信息填写完整!', { time: 2000 });
- return;
- }
- if (password.length < 6 || password2.length < 6 || password.length > 16 || password2.length > 16) {
- layer.msg('请输入6到16位密码!!!', { time: 2000 });
- return;
- }
- if (password != password2) {
- layer.msg('密码两次输入不一致!!!', { time: 2000 });
- return;
- }
- var pattern1 = /^((13[0-9])|(15[1-3,5-9])|(17[7])|(18[0-9]))\d{8}$/
- var strPhone = pattern1.test(user_phone);
- if (strPhone != true) {
- layer.msg("手机格式不正确!!!", { time: 2000 });
- return;
- }
- var pattern2 = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
- var strEmail = pattern2.test(email);
- if (strEmail) {
- //邮箱格式正确
- } else {
- //邮箱格式不正确
- layer.msg('邮箱格式不正确!!!', { time: 2000 });
- return;
- }
- $.ajax({
- type: "post",
- url: "register",
- data: {
- "username": username.trim(),
- "email": email.trim(),
- "user_phone": user_phone.trim(),
- "password": password.trim(),
- "password2": password2.trim(),
- },
- dataType: "json",
- success: function (data) {
- if (data == 0) {
- layer.msg("注册成功!", { time: 2000 });
- // location.href='home';
- }
- else if (data == 1) {
- layer.msg("该用户名已存在!", { time: 2000 });
- }
- }
- });
- return;
- }
- </script>
- </body>
- </html>
|