From 86c4d01e6ac35c99c1f681fbd561ce869fb36f30 Mon Sep 17 00:00:00 2001 From: bobi Date: Sun, 12 May 2019 19:43:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80skin=E3=80=81anim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/layui_plugins/okLayer/okLayer.js | 32 +++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/lib/layui_plugins/okLayer/okLayer.js b/lib/layui_plugins/okLayer/okLayer.js index f3ba6df..29c4a83 100644 --- a/lib/layui_plugins/okLayer/okLayer.js +++ b/lib/layui_plugins/okLayer/okLayer.js @@ -1,14 +1,8 @@ layui.define(["layer"], function (exports) { var $ = layui.jquery; var okLayer = { - // TODO 统一全站风格 - tableNotCheckMsg: function () { - layer.msg("未选择有效数据", {offset: "t", anim: 6}); - }, - confirm: function (content, yesFunction) { - var options = {skin: "layui-layer-lan", icon: 2, title: "提示", anim: 6}; - layer.confirm(content, options, yesFunction); - }, + skinStyle: 2, + animStyle: 2, tableCheck: function (table) { var checkStatus = table.checkStatus("tableId"); var rows = checkStatus.data.length; @@ -27,6 +21,10 @@ layui.define(["layer"], function (exports) { $(".layui-laypage-btn")[0].click(); }); }, + confirm: function (content, yesFunction) { + var options = {skin: okLayer.skinChoose(), icon: 2, title: "提示", anim: okLayer.animChoose()}; + layer.confirm(content, options, yesFunction); + }, open: function (title, content, width, height) { layer.open({ title: title, @@ -34,15 +32,29 @@ layui.define(["layer"], function (exports) { shade: false, maxmin: true, shade: 0.5, - anim: 4, + anim: okLayer.animChoose(), area: [width, height], content: content, zIndex: layer.zIndex, - skin: "layui-layer-molv", + skin: okLayer.skinChoose(), end: function () { $(".layui-laypage-btn")[0].click(); } }); + }, + skinChoose: function () { + if (okLayer.skinStyle == 1) { + return "layui-layer-lan"; + } else if (okLayer.skinStyle == 2) { + return "layui-layer-molv"; + } + }, + animChoose: function () { + if (okLayer.animStyle == 1) { + return 0; + } else if (okLayer.animStyle == 2) { + return Math.floor(Math.random() * 7); + } } }