Merge pull request '杨名杰' (#8) from ymj_branch into develop

mt_branch
pv29wuy56 1 year ago
commit c28add6a87

@ -1,2 +1,157 @@
/** layui-v2.5.6 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"&#xe619;":"&#xe603;")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"&#xe61a;":"&#xe602;")+"</button>"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")}),i.join("")}(),"</ul></div>"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a<n.index&&e.slide("sub",n.index-a)})},m.prototype.slide=function(e,i){var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){l.eq(c).addClass(r),l.eq(u.index).addClass(r)},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){l.eq(c).addClass(o),l.eq(u.index).addClass(o)},50)),setTimeout(function(){l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),n.haveSlide=!1},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))},m.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){clearInterval(e.timer)}).on("mouseleave",function(){e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){var i=new m(e);return i},e(t,n)});
;layui.define("jquery",function(e){"use strict";
// 引入 layui 的 $jQuery模块
var i=layui.$,
// 初始化配置对象
n=(layui.hint(),layui.device(),{config:{},set:function(e){
var n=this;
// 设置配置
return n.config=i.extend({},n.config,e),n},
on:function(e,i){
return layui.onevent.call(this,t,e,i)}}),
// 定义常量
t="carousel", // 轮播图的名称
a="layui-this", // 当前活动的元素
l=">*[carousel-item]>*", // 选择轮播图的每一个项目
o="layui-carousel-left", // 左箭头
r="layui-carousel-right", // 右箭头
d="layui-carousel-prev", // 上一项按钮
s="layui-carousel-next", // 下一项按钮
u="layui-carousel-arrow", // 箭头
c="layui-carousel-ind", // 指示器(小圆点)
// 定义轮播图的核心功能
m=function(e){
var t=this;
t.config=i.extend({},t.config,n.config,e),t.render()
};
// 轮播图的默认配置
m.prototype.config={
width:"600px", // 默认宽度
height:"280px", // 默认高度
full:!1, // 是否全屏
arrow:"hover", // 箭头显示方式hover即鼠标悬浮时显示
indicator:"inside", // 指示器的位置inside表示在轮播图内
autoplay:!0, // 是否自动播放
interval:3e3, // 自动播放的间隔时间,单位是毫秒
anim:"", // 动画效果
trigger:"click", // 触发方式:点击
index:0 // 默认显示第0项
},
// 渲染轮播图
m.prototype.render=function(){
var e=this,n=e.config;
n.elem=i(n.elem),
n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))
},
// 重新加载轮播图
m.prototype.reload=function(e){
var n=this;
clearInterval(n.timer),
n.config=i.extend({},n.config,e),
n.render()
},
// 获取上一项的索引
m.prototype.prevIndex=function(){
var e=this,i=e.config,n=i.index-1;
return n<0&&(n=e.elemItem.length-1),n
},
// 获取下一项的索引
m.prototype.nextIndex=function(){
var e=this,i=e.config,n=i.index+1;
return n>=e.elemItem.length&&(n=0),n
},
// 增加索引
m.prototype.addIndex=function(e){
var i=this,n=i.config;
e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)
},
// 减少索引
m.prototype.subIndex=function(e){
var i=this,n=i.config;
e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)
},
// 自动播放
m.prototype.autoplay=function(){
var e=this,i=e.config;
i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){
e.slide()
},i.interval))
},
// 箭头按钮
m.prototype.arrow=function(){
var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"&#xe619;":"&#xe603;")+"</button>",
'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"&#xe61a;":"&#xe602;")+"</button>"].join(""));
// 设置箭头的显示方式
n.elem.attr("lay-arrow",n.arrow),
n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),
n.elem.append(t),
t.on("click",function(){
var n=i(this),t=n.attr("lay-type");
e.slide(t)
})
},
// 指示器
m.prototype.indicator=function(){
var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){
var i=[];
return layui.each(e.elemItem,function(e){
i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")
}),i.join("")
}(),"</ul></div>"].join(""));
// 设置指示器的显示方式
n.elem.attr("lay-indicator",n.indicator),
n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),
n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),
t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){
var t=i(this),a=t.index();
a>n.index?e.slide("add",a-n.index):a<n.index&&e.slide("sub",n.index-a)
})
},
// 切换轮播图
m.prototype.slide=function(e,i){
var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");
n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){
l.eq(c).addClass(r),l.eq(u.index).addClass(r)
},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){
l.eq(c).addClass(o),l.eq(u.index).addClass(o)
},50)),setTimeout(function(){
l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),
n.haveSlide=!1
},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),
n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))
},
// 事件绑定
m.prototype.events=function(){
var e=this,i=e.config;
i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){
clearInterval(e.timer)
}).on("mouseleave",function(){
e.autoplay()
}),i.elem.data("haveEvents",!0))
},
// 初始化轮播图
n.render=function(e){
var i=new m(e);
return i
},
// 触发layui事件
e(t,n)
});

@ -1,2 +1,58 @@
/** layui-v2.5.6 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")),c.html('<ol class="layui-code-ol"><li>'+o.replace(/[\r\t\n]+/g,"</li><li>")+"</li></ol>"),c.find(">.layui-code-h3")[0]||c.prepend('<h3 class="layui-code-h3">'+(c.attr("lay-title")||e.title||"code")+(e.about?'<a href="'+l+'" target="_blank">layui.code</a>':"")+"</h3>");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss");
;layui.define("jquery",function(e){"use strict";
// 引入 layui 的 $jQuery模块
var a=layui.$,
// layui 文档模块的 URL 地址
l="http://www.layui.com/doc/modules/code.html";
// 定义模块 "code",并执行传入的函数
e("code",function(e){
var t=[]; // 初始化一个空数组,用于存储每个代码块元素
// 如果 e 参数未定义,则默认为空对象
e=e||{},
// 如果 e 中没有指定 about则默认为 true
e.about=!("about"in e)||e.about,
// 获取所有指定的代码块元素,默认为 .layui-code
e.elem=a(e.elem||".layui-code"),
// 遍历所有代码块元素
e.elem.each(function(){
t.push(this); // 将每个代码块元素添加到数组 t 中
}),
// 倒序遍历每个代码块元素
layui.each(t.reverse(),function(t,i){
var c=a(i), // 获取当前代码块元素
o=c.html(); // 获取当前代码块的 HTML 内容
// 如果代码块元素有 lay-encode 属性或者传入参数 e.encode 为真,进行 HTML 转义
(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;")
.replace(/</g,"&lt;")
.replace(/>/g,"&gt;")
.replace(/'/g,"&#39;")
.replace(/"/g,"&quot;"));
// 将转义后的 HTML 内容分行显示,每行一个 <li> 元素
c.html('<ol class="layui-code-ol"><li>'+o.replace(/[\r\t\n]+/g,"</li><li>")+"</li></ol>");
// 如果没有标题插入一个标题h3标题内容可以通过 lay-title 来指定
c.find(">.layui-code-h3")[0] || c.prepend('<h3 class="layui-code-h3">'+(c.attr("lay-title")||e.title||"code")+(e.about?'<a href="'+l+'" target="_blank">layui.code</a>':"")+"</h3>");
// 获取代码块中的 <ol> 元素
var d=c.find(">.layui-code-ol");
// 为代码块添加类名,设置样式
c.addClass("layui-box layui-code-view"),
// 如果有指定 skin 或 lay-skin给代码块添加相应的样式
(c.attr("lay-skin")||e.skin) && c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),
// 如果代码行数超过100行设置左边距使其有缩进效果
(d.find("li").length/100|0)>0 && d.css("margin-left",(d.find("li").length/100|0)+"px"),
// 如果指定了 lay-height 或者传入的参数 e.height设置最大高度
(c.attr("lay-height")||e.height) && d.css("max-height",c.attr("lay-height")||e.height)
})
})})
// 引入代码块的 CSS 样式
.addcss("modules/code.css","skincodecss");

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,2 +1,118 @@
/** layui-v2.5.6 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon ">&#xe63e;</i>';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="<cite>加载更多</cite>",h=l('<div class="layui-flow-more"><a href="javascript:;">'+d+"</a></div>");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),!i&&f.width()&&(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;s<t.lazyimg.elem.length;s++){var v=t.lazyimg.elem.eq(s),y=a?function(){return v.offset().top-n.offset().top+m}():v.offset().top;if(c(v,f),i=s,y>u)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)});
;layui.define("jquery", function(e) {
"use strict";
var l = layui.$, o = function(e) {}, t = '<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon ">&#xe63e;</i>';
// 定义 load 方法,用于加载更多内容
o.prototype.load = function(e) {
var o, i, n, r, a = this, c = 0;
e = e || {};
var f = l(e.elem); // 获取加载更多按钮所在的元素
if (f[0]) { // 如果该元素存在
var m = l(e.scrollElem || document), // 获取滚动容器元素,默认为 document
u = e.mb || 50, // 滚动到距离底部多少距离时触发加载更多
s = !("isAuto" in e) || e.isAuto, // 是否自动加载
v = e.end || "没有更多了", // 加载完成后的提示
y = e.scrollElem && e.scrollElem !== document, // 判断是否是自定义滚动区域
d = "<cite>加载更多</cite>", // 默认的加载更多文本
h = l('<div class="layui-flow-more"><a href="javascript:;">' + d + "</a></div>");
f.find(".layui-flow-more")[0] || f.append(h); // 如果没有加载更多的按钮,则追加
var p = function(e, t) {
e = l(e);
h.before(e); // 将新内容插入到加载更多按钮之前
t = 0 == t || null;
t ? h.html(v) : h.find("a").html(d); // 如果已加载完毕,显示“没有更多了”
i = t;
o = null;
n && n();
};
// 加载更多逻辑
var g = function() {
o = !0;
h.find("a").html(t); // 显示加载动画
"function" == typeof e.done && e.done(++c, p); // 如果有 done 方法,调用它
};
// 初始化加载
g();
// 点击加载更多时,触发加载操作
h.find("a").on("click", function() {
l(this);
i || o || g();
});
// 如果启用了懒加载
if (e.isLazyimg) var n = a.lazyimg({ elem: e.elem + " img", scrollElem: e.scrollElem });
return s ? (m.on("scroll", function() {
var e = l(this), t = e.scrollTop();
r && clearTimeout(r);
!i && f.width() && (r = setTimeout(function() {
var i = y ? e.height() : l(window).height(),
n = y ? e.prop("scrollHeight") : document.documentElement.scrollHeight;
// 滚动到底部时加载更多
n - t - i <= u && (o || g());
}, 100));
}), a) : a;
}
};
// 懒加载方法
o.prototype.lazyimg = function(e) {
var o, t = this, i = 0;
e = e || {};
var n = l(e.scrollElem || document), r = e.elem || "img", a = e.scrollElem && e.scrollElem !== document;
// 图片加载检查和设置
var c = function(e, l) {
var o = n.scrollTop(), r = o + l, c = a ? function() {
return e.offset().top - n.offset().top + o;
}() : e.offset().top;
if (c >= o && c <= r && !e.attr("src")) {
var m = e.attr("lay-src");
layui.img(m, function() {
var l = t.lazyimg.elem.eq(i);
e.attr("src", m).removeAttr("lay-src");
l[0] && f(l);
i++;
});
}
};
// 触发懒加载
var f = function(e, o) {
var f = a ? (o || n).height() : l(window).height(), m = n.scrollTop(), u = m + f;
t.lazyimg.elem = l(r);
if (e) c(e, f);
else {
for (var s = 0; s < t.lazyimg.elem.length; s++) {
var v = t.lazyimg.elem.eq(s),
y = a ? function() {
return v.offset().top - n.offset().top + m;
}() : v.offset().top;
if (c(v, f), i = s, y > u) break;
}
}
};
// 初次加载图片
f();
if (!o) {
var m;
n.on("scroll", function() {
var e = l(this);
m && clearTimeout(m);
m = setTimeout(function() {
f(null, e);
}, 50);
});
o = !0;
}
return f;
};
// 定义模块接口
e("flow", new o);
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,2 +1,138 @@
/** layui-v2.5.6 MIT License By https://www.layui.com */
;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"&#x4E0A;&#x4E00;&#x9875;",a.next="next"in a?a.next:"&#x4E0B;&#x4E00;&#x9875;";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?'<a href="javascript:;" class="layui-laypage-prev'+(1==a.curr?" "+r:"")+'" data-page="'+(a.curr-1)+'">'+a.prev+"</a>":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push('<a href="javascript:;" class="layui-laypage-first" data-page="1" title="&#x9996;&#x9875;">'+(a.first||1)+"</a>");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r<t-1&&(r=u-t+1),a.first!==!1&&r>2&&e.push('<span class="layui-laypage-spr">&#x2026;</span>');r<=u;r++)r===a.curr?e.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+(/^#/.test(a.theme)?'style="background-color:'+a.theme+';"':"")+"></em><em>"+r+"</em></span>"):e.push('<a href="javascript:;" data-page="'+r+'">'+r+"</a>");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1<a.pages&&e.push('<span class="layui-laypage-spr">&#x2026;</span>'),0!==t&&e.push('<a href="javascript:;" class="layui-laypage-last" title="&#x5C3E;&#x9875;" data-page="'+a.pages+'">'+(a.last||a.pages)+"</a>")),e.join("")}(),next:function(){return a.next?'<a href="javascript:;" class="layui-laypage-next'+(a.curr==a.pages?" "+r:"")+'" data-page="'+(a.curr+1)+'">'+a.next+"</a>":""}(),count:'<span class="layui-laypage-count">共 '+a.count+" 条</span>",limit:function(){var e=['<span class="layui-laypage-limits"><select lay-ignore>'];return layui.each(a.limits,function(t,n){e.push('<option value="'+n+'"'+(n===a.limit?"selected":"")+">"+n+" 条/页</option>")}),e.join("")+"</select></span>"}(),refresh:['<a href="javascript:;" data-page="'+a.curr+'" class="layui-laypage-refresh">','<i class="layui-icon layui-icon-refresh"></i>',"</a>"].join(""),skip:function(){return['<span class="layui-laypage-skip">&#x5230;&#x7B2C;','<input type="text" min="1" value="'+a.curr+'" class="layui-input">','&#x9875;<button type="button" class="layui-laypage-btn">&#x786e;&#x5b9a;</button>',"</span>"].join("")}()};return['<div class="layui-box layui-laypage layui-laypage-'+(a.theme?/^#/.test(a.theme)?"molv":a.theme:"default")+'" id="layui-laypage-'+a.index+'">',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"</div>"].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;o<y;o++)"a"===r[o].nodeName.toLowerCase()&&s.on(r[o],"click",function(){var e=0|this.getAttribute("data-page");e<1||e>i.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});
layui.define(function(e){"use strict";
var a = document,
t = "getElementById",
n = "getElementsByTagName",
i = "laypage",
r = "layui-disabled", // 禁用的class
u = function(e) {
var a = this;
a.config = e || {}, a.config.index = ++s.index, a.render(!0);
};
u.prototype.type = function() {
var e = this.config;
// 判断传入的配置元素类型object类型如果只有一个元素就返回2如果有多个返回3
if ("object" == typeof e.elem) return void 0 === e.elem.length ? 2 : 3;
};
u.prototype.view = function() {
var e = this, a = e.config, t = a.groups = "groups" in a ? 0 | a.groups : 5;
// 设置分页的基本配置,包括显示的页数,当前页等
a.layout = "object" == typeof a.layout ? a.layout : ["prev", "page", "next"];
a.count = 0 | a.count;
a.curr = 0 | a.curr || 1;
a.limits = "object" == typeof a.limits ? a.limits : [10, 20, 30, 40, 50];
a.limit = 0 | a.limit || 10;
a.pages = Math.ceil(a.count / a.limit) || 1;
a.curr > a.pages && (a.curr = a.pages);
t < 0 ? t = 1 : t > a.pages && (t = a.pages);
a.prev = "prev" in a ? a.prev : "上一页";
a.next = "next" in a ? a.next : "下一页";
var n = a.pages > t ? Math.ceil((a.curr + (t > 1 ? 1 : 0)) / (t > 0 ? t : 1)) : 1;
// 创建分页的各个部分
var i = {
prev: function() {
return a.prev ? '<a href="javascript:;" class="layui-laypage-prev' + (1 == a.curr ? " " + r : "") + '" data-page="' + (a.curr - 1) + '">' + a.prev + "</a>" : "";
}(),
page: function() {
var e = [];
if (a.count < 1) return "";
n > 1 && a.first !== !1 && 0 !== t && e.push('<a href="javascript:;" class="layui-laypage-first" data-page="1" title="首页">' + (a.first || 1) + "</a>");
var i = Math.floor((t - 1) / 2),
r = n > 1 ? a.curr - i : 1,
u = n > 1 ? function() {
var e = a.curr + (t - i - 1);
return e > a.pages ? a.pages : e;
}() : t;
// 生成分页数字
for (u - r < t - 1 && (r = u - t + 1), a.first !== !1 && r > 2 && e.push('<span class="layui-laypage-spr">…</span>'); r <= u; r++)
r === a.curr ? e.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" ' + (/^#/.test(a.theme) ? 'style="background-color:' + a.theme + ';"' : "") + "></em><em>" + r + "</em></span>") :
e.push('<a href="javascript:;" data-page="' + r + '">' + r + "</a>");
return a.pages > t && a.pages > u && a.last !== !1 && (u + 1 < a.pages && e.push('<span class="layui-laypage-spr">…</span>'), 0 !== t && e.push('<a href="javascript:;" class="layui-laypage-last" title="尾页" data-page="' + a.pages + '">' + (a.last || a.pages) + "</a>")), e.join("");
}(),
next: function() {
return a.next ? '<a href="javascript:;" class="layui-laypage-next' + (a.curr == a.pages ? " " + r : "") + '" data-page="' + (a.curr + 1) + '">' + a.next + "</a>" : "";
}(),
count: '<span class="layui-laypage-count">共 ' + a.count + " 条</span>",
limit: function() {
var e = ['<span class="layui-laypage-limits"><select lay-ignore>'];
layui.each(a.limits, function(t, n) {
e.push('<option value="' + n + '" ' + (n === a.limit ? "selected" : "") + ">" + n + " 条/页</option>");
});
return e.join("") + "</select></span>";
}(),
refresh: ['<a href="javascript:;" data-page="' + a.curr + '" class="layui-laypage-refresh">', '<i class="layui-icon layui-icon-refresh"></i>', "</a>"].join(""),
skip: function() {
return ['<span class="layui-laypage-skip">到第', '<input type="text" min="1" value="' + a.curr + '" class="layui-input">', '页<button type="button" class="layui-laypage-btn">确定</button>', "</span>"].join("");
}()
};
return ['<div class="layui-box layui-laypage layui-laypage-' + (a.theme ? /^#/.test(a.theme) ? "molv" : a.theme : "default") + '" id="layui-laypage-' + a.index + '">', function() {
var e = [];
return layui.each(a.layout, function(a, t) {
i[t] && e.push(i[t]);
}), e.join("");
}(), "</div>"].join("");
};
u.prototype.jump = function(e, a) {
if (e) {
var t = this, i = t.config, r = e.children, u = e[n]("button")[0], l = e[n]("input")[0], p = e[n]("select")[0], c = function() {
var e = 0 | l.value.replace(/\s|\D/g, "");
e && (i.curr = e, t.render());
};
if (a) return c();
for (var o = 0, y = r.length; o < y; o++) {
"a" === r[o].nodeName.toLowerCase() && s.on(r[o], "click", function() {
var e = 0 | this.getAttribute("data-page");
e < 1 || e > i.pages || (i.curr = e, t.render());
});
}
p && s.on(p, "change", function() {
var e = this.value;
i.curr * e > i.count && (i.curr = Math.ceil(i.count / e)), i.limit = e, t.render();
});
u && s.on(u, "click", function() {
c();
});
}
};
u.prototype.skip = function(e) {
if (e) {
var a = this, t = e[n]("input")[0];
t && s.on(t, "keyup", function(t) {
var n = this.value, i = t.keyCode;
/^(37|38|39|40)$/.test(i) || (/\\D/.test(n) && (this.value = n.replace(/\\D/, "")), 13 === i && a.jump(e, !0));
});
}
};
u.prototype.render = function(e) {
var n = this, i = n.config, r = n.type(), u = n.view();
2 === r ? i.elem && (i.elem.innerHTML = u) : 3 === r ? i.elem.html(u) : a[t](i.elem) && (a[t](i.elem).innerHTML = u);
i.jump && i.jump(i, e);
var s = a[t]("layui-laypage-" + i.index);
n.jump(s), i.hash && !e && (location.hash = "!" + i.hash + "=" + i.curr), n.skip(s);
};
var s = {
render: function(e) {
var a = new u(e);
return a.index;
},
index: layui.laypage ? layui.laypage.index + 1e4 : 0,
on: function(e, a, t) {
return e.attachEvent ? e.attachEvent("on" + a, function(a) {
a.target = a.srcElement, t.call(e, a);
}) : e.addEventListener(a, t, !1), this;
}
};
e(i, s);
});

@ -1,2 +1,86 @@
/** layui-v2.5.6 MIT License By https://www.layui.com */
;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")},error:function(e,r){var c="Laytpl Error";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});
;layui.define(function(e){"use strict";
// 配置模板语法的起始和结束符
var r={open:"{{",close:"}}"},
// 定义常用的正则表达式和方法
c={
exp:function(e){ // 用于生成全局的正则表达式
return new RegExp(e,"g")
},
query:function(e,c,t){ // 生成模板查询的正则表达式
var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];
return n((c||"")+r.open+o+r.close+(t||""))
},
escape:function(e){ // 转义HTML特殊字符
return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;")
.replace(/</g,"&lt;").replace(/>/g,"&gt;")
.replace(/'/g,"&#39;").replace(/"/g,"&quot;")
},
error:function(e,r){ // 输出错误信息
var c="Laytpl Error";
return "object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e
}
},
n=c.exp, // 正则表达式处理函数
t=function(e){ this.tpl=e }; // 定义一个模板处理类
t.pt=t.prototype, window.errors=0;
// 模板解析方法
t.pt.parse=function(e,t){
var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");
// 清理模板中的多余空格和符号
e=e.replace(/\s+|\r|\t|\n/g," ")
.replace(n(r.open+"#"),r.open+"# ")
.replace(n(r.close+"}"),"} "+r.close)
.replace(/\\/g,"\\\\")
.replace(n(r.open+"!(.+?)!"+r.close),function(e){
return e=e.replace(n("^"+r.open+"!"),"")
.replace(n("!"+r.close),"")
.replace(n(r.open+"|"+r.close),function(e){
return e.replace(/(.)/g,"\\$1")
})
})
.replace(/(?="|')/g,"\\")
.replace(c.query(),function(e){
return e=e.replace(a,"").replace(l,""),
'";'+e.replace(/\\/g,"")+';view+="'
})
.replace(c.query(1),function(e){
var c='"+(';
return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')
});
// 构建最终的JavaScript代码
e='"use strict";var view = "'+e+'";return view;';
try{
// 执行生成的模板代码
return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)
}catch(u){
// 如果模板解析失败,输出错误信息
return delete o.cache,c.error(u,p)
}
};
// 渲染模板方法
t.pt.render=function(e,r){
var n,t=this;
return e ? (n=t.cache ? t.cache(e,c.escape) : t.parse(t.tpl,e), r ? void r(n) : n) : c.error("no data");
};
// 创建模板对象
var o=function(e){
return "string"!=typeof e ? c.error("Template not found") : new t(e)
};
// 配置模板引擎的选项
o.config=function(e){
e=e||{};
for(var c in e) r[c]=e[c]
};
// 设置模板版本
o.v="1.2.0", e("laytpl",o)
});

@ -1,2 +1,106 @@
/** layui-v2.5.6 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='<ul class="layui-rate" '+(i.readonly?"readonly":"")+">",u=1;u<=i.length;u++){var r='<li class="layui-inline"><i class="layui-icon '+(u>Math.floor(i.value)?o:s)+'" '+l+"></i></li>";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'<li><i class="layui-icon layui-icon-rate-half" '+l+"></i></li>":n+=r}n+="</ul>"+(i.text?'<span class="layui-inline">'+i.value+"星":"")+"</span>";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)});
;layui.define("jquery",function(e){"use strict";
// 获取 layui 的 jQuery 实例
var a=layui.jquery,
i={config:{},index:layui.rate?layui.rate.index+1e4:0, // 默认配置
set:function(e){ // 设置配置项
var i=this;
return i.config=a.extend({},i.config,e),i
},
on:function(e,a){ // 监听事件
return layui.onevent.call(this,n,e,a)
}
};
// 定义局部变量
var l=function(){
var e=this,a=e.config;
return {
setvalue:function(a){ // 设置评分值
e.setvalue.call(e,a)
},
config:a
}
},
n="rate", // 定义组件标识符
t="layui-rate", // 样式类
o="layui-icon-rate", // 未选中的星星图标
s="layui-icon-rate-solid", // 选中的完整星星图标
u="layui-icon-rate-half", // 半星图标
r="layui-icon-rate-solid layui-icon-rate-half", // 完整星和半星
c="layui-icon-rate-solid layui-icon-rate", // 完整星图标
f="layui-icon-rate layui-icon-rate-half", // 半星图标样式
v=function(e){ // 评分控件构造函数
var l=this;
l.index=++i.index; // 自动递增索引
l.config=a.extend({},l.config,i.config,e); // 合并配置项
l.render(); // 渲染评分控件
};
v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""}, // 默认配置
v.prototype.render=function(){ // 渲染评分组件
var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':""; // 处理主题颜色
i.elem=a(i.elem); // 获取元素
parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value))); // 设置值为整数或半星
var n='<ul class="layui-rate" '+(i.readonly?"readonly":"")+">"; // 初始化评分组件HTML结构
for(var u=1;u<=i.length;u++){
var r='<li class="layui-inline"><i class="layui-icon '+(u>Math.floor(i.value)?o:s)+'" '+l+"></i></li>";
i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?
n=n+'<li><i class="layui-icon layui-icon-rate-half" '+l+"></i></li>":n+=r
}
n+="</ul>"+(i.text?'<span class="layui-inline">'+i.value+"星":"")+"</span>";
var c=i.elem, f=c.next("."+t);
f[0]&&f.remove(); // 移除旧的评分控件
e.elemTemp=a(n); // 渲染新的评分控件
i.span=e.elemTemp.next("span"); // 获取显示评分值的span
i.setText&&i.setText(i.value); // 设置文本
c.html(e.elemTemp); // 将评分控件添加到目标元素
c.addClass("layui-inline"); // 给元素添加样式
i.readonly||e.action(); // 如果不是只读模式,绑定事件
};
v.prototype.setvalue=function(e){ // 设置评分值并重新渲染
var a=this,i=a.config;
i.value=e;
a.render(); // 重新渲染
};
v.prototype.action=function(){ // 处理点击、鼠标悬停和移出事件
var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width(); // 获取星星的宽度
l.children("li").each(function(e){ // 遍历每个星星
var t=e+1,v=a(this);
v.on("click",function(e){ // 处理点击事件
if(i.value=t,i.half){
var o=e.pageX-a(this).offset().left;
o<=n/2&&(i.value=i.value-.5) // 半星处理
}
i.text&&l.next("span").text(i.value+"星"); // 显示星级
i.choose&&i.choose(i.value); // 调用用户自定义的选择事件
i.setText&&i.setText(i.value); // 设置文本
}),
v.on("mousemove",function(e){ // 处理鼠标悬停事件
if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),
l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),
i.half){
var c=e.pageX-a(this).offset().left;
c<=n/2&&v.children("i").addClass(u).removeClass(s) // 半星高亮
}
}),
v.on("mouseleave",function(){ // 处理鼠标移出事件
l.find("i").each(function(){a(this).addClass(o).removeClass(r)});
l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)});
i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)
})
});
};
v.prototype.events=function(){ var e=this;e.config}, // 定义事件
i.render=function(e){ // 渲染评分控件并返回实例
var a=new v(e);
return l.call(a);
};
e(n,i) // 导出模块
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,2 +1,179 @@
/** layui-v2.5.6 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,n,a="layui-fixbar",o="layui-fixbar-top",r=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"&#xe606;":e.bar1,e.bar2=e.bar2===!0?"&#xe607;":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,"&#xe604;"],u=t(['<ul class="'+a+'">',e.bar1?'<li class="layui-icon" lay-type="bar1" style="'+e.bgcolor+'">'+c[0]+"</li>":"",e.bar2?'<li class="layui-icon" lay-type="bar2" style="'+e.bgcolor+'">'+c[1]+"</li>":"",'<li class="layui-icon '+o+'" lay-type="top" style="'+e.bgcolor+'">'+c[2]+"</li>","</ul>"].join("")),g=u.find("."+o),s=function(){var t=r.scrollTop();t>=e.showHeight?i||(g.show(),i=1):i&&(g.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&u.css(e.css),l.append(u),s(),u.find("li").on("click",function(){var i=t(this),n=i.attr("lay-type");"top"===n&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,n)}),r.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){s()},100)}))},countdown:function(e,t,i){var n=this,a="function"==typeof t,o=new Date(e).getTime(),r=new Date(!t||a?(new Date).getTime():t).getTime(),l=o-r,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var u=setTimeout(function(){n.countdown(e,r+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,u),l<=0&&clearTimeout(u),u},timeAgo:function(e,t){var i=this,n=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>26784e5?(a=new Date(e),n[0][0]=i.digit(a.getFullYear(),4),n[0][1]=i.digit(a.getMonth()+1),n[0][2]=i.digit(a.getDate()),t||(n[1][0]=i.digit(a.getHours()),n[1][1]=i.digit(a.getMinutes()),n[1][2]=i.digit(a.getSeconds())),n[0].join("-")+" "+n[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=18e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var n=e.length;n<t;n++)i+="0";return e<Math.pow(10,t)?i+(0|e):e},toDateString:function(e,t){var i=this,n=new Date(e||new Date),a=[i.digit(n.getFullYear(),4),i.digit(n.getMonth()+1),i.digit(n.getDate())],o=[i.digit(n.getHours()),i.digit(n.getMinutes()),i.digit(n.getSeconds())];return t=t||"yyyy-MM-dd HH:mm:ss",t.replace(/yyyy/g,a[0]).replace(/MM/g,a[1]).replace(/dd/g,a[2]).replace(/HH/g,o[0]).replace(/mm/g,o[1]).replace(/ss/g,o[2])},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")},event:function(e,n,a){var o=t("body");return a=a||"click",n=i.event[e]=t.extend(!0,i.event[e],n)||{},i.event.UTIL_EVENT_CALLBACK=i.event.UTIL_EVENT_CALLBACK||{},o.off(a,"*["+e+"]",i.event.UTIL_EVENT_CALLBACK[e]),i.event.UTIL_EVENT_CALLBACK[e]=function(){var i=t(this),a=i.attr(e);"function"==typeof n[a]&&n[a].call(this,i)},o.on(a,"*["+e+"]",i.event.UTIL_EVENT_CALLBACK[e]),n}};!function(e,t,i){"$:nomunge";function n(){a=t[l](function(){o.each(function(){var t=e(this),i=t.width(),n=t.height(),a=e.data(this,u);(i!==a.w||n!==a.h)&&t.trigger(c,[a.w=i,a.h=n])}),n()},r[g])}var a,o=e([]),r=e.resize=e.extend(e.resize,{}),l="setTimeout",c="resize",u=c+"-special-event",g="delay",s="throttleWindow";r[g]=250,r[s]=!0,e.event.special[c]={setup:function(){if(!r[s]&&this[l])return!1;var t=e(this);o=o.add(t),e.data(this,u,{w:t.width(),h:t.height()}),1===o.length&&n()},teardown:function(){if(!r[s]&&this[l])return!1;var t=e(this);o=o.not(t),t.removeData(u),o.length||clearTimeout(a)},add:function(t){function n(t,n,o){var r=e(this),l=e.data(this,u)||{};l.w=n!==i?n:r.width(),l.h=o!==i?o:r.height(),a.apply(this,arguments)}if(!r[s]&&this[l])return!1;var a;return e.isFunction(t)?(a=t,n):(a=t.handler,void(t.handler=n))}}}(t,window),e("util",i)});
layui.define("jquery", function(e) {
"use strict";
var t = layui.$, // 引入 jQuery 库
i = {
// 固定操作栏(侧边固定按钮)
fixbar: function(e) {
var i, n,
a = "layui-fixbar", // 固定按钮的 CSS 类名
o = "layui-fixbar-top", // 顶部按钮的 CSS 类名
r = t(document), // 获取文档对象
l = t("body"); // 获取页面的 body 元素
// 配置项默认值
e = t.extend({ showHeight: 200 }, e);
// 如果没有设置 bar1 和 bar2 的图标,默认使用图标
e.bar1 = e.bar1 === !0 ? "&#xe606;" : e.bar1;
e.bar2 = e.bar2 === !0 ? "&#xe607;" : e.bar2;
// 设置背景颜色样式
e.bgcolor = e.bgcolor ? "background-color:" + e.bgcolor : "";
var c = [e.bar1, e.bar2, "&#xe604;"];
// 创建固定操作栏的 HTML 结构
var u = t([
'<ul class="'+a+'">',
e.bar1 ? '<li class="layui-icon" lay-type="bar1" style="'+e.bgcolor+'">'+c[0]+"</li>" : "",
e.bar2 ? '<li class="layui-icon" lay-type="bar2" style="'+e.bgcolor+'">'+c[1]+"</li>" : "",
'<li class="layui-icon '+o+'" lay-type="top" style="'+e.bgcolor+'">'+c[2]+"</li>",
"</ul>"
].join(""));
var g = u.find("."+o);
// 滚动事件:当页面滚动到指定高度时,显示操作栏
var s = function() {
var t = r.scrollTop();
t >= e.showHeight ? i || (g.show(), i = 1) : i && (g.hide(), i = 0);
};
// 如果操作栏未渲染,则将其添加到页面
t("."+a)[0] || (
"object" == typeof e.css && u.css(e.css),
l.append(u),
s(),
// 绑定点击事件
u.find("li").on("click", function() {
var i = t(this),
n = i.attr("lay-type");
"top" === n && t("html,body").animate({ scrollTop: 0 }, 200);
e.click && e.click.call(this, n);
}),
r.on("scroll", function() {
clearTimeout(n);
n = setTimeout(function() {
s();
}, 100);
})
);
},
// 倒计时功能
countdown: function(e, t, i) {
var n = this,
a = "function" == typeof t, // 如果 t 是函数
o = new Date(e).getTime(), // 目标时间戳
r = new Date(!t || a ? (new Date).getTime() : t).getTime(), // 当前时间戳
l = o - r, // 计算时间差
c = [
Math.floor(l / 864e5), // 天数
Math.floor(l / 36e5) % 24, // 小时
Math.floor(l / 6e4) % 60, // 分钟
Math.floor(l / 1e3) % 60 // 秒
];
// 如果 t 是函数,则执行回调
a && (i = t);
var u = setTimeout(function() {
n.countdown(e, r + 1e3, i);
}, 1e3);
// 回调函数,传递时间差和时间数组
return i && i(l > 0 ? c : [0, 0, 0, 0], t, u),
l <= 0 && clearTimeout(u), // 当倒计时结束,清除定时器
u;
},
// 将时间格式化为“XX时间前”
timeAgo: function(e, t) {
var i = this,
n = [[], []],
a = (new Date).getTime() - new Date(e).getTime(); // 计算当前时间与给定时间的差值
if (a > 26784e5) { // 如果时间差超过 31 天,显示完整的时间
a = new Date(e);
n[0][0] = i.digit(a.getFullYear(), 4);
n[0][1] = i.digit(a.getMonth() + 1);
n[0][2] = i.digit(a.getDate());
t || (n[1][0] = i.digit(a.getHours()), n[1][1] = i.digit(a.getMinutes()), n[1][2] = i.digit(a.getSeconds()));
return n[0].join("-") + " " + n[1].join(":");
}
if (a >= 864e5) return (a / 1e3 / 60 / 60 / 24 | 0) + "天前";
if (a >= 36e5) return (a / 1e3 / 60 / 60 | 0) + "小时前";
if (a >= 18e4) return (a / 1e3 / 60 | 0) + "分钟前";
return a < 0 ? "未来" : "刚刚";
},
// 数字补零
digit: function(e, t) {
var i = "";
e = String(e);
t = t || 2;
for (var n = e.length; n < t; n++) i += "0";
return e < Math.pow(10, t) ? i + (0 | e) : e;
},
// 将时间转为指定格式字符串
toDateString: function(e, t) {
var i = this,
n = new Date(e || new Date),
a = [i.digit(n.getFullYear(), 4), i.digit(n.getMonth() + 1), i.digit(n.getDate())],
o = [i.digit(n.getHours()), i.digit(n.getMinutes()), i.digit(n.getSeconds())];
return t = t || "yyyy-MM-dd HH:mm:ss",
t.replace(/yyyy/g, a[0])
.replace(/MM/g, a[1])
.replace(/dd/g, a[2])
.replace(/HH/g, o[0])
.replace(/mm/g, o[1])
.replace(/ss/g, o[2]);
},
// 转义 HTML 字符
escape: function(e) {
return String(e || "").replace(/&(?!#?[a-zA-Z0-9]+;)/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/'/g, "&#39;")
.replace(/"/g, "&quot;");
},
// 自定义事件绑定
event: function(e, n, a) {
var o = t("body");
return a = a || "click", // 默认事件类型为 "click"
n = i.event[e] = t.extend(!0, i.event[e], n) || {},
i.event.UTIL_EVENT_CALLBACK = i.event.UTIL_EVENT_CALLBACK || {},
o.off(a, "*[" + e + "]", i.event.UTIL_EVENT_CALLBACK[e]),
i.event.UTIL_EVENT_CALLBACK[e] = function() {
var i = t(this),
a = i.attr(e);
"function" == typeof n[a] && n[a].call(this, i);
},
o.on(a, "*[" + e + "]", i.event.UTIL_EVENT_CALLBACK[e]),
n;
}
};
// 窗口大小变化事件(自适应布局)
!function(e, t, i) {
"$:nomunge";
function n() {
a = t[l](function() {
o.each(function() {
var t = e(this),
i = t.width(),
n = t.height(),
a = e.data(this, u);
(i !== a.w || n !== a.h) && t.trigger(c, [a.w = i, a.h = n]);
});
n();
}, r[g]);
}
var a,
o = e([]),
r = e.resize = e.extend(e.resize, {}),
l = "setTimeout",
c = "resize",
u = c + "-special-event",
g = "delay",
s = "throttleWindow";
r[g] = 250;
r[s] = !0;
e.event.special[c] = {
setup: function() {
if (!r[s] && this[l]) return !1;

Loading…
Cancel
Save