feat(miniapp): align UI with H5 and harden device debugging

五个页面按 h5/css 的 style.css → ui-20261009 → ui-20261012 覆盖顺序逐条重排,
换算规则固定为 calc(N * var(--u)) → 2N rpx,固定 px 的字号保持 px。

- app.acss:换回 H5 设计 token(方角小倒角按钮 10rpx、卡片 14rpx、.chev 折线箭头)
- splash/profile/history:底图与按钮文字图改用 H5 资源,隐私/政策弹窗按 H5 重排
- report:环形分用 conic-gradient、人脸裁切窗口叠加 face_maps、标记点百分比盒、
  侧脸皱纹 pending/unavailable 文案;用 Playwright 抓 H5 94 个选择器几何比对,
  整页高 2438.7 vs 2438.67
- camera:淘宝 <camera> 组件在真机整页崩溃(嵌了微信专有的 <cover-view>),
  改为默认系统相机 + `config.nativeCamera` 开关 + pages/camtest 冒烟页验证组件
- permissions:淘宝用带前缀的 scope.camera(裸名返回 5022 Scope:camera信息不存在),
  先试带前缀再退回裸名,拒绝后不再重复弹窗
- voice:非 HTTPS 资源导致的异常不再冒泡成整页崩溃;app.js 加开发版错误 toast
- 开发版入口:权限诊断(启动页/相机页)、相机组件测试
- 测试 20/20(新增权限与相机能力用例)
This commit is contained in:
xsl
2026-11-01 23:30:38 +08:00
parent f5c416dd9d
commit fed52930cc
33 changed files with 3061 additions and 876 deletions
+183 -107
View File
@@ -1,183 +1,259 @@
/* ═════ 拍照页样式 ═════ */
/* ═════ 05-07 拍照页 ═════
对齐 H5 h5/css/style.css 的 #s-cam 静态态:
.cam-step top 7.1%,21.5px/500,letter-spacing 1u,text-shadow
.cam-guide bottom 22.4%,14.5px,分隔线 15u 高
.cam-controls bottom 5.2%,高 62u,内边距 56u,快门 62u
单位换算:calc(N * var(--u)) → 2N rpx */
.cam {
position: relative;
width: 100%;
height: 100vh;
background: #101823;
position: absolute;
left: 0; top: 0; right: 0; bottom: 0;
overflow: hidden;
background: #000;
}
.cam-device {
width: 100%;
height: 100vh;
/* H5 静态态:白底 + 85% 黑蒙版 ≈ #262626 */
.cam-bg {
position: absolute;
left: 0; top: 0; right: 0; bottom: 0;
background: #262626;
}
/* ─── 步骤文案 ─── */
/* ─── 顶部步骤文案 ─── */
.cam-step {
position: absolute;
top: 80rpx;
left: 0;
right: 0;
left: 0; right: 0;
top: 7.1%;
text-align: center;
color: #fff;
font-size: 21.5px;
font-weight: 500;
line-height: 1.5;
letter-spacing: 2rpx;
text-shadow: 0 1px 10px rgba(0, 0, 0, .4);
z-index: 2;
}
.cam-step-no {
color: #FFFFFF;
font-size: 48rpx;
font-weight: 600;
}
.cam-step-tip {
color: #FFFFFF;
font-size: 40rpx;
font-weight: 600;
margin-top: 8rpx;
.cam-step-tip { font-size: 21.5px; }
.cam-step-no { font-size: 21.5px; }
/* ─── 真机取景相机(铺满,不能有子节点) ─── */
.cam-device {
position: absolute;
left: 0; top: 0;
width: 100%;
height: 100%;
z-index: 0;
}
/* ─── 取景蒙版(椭圆线框) ─── */
/* ─── 取景蒙版:H5 用 SVG 镂空出人脸轮廓;这里用「椭圆开窗 + 巨大 box-shadow」实现同样的暗框 + 中间透亮 ─── */
.cam-mask {
position: absolute;
left: 0; top: 0; right: 0; bottom: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
pointer-events: none;
}
.cam-oval {
width: 560rpx;
height: 720rpx;
border: 4rpx solid rgba(255, 255, 255, 0.9);
.cam-hole {
position: absolute;
left: 50%;
top: 50%;
width: 440rpx;
height: 580rpx;
margin-left: -220rpx;
margin-top: -290rpx;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 0 0 0 3000rpx rgba(0, 0, 0, .82);
}
/* 侧脸步轮廓偏移提示(骨架版:向左/右微移示意朝向) */
.mask-1 { transform: translateX(-60rpx); } /* 左脸出镜:耳在画面左 */
.mask-2 { transform: translateX(60rpx); } /* 右脸出镜:耳在画面右 */
.mask-1 { transform: translateX(-26rpx) rotate(-4deg); }
.mask-2 { transform: translateX(26rpx) rotate(4deg); }
/* ─── 底部引导要点 ─── */
/* ─── 底部引导条 ─── */
.cam-guide {
position: absolute;
bottom: 260rpx;
left: 0;
right: 0;
left: 0; right: 0;
bottom: 22.4%;
display: flex;
justify-content: center;
align-items: center;
z-index: 2;
}
.cam-guide-item {
color: #FFFFFF;
font-size: 26rpx;
padding: 0 24rpx;
border-right: 2rpx solid rgba(255, 255, 255, 0.4);
color: #fff;
font-size: 14.5px;
font-weight: 400;
}
.cam-guide-sep {
width: 0;
height: 30rpx;
border-left: 1px solid rgba(255, 255, 255, .7);
margin: 0 52rpx;
}
.cam-guide-item:last-child { border-right: none; }
/* ─── 控制条 ─── */
/* ─── 控制条:相册 / 快门 / 翻转 ─── */
.cam-controls {
position: absolute;
bottom: 80rpx;
left: 0;
right: 0;
left: 0; right: 0;
bottom: 5.2%;
height: 124rpx;
display: flex;
align-items: center;
justify-content: space-around;
justify-content: space-between;
padding: 0 112rpx;
box-sizing: border-box;
margin-bottom: env(safe-area-inset-bottom);
z-index: 2;
}
.cam-side {
width: 120rpx;
height: 88rpx;
line-height: 88rpx;
text-align: center;
color: #FFFFFF;
font-size: 28rpx;
}
.cam-shutter {
width: 144rpx;
height: 144rpx;
border: 6rpx solid #FFFFFF;
border-radius: 50%;
height: 124rpx;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 14.5px;
}
.cam-shutter {
width: 124rpx;
height: 124rpx;
border-radius: 50%;
border: 4rpx solid #fff;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.cam-shutter-dot {
width: 108rpx;
height: 108rpx;
width: 96rpx;
height: 96rpx;
border-radius: 50%;
background: #F5F078;
background: #fff;
}
/* ─── 停顿卡 ─── */
.cam-done {
/* ─── 提示/错误 ─── */
.cam-hint {
position: absolute;
top: 45%;
left: 60rpx;
right: 60rpx;
background: rgba(0, 0, 0, 0.65);
color: #FFFFFF;
font-size: 28rpx;
left: 64rpx;
right: 64rpx;
bottom: 34%;
text-align: center;
border-radius: 16rpx;
padding: 24rpx;
color: rgba(255, 255, 255, .9);
font-size: 13px;
line-height: 1.6;
z-index: 3;
}
/* ─── 拍后预览 ─── */
.cam-preview {
position: absolute;
left: 0; top: 0; right: 0; bottom: 0;
background: #000000;
background: #000;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 10;
}
.cam-preview-img {
width: 100%;
height: 78%;
height: 68%;
}
.cam-preview-btns {
position: absolute;
bottom: 80rpx;
left: 0;
right: 0;
display: flex;
justify-content: space-around;
gap: 40rpx;
margin-top: 40rpx;
}
.cam-preview-btn {
width: 280rpx;
height: 88rpx;
line-height: 88rpx;
width: 220rpx;
height: 72rpx;
line-height: 72rpx;
text-align: center;
border-radius: 44rpx;
border: 2rpx solid #FFFFFF;
color: #FFFFFF;
font-size: 30rpx;
border-radius: 10rpx;
border: 1px solid rgba(255, 255, 255, .6);
color: #fff;
font-size: 14.5px;
}
.cam-preview-btn.ok {
background: #F5F078;
border-color: #F5F078;
color: #282828;
font-weight: 600;
}
/* ─── 分析中 ─── */
.cam-analyzing {
position: absolute;
left: 0; top: 0; right: 0; bottom: 0;
background: rgba(0, 0, 0, 0.75);
background: rgba(0, 0, 0, .78);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 20;
}
.cam-analyzing-text {
color: #FFFFFF;
font-size: 30rpx;
color: #fff;
font-size: 15px;
letter-spacing: 1rpx;
}
.cam-cancel {
margin-top: 32rpx;
color: rgba(255, 255, 255, .7);
font-size: 13px;
text-decoration: underline;
}
/* ─── 隐藏画布(压缩降级用) ─── */
.compress-canvas {
position: fixed;
left: -9999rpx;
top: -9999rpx;
width: 640px;
height: 640px;
/* ─── 权限诊断(开发版) ─── */
.cam-diag-entry {
position: absolute;
top: 88rpx;
right: 32rpx;
z-index: 30;
padding: 12rpx 20rpx;
border-radius: 12rpx;
background: rgba(0, 0, 0, .55);
color: #fff;
font-size: 12px;
}
.cam-analyzing { flex-direction: column; }
.cam-cancel { margin-top: 48rpx; color: #fff; font-size: 26rpx; padding: 24rpx; }
.camera-permission { padding: 56rpx 40rpx; color: #fff; line-height: 1.8; }
.camera-permission button { margin-top: 24rpx; }
.debug-banner { padding: 24rpx; background: #F5F078; color: #282828; font-size: 24rpx; }
.debug-results { padding: 32rpx; background: #101823; color: white; line-height: 1.8; }
.debug-title { font-size: 32rpx; font-weight: 600; }
.debug-result { margin: 24rpx 0; }
.debug-result image { display: block; width: 100%; height: 320rpx; }
.debug-results button { margin-top: 24rpx; }
.cam-diag {
position: absolute;
left: 32rpx; right: 32rpx;
top: 160rpx; bottom: 160rpx;
z-index: 40;
background: rgba(6, 16, 26, .96);
border: 1rpx solid rgba(120, 200, 255, .35);
border-radius: 20rpx;
padding: 20rpx;
display: flex;
flex-direction: column;
}
.cam-diag-scroll { flex: 1; }
.cam-diag-text {
color: #9fd0ff;
font-size: 11px;
line-height: 1.7;
white-space: pre-wrap;
word-break: break-all;
}
.cam-diag-close {
margin-top: 16rpx;
text-align: center;
background: #F5F078;
color: #282828;
border-radius: 12rpx;
padding: 14rpx 0;
font-size: 13px;
}
/* ─── 调试模式结果 ─── */
.cam-debug {
position: absolute;
left: 0; top: 0; right: 0; bottom: 0;
background: #fff;
padding: 88rpx 40rpx 40rpx;
box-sizing: border-box;
overflow-y: auto;
z-index: 25;
}
.cam-debug-title { font-size: 17px; font-weight: 600; margin-bottom: 16rpx; }
.cam-debug-note { font-size: 12px; color: #707070; line-height: 1.6; margin-bottom: 24rpx; }
.cam-debug-item { margin-bottom: 32rpx; }
.cam-debug-img { width: 100%; height: 320rpx; background: #f2f2f2; }
.cam-debug-meta { font-size: 12px; color: #4A4A4A; margin-top: 12rpx; }
.cam-debug-btn { width: 100%; margin-top: 8rpx; }
.cam-debug-exit { margin-top: 24rpx; text-align: center; font-size: 13px; color: #707070; text-decoration: underline; }