fix: 去掉打卡确认弹窗 + NFC日志排查

- 去掉"确定上班打卡?"确认弹窗,NFC读到卡号直接提交
- 添加NFC开启/扫描日志便于排查无反应问题

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongliang
2026-04-28 20:13:48 +09:30
parent 5a5c8bfaa0
commit e44a25e841

View File

@@ -143,22 +143,16 @@ class PunchFragment : BaseFragment<FragmentPunchBinding>() {
// NFC 开启语音+振动planId=8 // NFC 开启语音+振动planId=8
VibrationDefaults.getPattern(8)?.let { vibrationController.executePattern(it) } VibrationDefaults.getPattern(8)?.let { vibrationController.executePattern(it) }
// 开启 NFC 扫描 // 开启 NFC 扫描(加日志排查)
Timber.d("考勤: 开启 NFC")
nfcController.open() nfcController.open()
Timber.d("考勤: NFC isOpen=${nfcController.isOpen()}, 开始扫描")
nfcController.startScan { nfcId -> nfcController.startScan { nfcId ->
Timber.d("考勤: NFC 读到 $nfcId") Timber.d("考勤: NFC 读到卡号 $nfcId")
stopNfc() stopNfc()
// 不弹确认,直接打卡
if (currentPunchType == 0) {
confirmDialog.showText(
text = "确定上班打卡?",
onConfirm = { doPunch(nfcId) },
onCancel = { resetButton() }
)
} else {
doPunch(nfcId) doPunch(nfcId)
} }
}
// 10秒超时 // 10秒超时
viewLifecycleOwner.lifecycleScope.launch { viewLifecycleOwner.lifecycleScope.launch {