优化不足一份的识别问题
This commit is contained in:
@@ -336,6 +336,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
if (isPageVisible.not() || isStartRecognize.not()) {
|
||||
if (ActivityManager.currentActivity() is MainActivity) {
|
||||
isPageVisible = true
|
||||
isStartRecognize = true
|
||||
}
|
||||
return@addWeightListener
|
||||
}
|
||||
@@ -765,18 +766,24 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
eatWeight: Int,
|
||||
eatNum: Int,
|
||||
userId: String?,
|
||||
notEnoughOneBlock: ()-> Unit = {},
|
||||
block: () -> Unit
|
||||
) {
|
||||
Timber.tag(TAG).d("foodWeight=$foodWeight,eatWeight=$eatWeight")
|
||||
val pickupMode = SPUtil.getInstance().get(GlobalKey.KEY_PICKUP_MODE, 0) ?: 0
|
||||
if (pickupMode == 0) {
|
||||
if (foodWeight <= 5 || eatWeight <= 5) {
|
||||
ToastUtils.showToast("请取走餐品")
|
||||
if (foodWeight <= 5) {
|
||||
ToastUtils.showToast("餐品重量不足")
|
||||
return
|
||||
}
|
||||
if (eatWeight <= 5) {
|
||||
ToastUtils.showToast("取餐重量过小")
|
||||
return
|
||||
}
|
||||
}
|
||||
if (eatNum == 0) {
|
||||
ToastUtils.showToast("您好,当前重量不足一份")
|
||||
notEnoughOneBlock()
|
||||
return
|
||||
}
|
||||
showWaitingDialog("加载中,请稍候……")
|
||||
|
||||
Reference in New Issue
Block a user