| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8"/>
- <title>销售管理后台</title>
- <meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge"/>
- <meta name="renderer" content="webkit|ie-comp|ie-stand">
- <meta name="robots" content="noindex,nofollow">
- <!-- HTML5 shim for IE8 support of HTML5 elements -->
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
- <![endif]-->
- <link href="__TMPL__/public/assets/themes/{:cmf_get_admin_style()}/bootstrap.min.css" rel="stylesheet">
- <link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
- <link href="__TMPL__/public/assets/themes/{:cmf_get_admin_style()}/login.css" rel="stylesheet">
- <!--[if lt IE 9]>
- <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
- <![endif]-->
- <script>
- if (window.parent !== window.self) {
- document.write = '';
- window.parent.location.href = window.self.location.href;
- setTimeout(function () {
- document.body.innerHTML = '';
- }, 0);
- }
- </script>
- <style>
- .form-group .time {
- cursor: pointer;
- position: absolute;
- right: 1px;
- top: 1px;
- width: 150px;
- height: 32px;
- }
- .login-type {
- color: #0b6cbc;
- text-align: right;
- margin-top: 10px;
- float: right;
- font-size: 16px;
- }
- </style>
- </head>
- <body>
- <div class="wrap">
- <div class="container">
- <div class="row">
- <div class="col-md-4 col-md-offset-4">
- <h1 class="text-center">销售管理后台 <a class="login-type"><span style="display: none;">账号登录</span><span>验证码登录</span></a></h1>
- <form class="js-ajax-form" action="{:url('public/doLogin')}" method="post">
- <div id="type1" class="typeBox">
- <div class="form-group">
- <input type="text" id="input_username" class="form-control" name="username"
- placeholder="{:lang('USERNAME_OR_EMAIL')}" title="{:lang('USERNAME_OR_EMAIL')}"
- value="{:cookie('admin_username')}" data-rule-required="true" data-msg-required="">
- </div>
- <div class="form-group">
- <input type="password" id="input_password" class="form-control" name="password"
- placeholder="{:lang('PASSWORD')}" title="{:lang('PASSWORD')}" data-rule-required="true"
- data-msg-required="">
- </div>
- <div class="form-group">
- <div style="position: relative;">
- <input type="text" name="captcha" placeholder="验证码" class="form-control captcha">
- <captcha height="32" width="150" font-size="18"
- style="cursor: pointer;position:absolute;right:1px;top:1px;"/>
- </div>
- </div>
- </div>
- <div id="type2" class="typeBox" style="display: none;">
- <div class="form-group">
- <input type="text" id="mobile" class="form-control" name="mobile"
- placeholder="{:lang('USERNAME_OR_EMAIL')}" title="{:lang('USERNAME_OR_EMAIL')}"
- value="{:cookie('admin_username')}" data-rule-required="true" data-msg-required="">
- </div>
- <div class="form-group">
- <div style="position: relative;">
- <input type="text" name="code" placeholder="验证码" class="form-control captcha">
- <button type="button" class="time" onclick="getCode()">获取验证码</button>
- </div>
- </div>
- </div>
- <div class="form-group">
- <input type="hidden" name="redirect" value="">
- <input type="hidden" name="type" value="2">
- <input id="loginType" type="hidden" name="loginType" value="1">
- <button class="btn btn-primary btn-block js-ajax-submit" type="submit" style="margin-left: 0px"
- data-loadingmsg="{:lang('LOADING')}">
- {:lang('LOGIN')}
- </button>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- //全局变量
- var GV = {
- ROOT: "__ROOT__/",
- WEB_ROOT: "__WEB_ROOT__/",
- JS_ROOT: "static/js/",
- APP: ''/*当前应用名*/
- };
- </script>
- <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
- <script src="__STATIC__/js/wind.js"></script>
- <script src="__STATIC__/js/admin.js"></script>
- <script src="__STATIC__/js/layer/layer.js"></script>
- <script>
- (function () {
- document.getElementById('input_username').focus();
- $(".login-type span").click(function(){
- var index = $(this).index()+1;
- $("#loginType").val(index);
- $(".typeBox").hide();
- $("#type"+index).show();
- console.log(index)
- $(this).hide().siblings('span').show();
- })
- })();
- function getCode(){
- var mobile = $("#mobile").val();
- if(mobile=='' || mobile == null || mobile.length < 8){
- layer.msg('请填写手机号');
- return false;
- }
- if(time<60){
- layer.msg('请不要频繁操作');
- return false;
- }
- timeLock();
- $.post("/admin/public/verifyCode", {mobile: mobile}, function(res){
- if (res.code == 1) {
- layer.msg(res.msg)
- } else {
- time = 60;
- clearInterval(timerId);
- $(".time").text('获取验证码');
- layer.msg(res.msg)
- }
- },'json')
- }
- var time = 60;
- var timerId = null;
- function timeLock(){
- clearInterval(timerId);
- timerId = setInterval(function(){
- time--;
- if(time<=0){
- time = 60;
- clearInterval(timerId);
- $(".time").text('获取验证码');
- }else{
- $(".time").text(time+'s');
- }
- },1000)
- }
- </script>
- </body>
- </html>
|