fix: 读到卡后不播NFC关闭音效,只播打卡结果音效
读到卡时closeNfc()播放close_punch.mp3,紧接着API成功播放 punch_success.mp3,两个音效都含"打卡"语音导致听起来报了两次。 改为读到卡后静默关闭NFC硬件,只播打卡成功/失败音效。 NFC关闭音效只在超时和手动取消时播放。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -127,8 +127,9 @@ class PunchViewModel @Inject constructor(
|
||||
|
||||
/** NFC 读到卡号后处理 */
|
||||
private fun handleNfcResult(nfcId: String, punchType: Int) {
|
||||
// 关闭 NFC
|
||||
closeNfc()
|
||||
// 关闭 NFC 硬件(不播关闭音效,成功/失败音效由 API 结果决定)
|
||||
nfcController.stopScan()
|
||||
nfcController.close()
|
||||
|
||||
// 调用打卡 API
|
||||
viewModelScope.launch {
|
||||
|
||||
Reference in New Issue
Block a user