fix(h5): center score stack, lock profile scroll and gate turn guidance

This commit is contained in:
xsl
2026-10-12 23:48:11 +08:00
parent 2a49ebdab2
commit 6f83f58a09
17 changed files with 1396 additions and 969 deletions
+13 -1
View File
@@ -304,6 +304,11 @@
var carousel = $('#skin-carousel');
skinSwipe = SwipeTrack.create(carousel, track, { count: SKINS.length, onSelect: goSkin });
// Limit the iOS rubber-band fallback to the fixed profile itself. The mobile
// wheel pickers live under body, so their vertical scrolling is untouched.
$('#s-profile').addEventListener('touchmove', function (e) {
if (e.cancelable) e.preventDefault();
}, { passive: false });
function cancelSkinDrag() { skinSwipe.cancel(); }
carousel.addEventListener('keydown', function (e) {
if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') { e.preventDefault(); goSkin(skinIndex + (e.key === 'ArrowRight' ? 1 : -1)); }
@@ -766,7 +771,14 @@
m.classList.toggle('no-face', cls === 'no-face');
m.classList.toggle('ok', cls === 'ok');
}
/* camera-hint-stage-pure-begin */
function captureStageHint(text, target, hasFrontPhoto) {
if ((target === 'front' || !hasFrontPhoto) && (text === '请向左转头' || text === '请向右转头')) return '请正对屏幕';
return text;
}
/* camera-hint-stage-pure-end */
function setHint(text, ok, silent) {
text = captureStageHint(text, CAM_STEPS[camStep].target, !!photos[0]);
var h = $('#cam-hint');
if (!text) { h.classList.remove('show', 'ok'); lastHint = ''; voice.dropHint(); return; }
if (text !== lastHint) {
@@ -949,7 +961,7 @@
$('#cam-next').classList.remove('show');
applyMirror();
resetDetectState();
voice.play(VOICE.step[camStep]); // 步骤引导语音
if (camStep === 0 || photos[camStep - 1]) voice.play(VOICE.step[camStep]); // 前一步合格照片已保存,才播下一步引导
}
var camSeq = 0; // 流程令牌:退出拍照/开始拍照时递增,使未决的快门/分析回调失效