修改输入框数据类型

This commit is contained in:
马增飞
2025-09-17 19:22:21 +08:00
parent 63f8668b77
commit 7498ad08da
4 changed files with 18 additions and 8 deletions
@@ -34,9 +34,9 @@ object SensorScaleUtils {
}
// Timber.d("readWeight state = ${stateStr}, weight = $value")
// 只使用稳定值
if (state == SensorScale.STATE_STABLE) {
// if (state == SensorScale.STATE_STABLE) {
callback?.invoke(value)
}
// }
}
/**
@@ -75,6 +75,8 @@ import com.sw.inbound.utils.InteractionUtils
import com.sw.inbound.utils.ToastUtils
import com.sw.inbound.viewmodel.ReceiptViewModel
import timber.log.Timber
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.ui.text.input.KeyboardType
/**
* 收货界面
@@ -629,7 +631,8 @@ private fun ReceiptProductEditView(
},
trailingLabel = selectedItem?.unitName,
inputType = InputType.Decimal,
isInitUpdate = true
isInitUpdate = true,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number)
)
RowInputLayout(
@@ -650,7 +653,8 @@ private fun ReceiptProductEditView(
)
)
}
}, inputType = InputType.Decimal
}, inputType = InputType.Decimal,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number)
)
RowInputLayout(
label = "收货金额",
@@ -671,7 +675,8 @@ private fun ReceiptProductEditView(
)
)
}
}, inputType = InputType.Decimal
}, inputType = InputType.Decimal,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number)
)
Row(
@@ -79,6 +79,8 @@ import com.sw.inbound.utils.InteractionUtils
import com.sw.inbound.utils.ToastUtils
import com.sw.inbound.viewmodel.SelfProcurementViewModel
import timber.log.Timber
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.ui.text.input.KeyboardType
@Preview(
widthDp = 1920,
@@ -908,6 +910,7 @@ private fun SelfProductEditView(
}
},
trailingLabel = selectedItem!!.unitName ?: "-",
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
)
RowInputLayout(
@@ -916,6 +919,7 @@ private fun SelfProductEditView(
inputType = InputType.Decimal,
trailingLabel = "",
isInitUpdate = true,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
onValueChange = { value ->
viewModel.updatePriceInputState(true)
viewModel.updateAmountInputState(false)
@@ -937,6 +941,7 @@ private fun SelfProductEditView(
inputType = InputType.Decimal,
trailingLabel = "",
isInitUpdate = true,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
onValueChange = { value ->
viewModel.updateAmountInputState(true)
viewModel.updatePriceInputState(false)