fix(main): 优化重量识别逻辑与日志;防抖时间调整为2s;从版本控制中移除.idea和objectbox-models
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
dbe3753821
commit
0127697560
@@ -485,6 +485,7 @@ class MainScreenPresentation(
|
||||
binding.nutritionInclude.tvUserName.text = userNutrition?.name.maskName()
|
||||
val recommendCalorie = (userNutrition?.recommendCalorie ?: 0.0).roundedDecimalPlace(1)
|
||||
|
||||
// binding.detailInclude.tvTotalWeight.text = "总重量:${userNutrition?.}克"
|
||||
binding.nutritionInclude.tvRecommendHeat.text =
|
||||
"推荐热量:${recommendCalorie.roundedDecimalPlace(1)}kcal"
|
||||
// binding.nutritionInclude.tvRecommendHeat.text = "推荐热量:${recommendCalorie.removeTrailingZeros()}kcal"
|
||||
@@ -1041,7 +1042,7 @@ class MainScreenPresentation(
|
||||
return@runOnUiThread
|
||||
}
|
||||
}
|
||||
pauseCamera()
|
||||
// pauseCamera()
|
||||
step3ShowRecognizeResult(userId)
|
||||
})
|
||||
|
||||
@@ -1306,29 +1307,33 @@ class MainScreenPresentation(
|
||||
|
||||
val listIsEmpty = facePreviewInfoList.isEmpty()
|
||||
val listFirstTrackId = if (listIsEmpty.not()) facePreviewInfoList[0].trackId else null
|
||||
Timber.tag(TAG)
|
||||
.d("listIsEmpty=$listIsEmpty,lastFaceTrackId=$lastFaceTrackId,listFirstTrackId=$listFirstTrackId")
|
||||
// Timber.tag(TAG)
|
||||
// .d("drawPreviewInfo,listIsEmpty=$listIsEmpty,lastFaceTrackId=$lastFaceTrackId,listFirstTrackId=$listFirstTrackId")
|
||||
if (listIsEmpty || (lastFaceTrackId != listFirstTrackId)) {
|
||||
if (lastFaceTrackId != -1 && currentUserId != null) {
|
||||
//0-即放即取,1-余量计量
|
||||
mealPickupMode = SPUtil.getInstance().get(GlobalKey.KEY_PICKUP_MODE, 0) ?: 0
|
||||
Timber.tag(TAG).i("$lastFaceTrackId 用户离开")
|
||||
Timber.tag(TAG).i("drawPreviewInfo,$lastFaceTrackId 用户离开")
|
||||
lastFaceTrackId = -1
|
||||
//resumeCamera()
|
||||
Timber.tag(TAG)
|
||||
.d("postUserData userNutritionData是否null: ${userNutrition == null}, currentFood是否null: ${currentFood == null},currentUserId是否null:${currentUserId == null}")
|
||||
.d("drawPreviewInfo,postUserData userNutritionData是否null: ${userNutrition == null}, currentFood是否null: ${currentFood == null},currentUserId是否null:${currentUserId == null}")
|
||||
if (userNutrition == null || currentFood == null || currentUserId == null) {
|
||||
return
|
||||
}
|
||||
Timber.tag(TAG).d("drawPreviewInfo,开始提交订单")
|
||||
createOrder(notEnoughOneBlock = {
|
||||
Timber.tag(TAG).d("drawPreviewInfo,notEnoughOneBlock")
|
||||
if (activity.settlementMode == 0) {
|
||||
Timber.tag(TAG).d("drawPreviewInfo,notEnoughOneBlock,联合模式")
|
||||
setTopInfoVisible()
|
||||
}
|
||||
// if (mealPickupMode == 0) {
|
||||
Timber.tag(TAG).d("drawPreviewInfo,notEnoughOneBlock,step2FaceRecognizing")
|
||||
currentStep = 2
|
||||
step2FaceRecognizing(currentFood!!)
|
||||
// }
|
||||
}, successBlock = {
|
||||
Timber.tag(TAG).d("drawPreviewInfo,successBlock,订单已生成")
|
||||
// TODO: 测试人脸识别问题--------------------
|
||||
//recognizeViewModel.updateRegisterStatus(REGISTER_STATUS_READY)
|
||||
if (BuildConfig.DEBUG) {
|
||||
@@ -1342,13 +1347,17 @@ class MainScreenPresentation(
|
||||
// activity.isAnalyzing = false
|
||||
// step1FoodRecognizing()
|
||||
// } else {
|
||||
Timber.tag(TAG).d("drawPreviewInfo,successBlock,订单已生成,mealPickupMode=$mealPickupMode")
|
||||
if (mealPickupMode == 1) {
|
||||
Timber.tag(TAG).d("drawPreviewInfo,successBlock,订单已生成,step2FaceRecognizing")
|
||||
step2FaceRecognizing(currentFood!!)
|
||||
isKeepFaceState = false
|
||||
if (activity.settlementMode == 0) {
|
||||
Timber.tag(TAG).d("drawPreviewInfo,successBlock,订单已生成,step2FaceRecognizing,联合支付")
|
||||
setTopInfoVisible()
|
||||
}
|
||||
} else {
|
||||
Timber.tag(TAG).d("drawPreviewInfo,successBlock,订单已生成,step1FoodRecognizing")
|
||||
activity.isAnalyzing = false
|
||||
step1FoodRecognizing()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user