feat(common): 添加View点击区域扩展功能并优化主界面重量检测逻辑
- 在CommonExt.kt中新增expandClickArea扩展函数,支持扩大View的点击响应区域 - 新增TouchDelegate导入用于实现点击区域扩展功能 - 调整MainActivity.kt中的重量检测逻辑顺序,先处理联合支付模式下的特殊情况 - 添加对当前用户ID的检查,优化即放即取模式下的重量数据处理流程 - 重构重量重置识别条件的位置,确保正确的执行顺序
This commit is contained in:
@@ -365,11 +365,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
it.text = "$weight"
|
||||
}
|
||||
}
|
||||
if (weight <= WEIGHT_RESET_RECOGNIZE) {
|
||||
log("registerDataChange weight 秤重量小于${WEIGHT_RESET_RECOGNIZE}g")
|
||||
//检测到秤上没有东西,重新启动识别菜品 && presentation?.mealPickupMode == 1
|
||||
checkedItem = null
|
||||
}
|
||||
if (settlementMode == 0) {
|
||||
log("registerDataChange weight 联合支付模式")
|
||||
//联合支付-------------------------------------------
|
||||
@@ -379,10 +374,19 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
loadYLJLBySettlement(weight)
|
||||
return
|
||||
}
|
||||
if (presentation?.currentUserId.isNullOrBlank().not()) {
|
||||
//联合支付+即放即取,已识别人脸的状态下,从秤上拿餐品后,不再读取数据,等待人脸离开提交订单
|
||||
return
|
||||
}
|
||||
loadJFJQBySettlement(weight)
|
||||
return
|
||||
}
|
||||
|
||||
if (weight <= WEIGHT_RESET_RECOGNIZE) {
|
||||
log("registerDataChange weight 秤重量小于${WEIGHT_RESET_RECOGNIZE}g")
|
||||
//检测到秤上没有东西
|
||||
checkedItem = null
|
||||
}
|
||||
//独立支付-------------------------------------------
|
||||
if (lastWeight - weight > 5) {
|
||||
//及放及取,从秤上拿走超过5克
|
||||
|
||||
Reference in New Issue
Block a user