From 72b09104a342bb484f0140c5a11f091ff2393419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E4=BB=AA=E5=BC=8F?= <854085467@qq.com> Date: Thu, 1 Oct 2020 23:49:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=83=A8=E5=88=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/pear/module/loading.js | 62 ++------------------------------ view/document/loading.html | 8 ++--- 2 files changed, 7 insertions(+), 63 deletions(-) diff --git a/component/pear/module/loading.js b/component/pear/module/loading.js index d03beea..ee7de04 100644 --- a/component/pear/module/loading.js +++ b/component/pear/module/loading.js @@ -8,40 +8,32 @@ layui.define(['table', 'jquery', 'element'], function (exports) { var pearOper = new function () { this.blockRemove = function(dom,time){ - Notiflix.Block.Remove(dom, time); } - this.block = function(option){ if(option.type==1){ - Notiflix.Block.Standard( option.elem ,option.msg); - } - else if(option.type==2){ Notiflix.Block.Hourglass( option.elem ,option.msg); } else if(option.type==3){ - - Notiflix.Block.Circle( + Notiflix.Block.Circle( option.elem ,option.msg); } - else if(option.type==4){ Notiflix.Block.Arrows( option.elem ,option.msg); } - else if(option.type==5){ @@ -51,75 +43,53 @@ layui.define(['table', 'jquery', 'element'], function (exports) { } else if(option.type==6){ - Notiflix.Block.Pulse( option.elem ,option.msg); } } - - this.report = function(option){ - - if(option.type=="success"){ - Notiflix.Report.Success( option.title, option.message,'确认'); - }else if(option.type=="failure"){ - Notiflix.Report.Failure( option.title, option.message,'确认'); - }else if(option.type=="warning"){ - Notiflix.Report.Warning( option.title, option.message,'确认'); - }else if(option.type=="info"){ - Notiflix.Report.Info( option.title, option.message,'确认'); - } } - this.notice = function(option){ - Notiflix.Notify.Init({ position:option.position?"right-top":option.position, }); - - if(option.type=="success"){ Notiflix.Notify.Success(option.title); - }else if(option.type=="failure"){ Notiflix.Notify.Failure(option.title); - }else if(option.type=="warning"){ - Notiflix.Notify.Warning(option.title); - + Notiflix.Notify.Warning(option.title); }else if(option.type=="info"){ - Notiflix.Notify.Info(option.title); - + Notiflix.Notify.Info(option.title); } } this.confirm = function(option){ - Notiflix.Confirm.Show( option.title, option.message, @@ -128,59 +98,37 @@ layui.define(['table', 'jquery', 'element'], function (exports) { option.success, option.cancle ); - } this.drawer = function(position,dom,distance){ - var _right = new mSlider({ dom: dom, direction: position, distance:distance }); - _right.open(); - } this.loadRemove = function(time){ - Notiflix.Loading.Remove(time); - } this.Load = function(type,message){ - if(type==1){ - Notiflix.Loading.Standard(message); - }else if(type==2){ - Notiflix.Loading.Hourglass(message); - }else if(type==3){ - Notiflix.Loading.Circle(message); - }else if(type==4){ - Notiflix.Loading.Dots(message); - }else if(type==5){ - Notiflix.Loading.Pulse(message); - } - } - - - this.msg = function(option){ - if(option.type=="success"){ 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); } } - - - - }; // Notiflix: Notify Default Settings on diff --git a/view/document/loading.html b/view/document/loading.html index 4fd735b..67fe293 100644 --- a/view/document/loading.html +++ b/view/document/loading.html @@ -108,9 +108,9 @@ $(".loading-5").click(function(){ - pearOper.Load(5,""); + loading.Load(5,""); - pearOper.loadRemove(1000); + loading.loadRemove(1000); }) $(".block-1").click(function(){ @@ -125,8 +125,8 @@ }) $(".block-3").click(function(){ - pearOper.block({type:3,elem:'.load-div-1',msg:''}) - pearOper.blockRemove(".load-div-1",1000); + loading.block({type:3,elem:'.load-div-1',msg:''}) + loading.blockRemove(".load-div-1",1000); }) $(".block-4").click(function(){