From b6bc92ec11e1e280185ce7682d17589cb45c20f3 Mon Sep 17 00:00:00 2001 From: chengkun <chengkun@ishangstudy.com> Date: Mon, 12 May 2025 15:39:07 +0800 Subject: [PATCH] 提交 --- js/layui/custom_layer.js | 30 +++++------------------------- 1 files changed, 5 insertions(+), 25 deletions(-) diff --git a/js/layui/phpyun_layer.js b/js/layui/custom_layer.js similarity index 88% rename from js/layui/phpyun_layer.js rename to js/layui/custom_layer.js index e01c048..39881f0 100644 --- a/js/layui/phpyun_layer.js +++ b/js/layui/custom_layer.js @@ -1,26 +1,10 @@ /** - * 使2017.11.15之前对独立弹窗组件layer.min.js的调用方法兼容于layui.use(['layer']) - - * 注意:该文件必须在 layui/layui.js 文件之后引入页面(同时删除原来引用的 js/layer/layer.min.js) -*/ - -/* - * 使旧的layer.msg()调用兼容layui.use(['layer']) - * - * msg : 消息内容 - * timeSecond : 时间,单位秒,可以有小数位 - * icon : 1 打勾,2打叉,5/9伤心,6/8笑脸,7感叹号 - * callback : 消息展示结束后回调函数 -*/ + * 封装layer.js的常用方法 + */ layui.use(['layer'], function () { var layer = layui.layer, $ = layui.$; - - //先保存原始的layer.msg()方法 layer.oriMsg = layer.msg; - - //再重写layer.msg() - // layer.msg = function (msg, timeSecond = 1.5, icon = 6, callback = function(){}){ layer.msg = function (msg, timeSecond, icon, callback) { timeSecond = (typeof timeSecond !== 'undefined') ? timeSecond : 1.5; icon = (typeof icon !== 'undefined') ? icon : 6; @@ -30,16 +14,12 @@ if (typeof (timeSecond) == 'object') { if (typeof (icon) == 'function') { return layer.oriMsg(msg, timeSecond, icon); - } - else { + } else { return layer.oriMsg(msg, timeSecond); } } var tm = timeSecond * 1000; - - //layui.use(['layer'])中icon: 1 打勾,2打叉,5伤心,6笑脸,7感叹号 - //layer.min.js中icon: 8失败,9成功 if (icon == 8) { icon = 2; } @@ -76,8 +56,7 @@ //layui的layer模块原本调用方式 if (typeof title == 'function') { return layer.oriAlert(msg, icon, title); - } - else { + } else { return layer.oriAlert(msg, icon); } } else if (typeof icon != 'undefined' && typeof title == 'undefined') { @@ -127,6 +106,7 @@ return layer.open(options); }; });//end layui.use() + function monthclick(laydate, elem, hasdone) { var timestamp = new Date(); nowyear = timestamp.getFullYear(), -- Gitblit v1.9.0