联合支付功能

This commit is contained in:
2026-03-19 17:44:13 +08:00
parent b51be58c64
commit 549e8d303f
15 changed files with 160 additions and 29 deletions
@@ -134,7 +134,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
private var bottomSheetDialog: CustomBottomSheetDialog? = null
private var lastWeight: Double = 0.0
private var lastPhotoUri: Uri? = null // 最后拍照的图片
private var debouncer = Debouncer(2000)
private var debouncer = Debouncer(5000)
private var isRecognitionFood = true
private var isFirstOpen = true
@@ -263,7 +263,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
//0.05
// val isWeightChange = abs(weight - lastWeight) > 0.02
val isWeightChange = weight - lastWeight > 0.02
log("recognizeByWeight---00001,weight=$weight,lastWeight=$lastWeight,isWeightChange=$isWeightChange")
if (weight != lastWeight) {
log("recognizeByWeight---00001,weight=$weight,lastWeight=$lastWeight,isWeightChange=$isWeightChange")
}
recognizeByWeight(weight, isWeightChange)
}
}
@@ -278,7 +280,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
return
}
if (isWeightChange && isRecognitionFood) { // 大于50g
if (isWeightChange && isRecognitionFood) {
log("recognizeByWeight---00003,mealPickupMode=${presentation?.mealPickupMode}")
if (presentation?.mealPickupMode == 1) {
isRecognitionFood = false
@@ -293,8 +295,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
} else {
block()
}
if (presentation?.mealPickupMode == 1) {
//0-联合支付,1-独立支付
val settlementMode = SPUtil.getInstance().get(GlobalKey.KEY_SETTLEMENT_MODE, 1)
if (presentation?.mealPickupMode == 1 || settlementMode == 0) {
lastWeight = weight
}
}
@@ -1085,6 +1088,13 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
}
}
/**
* 隐藏搜索按钮
*/
fun hideSearchView() {
binding.tvToSearch.gone()
}
// @Subscribe(threadMode = ThreadMode.MAIN)
// public fun onResetBox(event: ResetBoxEvent) {
// ObjectBox.boxStore.close()