const jQuery = require('jquery');
(function ($) {
let close = require("../images/icon_close_default.png")
let suc = require("../images/success.png")
let loadingImg = require("../images/loading.gif")
$.alerModal = function (options) {
var dft = {
sureBtn:true,
quiteBtn:false,
width:"400",
title:"标题",
sureText:"确定",
message: '
内容
',
time: 1500,
isFather: false,
fatherWrapper:'',
type:'modal',//tip,loading
callback:function(){
alert(99)
}
};
var ops = $.extend(dft, options || {});
var html = `
${ops.title} 
${ops.message}
取消
${ops.sureText}
`
// var tip = `
// ${ops.message}
// `
var tip = `
${ops.win?`

${ops.message}
`:`
${ops.message}
`}
`
var loading = `
`
var box = $("",{
"class":"divModal",
"html":ops.type == 'tip'?tip:ops.type == 'loading'?loading:html
}).css({
left:$(".modaltip").width()/2+'px',
top:$(".modaltip").height()/2+'px'
})
if(ops.isFather){
//console.log('bbbbbbb')
ops.fatherWrapper.append(box)
} else{
$("body").append(box)
}
if(ops.type == 'tip'){
setTimeout(function(){
box.remove();
}, ops.time);
}
$(document).on('click',".alertModal .title img",function(){
box.remove();
})
}
})(jQuery);