统一skin、anim
parent
0517d4c85c
commit
86c4d01e6a
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue