修复了用户输入状态未重置问题

This commit is contained in:
zxj
2025-07-09 16:18:44 +08:00
parent 6cf7b4fb9b
commit 6cd5069aac
5 changed files with 11 additions and 5 deletions
@@ -195,6 +195,9 @@ class ReceiptViewModel @Inject constructor(
weight * 1000 / consumeValue / purchaseValue
val finalCount = count.toSafeFloat(currentItem.unitName)
Timber.d("startSensorScale weight = $weight, count = $count, finalCount = $finalCount, consumeValue = $consumeValue, purchaseValue = $purchaseValue")
if (info.receivedNumTemp.isEmpty()) {
_countUserInput.value = false
}
_selectedItem.value = info.copy(
goodsWeight = weight.toSafeBigDecimal(),
receivedNumTemp = if (_countUserInput.value) info.receivedNumTemp else count.toSafeString(