优化识别后未离开多次切换模式导致的不再识别问题
This commit is contained in:
@@ -692,7 +692,11 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
val weight = lastWeight
|
val weight = lastWeight
|
||||||
lastWeight = 0.0
|
lastWeight = 0.0
|
||||||
presentation?.hideRecImage()
|
presentation?.hideRecImage()
|
||||||
recognizeByWeight(weight, true)
|
presentation?.step1FoodRecognizing()
|
||||||
|
|
||||||
|
binding.root.postDelayed({
|
||||||
|
recognizeByWeight(weight, true)
|
||||||
|
},500)
|
||||||
}
|
}
|
||||||
isRefreshPage = !isRefreshPage
|
isRefreshPage = !isRefreshPage
|
||||||
}
|
}
|
||||||
@@ -748,6 +752,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
foodWeight: Int,
|
foodWeight: Int,
|
||||||
eatWeight: Int,
|
eatWeight: Int,
|
||||||
eatNum: Int,
|
eatNum: Int,
|
||||||
|
userId: String?,
|
||||||
block: () -> Unit
|
block: () -> Unit
|
||||||
) {
|
) {
|
||||||
Timber.tag(TAG).d("foodWeight=$foodWeight,eatWeight=$eatWeight")
|
Timber.tag(TAG).d("foodWeight=$foodWeight,eatWeight=$eatWeight")
|
||||||
@@ -769,7 +774,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
eatWeight = eatWeight,
|
eatWeight = eatWeight,
|
||||||
//根据specId对应规格重量计算
|
//根据specId对应规格重量计算
|
||||||
eatNum = eatNum,
|
eatNum = eatNum,
|
||||||
userId = null,
|
userId = userId,
|
||||||
notPay = chargeMode != 0,
|
notPay = chargeMode != 0,
|
||||||
//即放即取-1,称重-2
|
//即放即取-1,称重-2
|
||||||
mode = if (pickupMode == 1) 1 else 2
|
mode = if (pickupMode == 1) 1 else 2
|
||||||
@@ -823,6 +828,13 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
isStartRecognize = false
|
isStartRecognize = false
|
||||||
presentation?.hideNutritionView(event.chargeMode)
|
presentation?.hideNutritionView(event.chargeMode)
|
||||||
// presentation?.cancel()
|
// presentation?.cancel()
|
||||||
|
|
||||||
|
if (event.chargeMode == 1) {
|
||||||
|
presentation?.let {
|
||||||
|
it.onStop()
|
||||||
|
it.setupArcCamera()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private var isRefreshPage = false
|
private var isRefreshPage = false
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
@@ -868,7 +880,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
foodInfo = checkedItem!!,
|
foodInfo = checkedItem!!,
|
||||||
foodWeight = foodWeight.roundToInt(),
|
foodWeight = foodWeight.roundToInt(),
|
||||||
eatWeight = eatWeight.roundToInt(),
|
eatWeight = eatWeight.roundToInt(),
|
||||||
eatNum = eatNum
|
eatNum = eatNum,
|
||||||
|
userId = null,
|
||||||
) {
|
) {
|
||||||
// TODO: 暂不关闭首页副屏
|
// TODO: 暂不关闭首页副屏
|
||||||
//presentation?.dismiss()
|
//presentation?.dismiss()
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.sw.dualscreen.activity.fragment
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import com.sw.dualscreen.GlobalKey
|
import com.sw.dualscreen.GlobalKey
|
||||||
import com.sw.dualscreen.R
|
import com.sw.dualscreen.R
|
||||||
|
import com.sw.dualscreen.activity.SettingActivity
|
||||||
import com.sw.dualscreen.databinding.FragmentBusinessBinding
|
import com.sw.dualscreen.databinding.FragmentBusinessBinding
|
||||||
import com.sw.dualscreen.model.response.ChargeModeEvent
|
import com.sw.dualscreen.model.response.ChargeModeEvent
|
||||||
import com.sw.dualscreen.sdk.SensorScaleUtils
|
import com.sw.dualscreen.sdk.SensorScaleUtils
|
||||||
@@ -37,7 +38,7 @@ class BusinessFragment: BaseFragment<FragmentBusinessBinding>() {
|
|||||||
binding.btnClearZero.setOnClickListener {
|
binding.btnClearZero.setOnClickListener {
|
||||||
SensorScaleUtils.tare()
|
SensorScaleUtils.tare()
|
||||||
}
|
}
|
||||||
binding.btnConfirm.setOnClickListener {
|
binding.btnConfirm.setOnClickListener { v ->
|
||||||
if (binding.rgCharge.checkedRadioButtonId == -1) {
|
if (binding.rgCharge.checkedRadioButtonId == -1) {
|
||||||
ToastUtils.showToast("请设置计费模式")
|
ToastUtils.showToast("请设置计费模式")
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
@@ -59,8 +60,14 @@ class BusinessFragment: BaseFragment<FragmentBusinessBinding>() {
|
|||||||
val pickupMode = if (binding.rgTakeFood.checkedRadioButtonId == R.id.rbPickAndPlace) 0 else 1
|
val pickupMode = if (binding.rgTakeFood.checkedRadioButtonId == R.id.rbPickAndPlace) 0 else 1
|
||||||
SPUtil.getInstance().put(GlobalKey.KEY_PICKUP_MODE, pickupMode)
|
SPUtil.getInstance().put(GlobalKey.KEY_PICKUP_MODE, pickupMode)
|
||||||
|
|
||||||
ToastUtils.showToast("设置已保存")
|
//ToastUtils.showToast("设置已保存")
|
||||||
activity?.finish()
|
(activity as SettingActivity).let {
|
||||||
|
it.showWaitingDialog("设置保存中")
|
||||||
|
v.postDelayed({
|
||||||
|
it.hideWaitingDialog()
|
||||||
|
it.finish()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SensorScaleUtils.addWeightListener { value ->
|
SensorScaleUtils.addWeightListener { value ->
|
||||||
val realWeight = (value * 1000).roundToInt()
|
val realWeight = (value * 1000).roundToInt()
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import android.view.ViewTreeObserver
|
|||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.core.view.isInvisible
|
||||||
|
import androidx.core.view.isVisible
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
@@ -109,6 +111,8 @@ class MainScreenPresentation(
|
|||||||
|
|
||||||
var currentUserId: String? = null
|
var currentUserId: String? = null
|
||||||
|
|
||||||
|
var facePreviewInfoList: MutableList<FacePreviewInfo>? = null
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = PresentationMainScreenBinding.inflate(layoutInflater)
|
binding = PresentationMainScreenBinding.inflate(layoutInflater)
|
||||||
@@ -116,7 +120,10 @@ class MainScreenPresentation(
|
|||||||
mealPickupMode = SPUtil.getInstance().get(GlobalKey.KEY_PICKUP_MODE, 0) ?: 0
|
mealPickupMode = SPUtil.getInstance().get(GlobalKey.KEY_PICKUP_MODE, 0) ?: 0
|
||||||
window?.setBackgroundDrawableResource(android.R.color.white)
|
window?.setBackgroundDrawableResource(android.R.color.white)
|
||||||
initView()
|
initView()
|
||||||
setupArcCamera()
|
val chargeMode = SPUtil.getInstance().get(GlobalKey.KEY_CHARGE_MODE, 0)
|
||||||
|
if (chargeMode == 1) {
|
||||||
|
setupArcCamera()
|
||||||
|
}
|
||||||
registerDataChange()
|
registerDataChange()
|
||||||
startTime = System.currentTimeMillis()
|
startTime = System.currentTimeMillis()
|
||||||
}
|
}
|
||||||
@@ -226,7 +233,7 @@ class MainScreenPresentation(
|
|||||||
/**
|
/**
|
||||||
* 启用虹软人脸失败
|
* 启用虹软人脸失败
|
||||||
*/
|
*/
|
||||||
private fun setupArcCamera() {
|
fun setupArcCamera() {
|
||||||
initArcViewModel()
|
initArcViewModel()
|
||||||
initArcView()
|
initArcView()
|
||||||
openRectInfoDraw = true
|
openRectInfoDraw = true
|
||||||
@@ -268,7 +275,6 @@ class MainScreenPresentation(
|
|||||||
LightManager.openGreenLight()
|
LightManager.openGreenLight()
|
||||||
currentStep = 3
|
currentStep = 3
|
||||||
stepChangeCallback(currentStep)
|
stepChangeCallback(currentStep)
|
||||||
|
|
||||||
//根据接口数据更新热量数据--------------------------
|
//根据接口数据更新热量数据--------------------------
|
||||||
userViewModel.getUserNutritionData(userId = userId) { nutrition ->
|
userViewModel.getUserNutritionData(userId = userId) { nutrition ->
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
@@ -384,13 +390,18 @@ class MainScreenPresentation(
|
|||||||
return num?.roundToInt() ?: 0
|
return num?.roundToInt() ?: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var isLoadUnbilledMode = false
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 餐品识别成功,不计费模式
|
* 餐品识别成功,不计费模式
|
||||||
*/
|
*/
|
||||||
fun loadUnbilledMode() {
|
fun loadUnbilledMode() {
|
||||||
|
isLoadUnbilledMode = true
|
||||||
|
Timber.tag(TAG).d("loadUnbilledMode")
|
||||||
binding.calorieInclude.root.gone()
|
binding.calorieInclude.root.gone()
|
||||||
binding.nutritionInclude.root.visible()
|
binding.nutritionInclude.root.visible()
|
||||||
|
|
||||||
|
binding.ivPreviewImage.gone()
|
||||||
binding.flCameraView.visible()
|
binding.flCameraView.visible()
|
||||||
binding.ivFaceRecMask.gone()
|
binding.ivFaceRecMask.gone()
|
||||||
binding.tvFaceTip.gone()
|
binding.tvFaceTip.gone()
|
||||||
@@ -406,10 +417,14 @@ class MainScreenPresentation(
|
|||||||
// -------------------------------------------------
|
// -------------------------------------------------
|
||||||
// 删除userNutritionData,改为userNutrition
|
// 删除userNutritionData,改为userNutrition
|
||||||
calculateNutrition(recognitionWeight - lastWeight)
|
calculateNutrition(recognitionWeight - lastWeight)
|
||||||
|
binding.root.postDelayed({
|
||||||
|
isLoadUnbilledMode = false
|
||||||
|
}, 10000)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var isFirstOpen = true
|
private var isFirstOpen = true
|
||||||
var startTime = 0L
|
var startTime = 0L
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 餐品识别中
|
* 餐品识别中
|
||||||
*/
|
*/
|
||||||
@@ -519,6 +534,7 @@ class MainScreenPresentation(
|
|||||||
// 当前食物信息
|
// 当前食物信息
|
||||||
private var currentFood: FoodInfo? = null
|
private var currentFood: FoodInfo? = null
|
||||||
fun updateFood(foodInfo: FoodInfo?) {
|
fun updateFood(foodInfo: FoodInfo?) {
|
||||||
|
//if (isLoadUnbilledMode) return
|
||||||
Timber.tag(TAG).d("main,updateFood,耗时:${System.currentTimeMillis() - startTime}")
|
Timber.tag(TAG).d("main,updateFood,耗时:${System.currentTimeMillis() - startTime}")
|
||||||
startTime = System.currentTimeMillis()
|
startTime = System.currentTimeMillis()
|
||||||
currentFood = foodInfo
|
currentFood = foodInfo
|
||||||
@@ -546,7 +562,7 @@ class MainScreenPresentation(
|
|||||||
} else {
|
} else {
|
||||||
//不计费
|
//不计费
|
||||||
//开启人脸识别
|
//开启人脸识别
|
||||||
if (currentStep == 1) {
|
if (currentStep == 1 || binding.tvFaceTip.isVisible.not()) {
|
||||||
step2FaceRecognizing(foodInfo)
|
step2FaceRecognizing(foodInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -713,15 +729,11 @@ class MainScreenPresentation(
|
|||||||
step1FoodRecognizing()
|
step1FoodRecognizing()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStop() {
|
public override fun onStop() {
|
||||||
if (rgbCameraHelper != null) {
|
rgbCameraHelper?.release()
|
||||||
rgbCameraHelper!!.release()
|
rgbCameraHelper = null
|
||||||
rgbCameraHelper = null
|
irCameraHelper?.release()
|
||||||
}
|
irCameraHelper = null
|
||||||
if (irCameraHelper != null) {
|
|
||||||
irCameraHelper!!.release()
|
|
||||||
irCameraHelper = null
|
|
||||||
}
|
|
||||||
recognizeViewModel.destroy()
|
recognizeViewModel.destroy()
|
||||||
super.onStop()
|
super.onStop()
|
||||||
}
|
}
|
||||||
@@ -740,7 +752,7 @@ class MainScreenPresentation(
|
|||||||
|
|
||||||
recognizeViewModel.onPreviewFrame(ByteArray(1382400), true)
|
recognizeViewModel.onPreviewFrame(ByteArray(1382400), true)
|
||||||
}
|
}
|
||||||
|
private var recognizeTime = 0L
|
||||||
private fun initArcViewModel() {
|
private fun initArcViewModel() {
|
||||||
recognizeViewModel.setLiveType(livenessType)
|
recognizeViewModel.setLiveType(livenessType)
|
||||||
recognizeViewModel.ftInitCode.observe(activity, Observer { ftInitCode: Int? ->
|
recognizeViewModel.ftInitCode.observe(activity, Observer { ftInitCode: Int? ->
|
||||||
@@ -786,26 +798,22 @@ class MainScreenPresentation(
|
|||||||
recognizeViewModel.recognizeUserId.observe(
|
recognizeViewModel.recognizeUserId.observe(
|
||||||
activity,
|
activity,
|
||||||
Observer { compareResult: CompareResult ->
|
Observer { compareResult: CompareResult ->
|
||||||
|
if (currentStep != 2 || System.currentTimeMillis() - recognizeTime <= 2000) {
|
||||||
|
//忽略非识别中及两秒内的再次识别
|
||||||
|
return@Observer
|
||||||
|
}
|
||||||
|
recognizeTime = System.currentTimeMillis()
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
activity.showWaitingDialog("加载中,请稍后……")
|
activity.showWaitingDialog("加载中,请稍后……")
|
||||||
}
|
}
|
||||||
Timber.tag(TAG)
|
Timber.tag(TAG)
|
||||||
.i("recognizeUserId observe compareResult = ${compareResult.trackId}, userId = ${compareResult.faceEntity.userName}")
|
.i("recognizeUserId observe compareResult = ${compareResult.trackId}, userId = ${compareResult.faceEntity.userName}, step = $currentStep")
|
||||||
recognitionTime = System.currentTimeMillis()
|
recognitionTime = System.currentTimeMillis()
|
||||||
recognitionWeight = lastWeight
|
recognitionWeight = lastWeight
|
||||||
lastFaceTrackId = compareResult.trackId
|
lastFaceTrackId = compareResult.trackId
|
||||||
val faceEntity = compareResult.faceEntity
|
val faceEntity = compareResult.faceEntity
|
||||||
val userId = faceEntity.userName
|
val userId = faceEntity.userName
|
||||||
currentUserId = userId
|
currentUserId = userId
|
||||||
// if (TextUtils.equals(userId, "2")) {
|
|
||||||
// //解决识别出现recognizeStatus = 2待重试的问题
|
|
||||||
// activity.runOnUiThread {
|
|
||||||
// ToastUtils.showToast("一开始就在屏幕内发现无法识别,从屏幕外进入就可以识别")
|
|
||||||
// activity.hideWaitingDialog()
|
|
||||||
// }
|
|
||||||
// //userViewModel.getUserFaceCache()
|
|
||||||
// return@Observer
|
|
||||||
// }
|
|
||||||
if (userId == null) return@Observer
|
if (userId == null) return@Observer
|
||||||
//ToastUtils.showToast("人脸识别成功,userId = $userId")
|
//ToastUtils.showToast("人脸识别成功,userId = $userId")
|
||||||
if (currentFood == null) {
|
if (currentFood == null) {
|
||||||
@@ -962,18 +970,17 @@ class MainScreenPresentation(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
|
||||||
override fun onPreview(nv21: ByteArray?, camera: Camera?) {
|
override fun onPreview(nv21: ByteArray?, camera: Camera?) {
|
||||||
if (!isRecognition) {
|
if (!isRecognition) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
binding.dualCameraFaceRectView.clearFaceInfo()
|
binding.dualCameraFaceRectView.clearFaceInfo()
|
||||||
val facePreviewInfoList: MutableList<FacePreviewInfo?>? =
|
facePreviewInfoList = recognizeViewModel.onPreviewFrame(nv21, true)
|
||||||
recognizeViewModel.onPreviewFrame(nv21, true)
|
|
||||||
if (facePreviewInfoList != null && rgbFaceRectTransformer != null) {
|
if (facePreviewInfoList != null && rgbFaceRectTransformer != null) {
|
||||||
drawPreviewInfo(facePreviewInfoList)
|
drawPreviewInfo(facePreviewInfoList!!)
|
||||||
}
|
}
|
||||||
recognizeViewModel.clearLeftFace(facePreviewInfoList)
|
//recognizeViewModel.clearLeftFace(facePreviewInfoList)
|
||||||
|
clearLeftFaceData()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCameraClosed() {
|
override fun onCameraClosed() {
|
||||||
@@ -1111,10 +1118,10 @@ class MainScreenPresentation(
|
|||||||
*
|
*
|
||||||
* @param facePreviewInfoList RGB画面的实时人脸信息
|
* @param facePreviewInfoList RGB画面的实时人脸信息
|
||||||
*/
|
*/
|
||||||
private fun drawPreviewInfo(facePreviewInfoList: MutableList<FacePreviewInfo?>) {
|
private fun drawPreviewInfo(facePreviewInfoList: MutableList<FacePreviewInfo>) {
|
||||||
// Timber.tag(TAG).d("drawPreviewInfo facePreviewInfoList = ${facePreviewInfoList.size}, rgbFaceRectTransformer = ${rgbFaceRectTransformer != null}")
|
// Timber.tag(TAG).d("drawPreviewInfo facePreviewInfoList = ${facePreviewInfoList.size}, rgbFaceRectTransformer = ${rgbFaceRectTransformer != null}")
|
||||||
if (rgbFaceRectTransformer != null) {
|
if (rgbFaceRectTransformer != null) {
|
||||||
val rgbDrawInfoList: MutableList<DrawInfo?>? = recognizeViewModel.getDrawInfo(
|
val rgbDrawInfoList: MutableList<DrawInfo>? = recognizeViewModel.getDrawInfo(
|
||||||
facePreviewInfoList,
|
facePreviewInfoList,
|
||||||
LivenessType.RGB,
|
LivenessType.RGB,
|
||||||
openRectInfoDraw
|
openRectInfoDraw
|
||||||
@@ -1122,15 +1129,24 @@ class MainScreenPresentation(
|
|||||||
// 识别成功
|
// 识别成功
|
||||||
binding.dualCameraFaceRectView.drawRealtimeFaceInfo(rgbDrawInfoList)
|
binding.dualCameraFaceRectView.drawRealtimeFaceInfo(rgbDrawInfoList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//binding.dualCameraFaceRectView.clearFaceInfo()
|
||||||
|
//clearLeftFaceData()
|
||||||
|
|
||||||
val listIsEmpty = facePreviewInfoList.isEmpty()
|
val listIsEmpty = facePreviewInfoList.isEmpty()
|
||||||
val listFirstTrackId = if (listIsEmpty.not()) facePreviewInfoList[0]!!.trackId else null
|
val listFirstTrackId = if (listIsEmpty.not()) facePreviewInfoList[0].trackId else null
|
||||||
Timber.tag(TAG)
|
Timber.tag(TAG)
|
||||||
.d("listIsEmpty=$listIsEmpty,lastFaceTrackId=$lastFaceTrackId,listFirstTrackId=$listFirstTrackId")
|
.d("listIsEmpty=$listIsEmpty,lastFaceTrackId=$lastFaceTrackId,listFirstTrackId=$listFirstTrackId")
|
||||||
if (listIsEmpty || (lastFaceTrackId != listFirstTrackId)) {
|
if (listIsEmpty || (lastFaceTrackId != listFirstTrackId)) {
|
||||||
if (lastFaceTrackId != -1 && currentUserId!=null) {
|
if (lastFaceTrackId != -1 && currentUserId != null) {
|
||||||
mealPickupMode = SPUtil.getInstance().get(GlobalKey.KEY_PICKUP_MODE, 0) ?: 0
|
mealPickupMode = SPUtil.getInstance().get(GlobalKey.KEY_PICKUP_MODE, 0) ?: 0
|
||||||
Timber.tag(TAG).i("$lastFaceTrackId 用户离开")
|
Timber.tag(TAG).i("$lastFaceTrackId 用户离开")
|
||||||
lastFaceTrackId = -1
|
lastFaceTrackId = -1
|
||||||
|
Timber.tag(TAG)
|
||||||
|
.d("postUserData userNutritionData是否null: ${userNutrition == null}, currentFood是否null: ${currentFood == null},currentUserId是否null:${currentUserId == null}")
|
||||||
|
if (userNutrition == null || currentFood == null || currentUserId == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
postUserData()
|
postUserData()
|
||||||
if (mealPickupMode == 1 || isKeepFaceState) {
|
if (mealPickupMode == 1 || isKeepFaceState) {
|
||||||
step2FaceRecognizing(currentFood!!)
|
step2FaceRecognizing(currentFood!!)
|
||||||
@@ -1144,11 +1160,6 @@ class MainScreenPresentation(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun postUserData() {
|
fun postUserData() {
|
||||||
Timber.tag(TAG)
|
|
||||||
.d("postUserData userNutritionData是否null: ${userNutrition == null}, currentFood是否null: ${currentFood == null},currentUserId是否null:${currentUserId == null}", )
|
|
||||||
if (userNutrition == null || currentFood == null || currentUserId == null) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
createOrder()
|
createOrder()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1173,7 +1184,8 @@ class MainScreenPresentation(
|
|||||||
foodInfo = currentFood!!,
|
foodInfo = currentFood!!,
|
||||||
foodWeight = lastWeight.roundToInt(),
|
foodWeight = lastWeight.roundToInt(),
|
||||||
eatWeight = eatWeight.roundToInt(),
|
eatWeight = eatWeight.roundToInt(),
|
||||||
eatNum = activity.getEatNum(eatWeight, currentFood!!.specWeight)
|
eatNum = activity.getEatNum(eatWeight, currentFood!!.specWeight),
|
||||||
|
userId = currentUserId
|
||||||
) {
|
) {
|
||||||
if (MyApp.DEBUG) {
|
if (MyApp.DEBUG) {
|
||||||
ToastUtils.showToast("订单已生成")
|
ToastUtils.showToast("订单已生成")
|
||||||
@@ -1182,6 +1194,13 @@ class MainScreenPresentation(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun clearLeftFaceData() {
|
||||||
|
facePreviewInfoList?.let {
|
||||||
|
recognizeViewModel.clearLeftFace(facePreviewInfoList!!)
|
||||||
|
}
|
||||||
|
facePreviewInfoList = null
|
||||||
|
}
|
||||||
|
|
||||||
fun hideNutritionView(chargeMode: Int) {
|
fun hideNutritionView(chargeMode: Int) {
|
||||||
binding.nutritionInclude.root.gone()
|
binding.nutritionInclude.root.gone()
|
||||||
binding.calorieInclude.root.gone()
|
binding.calorieInclude.root.gone()
|
||||||
|
|||||||
Reference in New Issue
Block a user