sale.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8"/>
  5. <title>销售管理后台</title>
  6. <meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge"/>
  7. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  8. <meta name="robots" content="noindex,nofollow">
  9. <!-- HTML5 shim for IE8 support of HTML5 elements -->
  10. <!--[if lt IE 9]>
  11. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  12. <![endif]-->
  13. <link href="__TMPL__/public/assets/themes/{:cmf_get_admin_style()}/bootstrap.min.css" rel="stylesheet">
  14. <link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  15. <link href="__TMPL__/public/assets/themes/{:cmf_get_admin_style()}/login.css" rel="stylesheet">
  16. <!--[if lt IE 9]>
  17. <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
  18. <![endif]-->
  19. <script>
  20. if (window.parent !== window.self) {
  21. document.write = '';
  22. window.parent.location.href = window.self.location.href;
  23. setTimeout(function () {
  24. document.body.innerHTML = '';
  25. }, 0);
  26. }
  27. </script>
  28. <style>
  29. .form-group .time {
  30. cursor: pointer;
  31. position: absolute;
  32. right: 1px;
  33. top: 1px;
  34. width: 150px;
  35. height: 32px;
  36. }
  37. .login-type {
  38. color: #0b6cbc;
  39. text-align: right;
  40. margin-top: 10px;
  41. float: right;
  42. font-size: 16px;
  43. }
  44. </style>
  45. </head>
  46. <body>
  47. <div class="wrap">
  48. <div class="container">
  49. <div class="row">
  50. <div class="col-md-4 col-md-offset-4">
  51. <h1 class="text-center">销售管理后台 <a class="login-type"><span style="display: none;">账号登录</span><span>验证码登录</span></a></h1>
  52. <form class="js-ajax-form" action="{:url('public/doLogin')}" method="post">
  53. <div id="type1" class="typeBox">
  54. <div class="form-group">
  55. <input type="text" id="input_username" class="form-control" name="username"
  56. placeholder="{:lang('USERNAME_OR_EMAIL')}" title="{:lang('USERNAME_OR_EMAIL')}"
  57. value="{:cookie('admin_username')}" data-rule-required="true" data-msg-required="">
  58. </div>
  59. <div class="form-group">
  60. <input type="password" id="input_password" class="form-control" name="password"
  61. placeholder="{:lang('PASSWORD')}" title="{:lang('PASSWORD')}" data-rule-required="true"
  62. data-msg-required="">
  63. </div>
  64. <div class="form-group">
  65. <div style="position: relative;">
  66. <input type="text" name="captcha" placeholder="验证码" class="form-control captcha">
  67. <captcha height="32" width="150" font-size="18"
  68. style="cursor: pointer;position:absolute;right:1px;top:1px;"/>
  69. </div>
  70. </div>
  71. </div>
  72. <div id="type2" class="typeBox" style="display: none;">
  73. <div class="form-group">
  74. <input type="text" id="mobile" class="form-control" name="mobile"
  75. placeholder="{:lang('USERNAME_OR_EMAIL')}" title="{:lang('USERNAME_OR_EMAIL')}"
  76. value="{:cookie('admin_username')}" data-rule-required="true" data-msg-required="">
  77. </div>
  78. <div class="form-group">
  79. <div style="position: relative;">
  80. <input type="text" name="code" placeholder="验证码" class="form-control captcha">
  81. <button type="button" class="time" onclick="getCode()">获取验证码</button>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="form-group">
  86. <input type="hidden" name="redirect" value="">
  87. <input type="hidden" name="type" value="2">
  88. <input id="loginType" type="hidden" name="loginType" value="1">
  89. <button class="btn btn-primary btn-block js-ajax-submit" type="submit" style="margin-left: 0px"
  90. data-loadingmsg="{:lang('LOADING')}">
  91. {:lang('LOGIN')}
  92. </button>
  93. </div>
  94. </form>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. <script type="text/javascript">
  100. //全局变量
  101. var GV = {
  102. ROOT: "__ROOT__/",
  103. WEB_ROOT: "__WEB_ROOT__/",
  104. JS_ROOT: "static/js/",
  105. APP: ''/*当前应用名*/
  106. };
  107. </script>
  108. <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
  109. <script src="__STATIC__/js/wind.js"></script>
  110. <script src="__STATIC__/js/admin.js"></script>
  111. <script src="__STATIC__/js/layer/layer.js"></script>
  112. <script>
  113. (function () {
  114. document.getElementById('input_username').focus();
  115. $(".login-type span").click(function(){
  116. var index = $(this).index()+1;
  117. $("#loginType").val(index);
  118. $(".typeBox").hide();
  119. $("#type"+index).show();
  120. console.log(index)
  121. $(this).hide().siblings('span').show();
  122. })
  123. })();
  124. function getCode(){
  125. var mobile = $("#mobile").val();
  126. if(mobile=='' || mobile == null || mobile.length < 8){
  127. layer.msg('请填写手机号');
  128. return false;
  129. }
  130. if(time<60){
  131. layer.msg('请不要频繁操作');
  132. return false;
  133. }
  134. timeLock();
  135. $.post("/admin/public/verifyCode", {mobile: mobile}, function(res){
  136. if (res.code == 1) {
  137. layer.msg(res.msg)
  138. } else {
  139. time = 60;
  140. clearInterval(timerId);
  141. $(".time").text('获取验证码');
  142. layer.msg(res.msg)
  143. }
  144. },'json')
  145. }
  146. var time = 60;
  147. var timerId = null;
  148. function timeLock(){
  149. clearInterval(timerId);
  150. timerId = setInterval(function(){
  151. time--;
  152. if(time<=0){
  153. time = 60;
  154. clearInterval(timerId);
  155. $(".time").text('获取验证码');
  156. }else{
  157. $(".time").text(time+'s');
  158. }
  159. },1000)
  160. }
  161. </script>
  162. </body>
  163. </html>