修改 layer.photos 底部提示内容

This commit is contained in:
Jack 2022-07-28 11:35:44 +08:00
parent 1339f44975
commit 746bd44e16

View File

@ -1280,6 +1280,8 @@ layer.photos = function(options, loop, key){
loadImage(data[start].src, function(img){
layer.close(dict.loadi);
let alt = data[start].alt||'';
//切换图片时不出现动画
if(key) options.anim = -1;
@ -1317,15 +1319,36 @@ layer.photos = function(options, loop, key){
isOutAnim: false,
skin: 'layui-layer-photos' + skin('photos'),
content: '<div class="layui-layer-phimg">'
+'<img src="'+ data[start].src +'" alt="'+ (data[start].alt||'') +'" layer-pid="'+ data[start].pid +'">'
+'<img src="'+ data[start].src +'" alt="'+ alt +'" layer-pid="'+ data[start].pid +'">'
+function(){
let tip = '<div class="layui-layer-imgsee">';
if(data.length > 1){
return '<div class="layui-layer-imgsee">'
+'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>'
+'<div class="layui-layer-imgbar" style="display:'+ (key ? 'block' : '') +'"><span class="layui-layer-imgtit"><a href="javascript:;">'+ (data[start].alt || '') +'</a><em>'+ dict.imgIndex +' / '+ data.length +'</em></span></div>'
+'</div>'
tip += '<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>';
if(alt===''){
tip += '<div class="layui-layer-imgbar" style="display:'+ (key ? 'block' : '') +'"><span class="layui-layer-imgtit"><em>'+ dict.imgIndex +' / '+ data.length +'</em></span></div>';
}
else{
tip += '<div class="layui-layer-imgbar" style="display:'+ (key ? 'block' : '') +'"><span class="layui-layer-imgtit"><span>'+ alt +'</span><em>'+ dict.imgIndex +' / '+ data.length +'</em></span></div>';
}
tip += '</div>';
}
return '';
else if(data.length === 1){
if(alt===''){
tip = '';
}
else{
tip += '<div class="layui-layer-imgbar" style="display:'+ (key ? 'block' : '') +'"><span class="layui-layer-imgtit"><span>'+ alt +'</span></span></div>';
tip += '</div>';
}
}
else{
tip = '';
}
return tip;
}()
+'</div>',
success: function(layero, index){