function tanchuang(type,fn,clear){
    var inner = "";
    if(clear){
        inner = "<div onclick='clearTc()' style='position: fixed;top: 0;left: 0;bottom: 0;right: 0;background-color: rgba(0,0,0,0.6);z-index: 9999;'>" +
            "<div style='width: 360px;background-color: #fff;position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);border-radius: 3px;'>" +
            "<div style='width: 100%;height: 40px;'>" +
            "<div style='line-height: 40px;float: left;padding:0 15px;text-align: center;font-size: 20px;'>提示</div>"+
            "<div onclick='clearTc()' style='line-height: 40px;float: right;width: 40px;text-align: center;font-size:18px;font-weight: 600;cursor: pointer;'>×</div>"+
            "</div>"+
            "<div style='width: 330px;padding: 15px;'>"+type+"</div>"+
            "<button onclick='clearTc("+fn+")' style='float:right;margin: 10px;border:none;border-radius:5px;width: 70px;height: 32px;background-color: #409eff;color: white;line-height: 32px;text-align: center;'>确定</button>"+
            "<button onclick='clearTc()' style='float:right;margin: 10px;border:none;border-radius:5px;width: 70px;height: 32px;color: black;line-height: 32px;text-align: center;'>取消</button>"
        "</div>"+
        "</div>"
    }else{
        inner = "<div onclick='clearTc("+fn+")' style='position: fixed;top: 0;left: 0;bottom: 0;right: 0;background-color: rgba(0,0,0,0.6);z-index: 9999;'>" +
            "<div style='width: 360px;background-color: #fff;position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);border-radius: 3px;'>" +
            "<div style='width: 100%;height: 40px;'>" +
            "<div style='line-height: 40px;float: left;padding:0 15px;text-align: center;font-size: 20px;'>提示</div>"+
            "<div onclick='clearTc("+fn+")' style='line-height: 40px;float: right;width: 40px;text-align: center;font-size:18px;font-weight: 600;cursor: pointer;'>×</div>"+
            "</div>"+
            "<div style='width: 330px;padding: 15px;'>"+type+"</div>"+
            "<button onclick='clearTc("+fn+")' style='float:right;margin: 10px;border:none;border-radius:5px;width: 70px;height: 32px;background-color: #409eff;color: white;line-height: 32px;text-align: center;'>确定</button>"
        "</div>"+
        "</div>"
    }
    var box = document.createElement("div")
    box.id = "tanchuang";
    box.innerHTML=inner;
    document.getElementsByTagName("body")[0].append(box);
}

function clearTc(fn){
    if(document.getElementById("tanchuang")){
        document.getElementById("tanchuang").remove()
        if(fn){
            fn()
        }
    }
}
function Encrypt(word) {
    var key = CryptoJS.enc.Utf8.parse("abcdefgabcdefg12");
    var srcs = CryptoJS.enc.Utf8.parse(word);
    var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7});
    return encrypted.toString();
}
