图片预览问题修改

This commit is contained in:
cwchen 2025-04-14 15:31:05 +08:00
parent c9d58da3af
commit 8304c056b4
3 changed files with 21 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

View File

@ -3,6 +3,7 @@ function viewImg(item) {
layer.photos({ layer.photos({
shade: 0.5, shade: 0.5,
footer: false, footer: false,
// toolbar: ['prev', 'next', 'download', 'customBtn'], // 添加自定义按钮标识
photos: { photos: {
"title": "图片预览", "title": "图片预览",
"start": 0, "start": 0,
@ -13,6 +14,26 @@ function viewImg(item) {
} }
] ]
}, },
success: function(layero){
// 获取工具栏元素
var toolbar = $(layero).find('.layui-layer-photos-toolbar');
// 添加自定义按钮
var customBtn = $('<div class="layui-layer-photos-btn layui-layer-photos-customBtn" title="原图下载">'+
'<img style="margin-top: 15px;cursor: pointer;" src="../../img/synthesisQuery/download_icon2.png"></div>');
toolbar.append(customBtn);
// 绑定点击事件
customBtn.on('click', function(){
imgDownLoad(item,1);
});
var customBtn2 = $('<div class="layui-layer-photos-btn layui-layer-photos-customBtn" title="水印下载">'+
'<img style="margin-top: 15px;cursor: pointer;" src="../../img/synthesisQuery/water_icon.png"></div>');
toolbar.append(customBtn2);
// 绑定点击事件
customBtn2.on('click', function(){
generateWatermark(item)
});
}
}); });
} }