更新部分代码

develop
就眠仪式 2020-10-01 23:49:05 +08:00
parent 45a22a785c
commit 72b09104a3
2 changed files with 7 additions and 63 deletions

View File

@ -8,40 +8,32 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
var pearOper = new function () { var pearOper = new function () {
this.blockRemove = function(dom,time){ this.blockRemove = function(dom,time){
Notiflix.Block.Remove(dom, time); Notiflix.Block.Remove(dom, time);
} }
this.block = function(option){ this.block = function(option){
if(option.type==1){ if(option.type==1){
Notiflix.Block.Standard( Notiflix.Block.Standard(
option.elem option.elem
,option.msg); ,option.msg);
} }
else if(option.type==2){ else if(option.type==2){
Notiflix.Block.Hourglass( Notiflix.Block.Hourglass(
option.elem option.elem
,option.msg); ,option.msg);
} }
else if(option.type==3){ else if(option.type==3){
Notiflix.Block.Circle(
Notiflix.Block.Circle(
option.elem option.elem
,option.msg); ,option.msg);
} }
else if(option.type==4){ else if(option.type==4){
Notiflix.Block.Arrows( Notiflix.Block.Arrows(
option.elem option.elem
,option.msg); ,option.msg);
} }
else if(option.type==5){ else if(option.type==5){
@ -51,75 +43,53 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
} }
else if(option.type==6){ else if(option.type==6){
Notiflix.Block.Pulse( Notiflix.Block.Pulse(
option.elem option.elem
,option.msg); ,option.msg);
} }
} }
this.report = function(option){ this.report = function(option){
if(option.type=="success"){ if(option.type=="success"){
Notiflix.Report.Success( Notiflix.Report.Success(
option.title, option.title,
option.message,'确认'); option.message,'确认');
}else if(option.type=="failure"){ }else if(option.type=="failure"){
Notiflix.Report.Failure( Notiflix.Report.Failure(
option.title, option.title,
option.message,'确认'); option.message,'确认');
}else if(option.type=="warning"){ }else if(option.type=="warning"){
Notiflix.Report.Warning( Notiflix.Report.Warning(
option.title, option.title,
option.message,'确认'); option.message,'确认');
}else if(option.type=="info"){ }else if(option.type=="info"){
Notiflix.Report.Info( Notiflix.Report.Info(
option.title, option.title,
option.message,'确认'); option.message,'确认');
} }
} }
this.notice = function(option){ this.notice = function(option){
Notiflix.Notify.Init({ Notiflix.Notify.Init({
position:option.position?"right-top":option.position, position:option.position?"right-top":option.position,
}); });
if(option.type=="success"){ if(option.type=="success"){
Notiflix.Notify.Success(option.title); Notiflix.Notify.Success(option.title);
}else if(option.type=="failure"){ }else if(option.type=="failure"){
Notiflix.Notify.Failure(option.title); Notiflix.Notify.Failure(option.title);
}else if(option.type=="warning"){ }else if(option.type=="warning"){
Notiflix.Notify.Warning(option.title); Notiflix.Notify.Warning(option.title);
}else if(option.type=="info"){ }else if(option.type=="info"){
Notiflix.Notify.Info(option.title); Notiflix.Notify.Info(option.title);
} }
} }
this.confirm = function(option){ this.confirm = function(option){
Notiflix.Confirm.Show( Notiflix.Confirm.Show(
option.title, option.title,
option.message, option.message,
@ -128,59 +98,37 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
option.success, option.success,
option.cancle option.cancle
); );
} }
this.drawer = function(position,dom,distance){ this.drawer = function(position,dom,distance){
var _right = new mSlider({ var _right = new mSlider({
dom: dom, dom: dom,
direction: position, direction: position,
distance:distance distance:distance
}); });
_right.open(); _right.open();
} }
this.loadRemove = function(time){ this.loadRemove = function(time){
Notiflix.Loading.Remove(time); Notiflix.Loading.Remove(time);
} }
this.Load = function(type,message){ this.Load = function(type,message){
if(type==1){ if(type==1){
Notiflix.Loading.Standard(message); Notiflix.Loading.Standard(message);
}else if(type==2){ }else if(type==2){
Notiflix.Loading.Hourglass(message); Notiflix.Loading.Hourglass(message);
}else if(type==3){ }else if(type==3){
Notiflix.Loading.Circle(message); Notiflix.Loading.Circle(message);
}else if(type==4){ }else if(type==4){
Notiflix.Loading.Dots(message); Notiflix.Loading.Dots(message);
}else if(type==5){ }else if(type==5){
Notiflix.Loading.Pulse(message); Notiflix.Loading.Pulse(message);
} }
} }
this.msg = function(option){ this.msg = function(option){
if(option.type=="success"){ if(option.type=="success"){
layer.msg(option.title,{icon:1,time:option.time},option.callback); layer.msg(option.title,{icon:1,time:option.time},option.callback);
@ -198,10 +146,6 @@ layui.define(['table', 'jquery', 'element'], function (exports) {
layer.msg(option.title,{icon:4,time:option.time},option.callback); layer.msg(option.title,{icon:4,time:option.time},option.callback);
} }
} }
}; };
// Notiflix: Notify Default Settings on // Notiflix: Notify Default Settings on

View File

@ -108,9 +108,9 @@
$(".loading-5").click(function(){ $(".loading-5").click(function(){
pearOper.Load(5,""); loading.Load(5,"");
pearOper.loadRemove(1000); loading.loadRemove(1000);
}) })
$(".block-1").click(function(){ $(".block-1").click(function(){
@ -125,8 +125,8 @@
}) })
$(".block-3").click(function(){ $(".block-3").click(function(){
pearOper.block({type:3,elem:'.load-div-1',msg:''}) loading.block({type:3,elem:'.load-div-1',msg:''})
pearOper.blockRemove(".load-div-1",1000); loading.blockRemove(".load-div-1",1000);
}) })
$(".block-4").click(function(){ $(".block-4").click(function(){