zhouna 4 лет назад
Родитель
Сommit
0296d60298
2 измененных файлов с 30 добавлено и 3 удалено
  1. 19 0
      src/css/index.less
  2. 11 3
      src/js/index.js

+ 19 - 0
src/css/index.less

@@ -1152,6 +1152,25 @@
 
 }
 .alertModal{
+  .toast{
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    background: #666;
+    text-align: center;
+    width: 184px;
+    height: 112px;
+    margin:-56px 0 0 -92px;
+    border-radius: 4px;
+    img{
+      width: 40px;
+      height: 40px;
+      margin-top: 20px;
+    }
+    p{
+      color: #fff;
+    }
+  }
   .btns{
     margin-top:30px;
     .sure{

+ 11 - 3
src/js/index.js

@@ -3,6 +3,7 @@ const $ = require('jquery');
 require('jquery-templates');
 const md5 = require('js-md5');
 require("./modal.js")
+const okIcon =  require("./../images/checkOk.png")
 const WarningIcon =  require("./../images/icon-Warning.png")
 const warnIcon = require("./../images/warn.png")
 const openEye = require("./../images/open-eye.png")
@@ -16,7 +17,7 @@ let passwordComplexity = getCookie('passwordComplexity')
 const modalDom = `
       <p class="tips"><img src=${WarningIcon} /><span>为确保账号安全,请及时修改初始密码</span></p>
       <div class="modalAction">
-        <p><span class="label"><i>*</i>原密码:</span><input type="password" placeholder="请输入原密码" class="oldword" id="oldWord"><img class="eye" src=${closeEye} /><p class="oldWaring warning"><img src=${warnIcon} /><b>原密码错误</b></p></p>
+        <p><span class="label"><i>*</i>原密码:</span><input type="text" placeholder="请输入原密码" class="oldword" id="oldWord" autocomplete="off"><img class="eye" src=${closeEye} /><p class="oldWaring warning"><img src=${warnIcon} /><b>原密码错误</b></p></p>
         <p><span class="label"><i>*</i>新密码:</span><input type="password" disabled placeholder="请输入新密码" class="newword" id="newWord" autocomplete="off"><img class="eye" src=${closeEye} /><p class="newword warning"><img src=${warnIcon} /><b>密码最多12位</b></p></p>
         <p><span class="label"><i>*</i>确认新密码:</span><input type="password" disabled placeholder="请输入确认新密码" class="sureword" id="sureWord" autocomplete="off"><img class="eye" src=${closeEye} /><p class="sureword warning"><img src=${warnIcon} /><b>两次密码输入不一致</b></p></p>
       </div>
@@ -103,11 +104,18 @@ function switchPwd(el) {
 }
 
 function toast(msg){
-    $.alerModal({"message":msg,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+    const toast = `<div class="toast"><img src="${okIcon}" alt=""><p>${msg}</p></div>`;
+    $(toast).appendTo($(".alertModal"));
 }
 
 //绑定输入框事件
 function bindModalEvent(){
+    /*$(".modalAction input[ autocomplete='off']").off("focus").on("focus",function(){
+        $(this).attr("type","password")
+    })
+    $(".modalAction input[ autocomplete='off']").off("blur").on("blur",function(){
+        $(this).attr("type","text")
+    })*/
   $(".modalAction .eye").off("click").on("click",function(){
       switchPwd($(this))
   })
@@ -406,7 +414,7 @@ function changeWord(oldword,newword){
       toast("密码修改成功,请重新登录");
       setTimeout(()=>{
           window.location.href = './login.html'
-      },1500);
+      },1000);
     }else{
         $(".oldWaring b").text(data.msg);
         $(".oldWaring").show();