fix:相机优化

This commit is contained in:
2026-10-25 16:16:27 +08:00
parent 027cfc95b1
commit 6993c36efb
6 changed files with 158 additions and 65 deletions
+23 -8
View File
@@ -327,18 +327,33 @@ select {
margin-top: 8px;
}
/*
* 相机 file input 用「移出视口」隐藏,而不是 display:none:
* 部分 iOS Safari 版本不允许对 display:none 的 file input 触发 .click(),会表现为点了没反应。
/**
* 移动端系统相机入口:
* 原生 input 透明铺满按钮,用户手指直接点在 input 上(真实手势),
* 浏览器才更愿意按 capture="environment" 调起相机。
*
* 旧实现把 input 移到 left:-9999px 再由按钮脚本 .click():
* iOS Safari 会点了没反应,部分安卓 WebView 则把相机 intent 降级成文件选择
* (表现为点「拍照」却弹出文件浏览)。
*/
.image-upload-camera-input,
.worker-acceptance-video-camera-input {
position: fixed;
top: 0;
left: -9999px;
width: 1px;
height: 1px;
position: absolute;
inset: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
}
.camera-pick-trigger {
position: relative;
display: inline-flex;
align-items: center;
}
/* 视觉按钮只负责外观,点击统一由上层透明 input 接收(避免脚本 click 触发降级) */
.camera-pick-trigger .ant-btn {
pointer-events: none;
}