File was renamed from js/layui/phpyun_layer.js |
| | |
| | | /** |
| | | * 使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; |
| | |
| | | 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; |
| | | } |
| | |
| | | //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') { |
| | |
| | | return layer.open(options); |
| | | }; |
| | | });//end layui.use() |
| | | |
| | | function monthclick(laydate, elem, hasdone) { |
| | | var timestamp = new Date(); |
| | | nowyear = timestamp.getFullYear(), |