wyq 3 years ago
parent
commit
c1593e47f0
2 changed files with 29 additions and 26 deletions
  1. 6 1
      src/css/login.less
  2. 23 25
      src/js/login.js

+ 6 - 1
src/css/login.less

@@ -1,7 +1,7 @@
 @import './reset.less';
 @import './reset.less';
 body {
 body {
   background: @themeColor;
   background: @themeColor;
-  // background:linear-gradient(133deg,rgba(45,79,139,1) 0%,rgba(20,39,83,1) 100%);
+  background:linear-gradient(133deg,rgba(45,79,139,1) 0%,rgba(20,39,83,1) 100%);
 }
 }
 .login {
 .login {
   height: 100%;
   height: 100%;
@@ -144,6 +144,11 @@ p.title {
     }
     }
     
     
   }
   }
+  .waring {
+    display: inline-block;
+    position: absolute;
+    top: -44px;
+  }
   .sureLogin{
   .sureLogin{
     float: left;
     float: left;
     width: 213px;
     width: 213px;

+ 23 - 25
src/js/login.js

@@ -10,11 +10,7 @@ const md5 = require('js-md5');
 const hideLogo = getUrlArgObject("hideLg");
 const hideLogo = getUrlArgObject("hideLg");
 const otherLogo = getUrlArgObject("adLg");
 const otherLogo = getUrlArgObject("adLg");
 $(function () {
 $(function () {
-
   getHospitalMark()
   getHospitalMark()
-
-
-
   if (hideLogo || otherLogo) {
   if (hideLogo || otherLogo) {
     $(".copy-right").text("");
     $(".copy-right").text("");
   }
   }
@@ -24,23 +20,8 @@ $(function () {
       sureLogin()
       sureLogin()
     }
     }
   });
   });
-  $(".sureLogin").click(() => {
-    sureLogin()
-  })
-  $("#password").focus(function () {
-    $(this).attr("type", "password")
-  })
-  $(".iptWrap input").focus(function () {
-    $(this).parent().addClass('inputFocus')
-  })
-  $(".iptWrap input").blur(function () {
-    $(this).parent().removeClass('inputFocus')
-  })
-  $("body").on('input', '#username,#password', function () {
-    if ($(this).val().trim() != '') {
-      $(".login .waring").html('')
-    }
-  })
+  
+  
 });
 });
 function getHospitalMark() {
 function getHospitalMark() {
   post(api.getHospitalMark).then((res) => {
   post(api.getHospitalMark).then((res) => {
@@ -59,7 +40,7 @@ function getHospitalMark() {
         str += '<div class="info-iptWrap">'
         str += '<div class="info-iptWrap">'
         str += '<input type="text" placeholder="请输入密码" id="password" value="" autocomplete="off">'
         str += '<input type="text" placeholder="请输入密码" id="password" value="" autocomplete="off">'
         str += '</div></div>'
         str += '</div></div>'
-        str += '<div class="sureLogin">登录</div>'
+        str += '<p class="waring"></p><div class="sureLogin">登录</div>'
         $('.login').html(str)
         $('.login').html(str)
       } else {
       } else {
         str = '<div class="bg fl"><p class="title">AI病案质控平台</p></div>'
         str = '<div class="bg fl"><p class="title">AI病案质控平台</p></div>'
@@ -77,6 +58,23 @@ function getHospitalMark() {
         str += '<p class="waring"></p><div class="sureLogin">登录</div></div><div class="copy-right">由杭州朗通信息技术有限公司提供技术支持</div></div>',
         str += '<p class="waring"></p><div class="sureLogin">登录</div></div><div class="copy-right">由杭州朗通信息技术有限公司提供技术支持</div></div>',
         $('.login').html(str)
         $('.login').html(str)
       }
       }
+      $(".sureLogin").click(() => {
+        sureLogin()
+      })
+      $("#password").focus(function () {
+        $(this).attr("type", "password")
+      })
+      $(".iptWrap input").focus(function () {
+        $(this).parent().addClass('inputFocus')
+      })
+      $(".iptWrap input").blur(function () {
+        $(this).parent().removeClass('inputFocus')
+      })
+      $("body").on('input', '#username,#password', function () {
+        if ($(this).val().trim() != '') {
+          $(".login .waring").html('')
+        }
+      })
     }
     }
   }).catch(() => {
   }).catch(() => {
 
 
@@ -88,10 +86,10 @@ function sureLogin() {
   let username = $("#username").val().trim();
   let username = $("#username").val().trim();
   let password = $("#password").val().trim();
   let password = $("#password").val().trim();
   if (!username) {
   if (!username) {
-    $(".login .waring").css('display', 'block').html('请输入用户名')
+    $(".login .waring").css('visibility', 'visible').html('请输入用户名')
     return
     return
   } else if (!password) {
   } else if (!password) {
-    $(".login .waring").css('display', 'block').html('请输入密码')
+    $(".login .waring").css('visibility', 'visible').html('请输入密码')
     return
     return
   }
   }
   $.alerModal({ type: "loading" });
   $.alerModal({ type: "loading" });
@@ -116,7 +114,7 @@ function sureLogin() {
       }, 600);
       }, 600);
     } else {
     } else {
       $(".divModal").remove()
       $(".divModal").remove()
-      $(".login .waring").css('display', 'block').html(data.msg)
+      $(".login .waring").css('visibility', 'visible').html(data.msg)
     }
     }
   }).catch(() => {
   }).catch(() => {
     $(".divModal").remove()
     $(".divModal").remove()