Quellcode durchsuchen

修改成功提示

zhouna vor 4 Jahren
Ursprung
Commit
5150116c5a
2 geänderte Dateien mit 23 neuen und 2 gelöschten Zeilen
  1. 19 0
      src/css/index.less
  2. 4 2
      src/js/index.js

+ 19 - 0
src/css/index.less

@@ -1153,6 +1153,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{

+ 4 - 2
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")
@@ -102,7 +103,8 @@ 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"));
 }
 
 //绑定输入框事件
@@ -416,7 +418,7 @@ function changeWord(oldword, newword) {
       toast("密码修改成功,请重新登录");
       setTimeout(()=>{
           window.location.href = './login.html'
-      },1500);
+      },1000);
     } else {
       $(".oldWaring b").text(data.msg);
       $(".oldWaring").show();