fix: add confirm before deleting photo in edit modal

This commit is contained in:
tian 2026-05-08 12:12:11 +08:00
parent e7181bde7d
commit f849df4540

View File

@ -79,7 +79,7 @@ function showEdit(id,name,photos){
html+='<button class="btn" type="submit" style="margin-bottom:1px">保存</button></form>';
html+='<div style="display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px">';
photos.forEach(function(p){
html+='<div style="position:relative;width:80px;height:100px"><img src="'+p+'" style="width:100%;height:100%;object-fit:cover;border-radius:4px"><span class="btn-icon ghost" style="position:absolute;top:2px;right:2px;font-size:10px;padding:1px 3px;color:red;background:rgba(0,0,0,0.5)" onclick="this.parentElement.remove()">&times;</span></div>';
html+='<div style="position:relative;width:80px;height:100px"><img src="'+p+'" style="width:100%;height:100%;object-fit:cover;border-radius:4px"><span class="btn-icon ghost" style="position:absolute;top:2px;right:2px;font-size:10px;padding:1px 3px;color:red;background:rgba(0,0,0,0.5)" onclick="if(confirm('删除这张照片?'))this.parentElement.remove()">&times;</span></div>';
});
html+='</div>';
html+='<form method="post" action="/ui/face-gallery/add-photo" enctype="multipart/form-data" style="display:flex;gap:8px;align-items:flex-end">';