联合支付余量计量模式订单显示当前取餐信息
This commit is contained in:
@@ -24,9 +24,11 @@ import androidx.camera.lifecycle.ProcessCameraProvider
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.google.common.util.concurrent.ListenableFuture
|
||||
import com.sw.dualscreen.GlobalData
|
||||
import com.sw.dualscreen.GlobalKey
|
||||
import com.sw.dualscreen.adapter.FoodOrderAdapter
|
||||
import com.sw.dualscreen.adapter.MainFoodListAdapter
|
||||
import com.sw.dualscreen.databinding.ActivityMainBinding
|
||||
import com.sw.dualscreen.dialog.RemindDialog
|
||||
@@ -290,11 +292,13 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
if (weight <= WEIGHT_RESET_RECOGNIZE) {
|
||||
//秤上重量过小,显示识别中页面
|
||||
presentation?.step1FoodRecognizing()
|
||||
lastWeight = weight
|
||||
return
|
||||
}
|
||||
//余量计量+联合支付人脸查询订单完成
|
||||
if (presentation!!.jointPaymentQueryFinish) {
|
||||
presentation?.updateWeight(weight)
|
||||
lastWeight = weight
|
||||
return
|
||||
}
|
||||
val isWeightChange = weight - lastWeight > WEIGHT_CHANGE_VALUE
|
||||
@@ -303,12 +307,15 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
|
||||
private fun readWeight(weight: Int) {
|
||||
log("registerDataChange weight = $weight")
|
||||
runOnUiThread {
|
||||
binding.tvShowWeight.let {
|
||||
if (it.text.toString() == weight.toString()) return@runOnUiThread
|
||||
binding.tvShowWeight.let {
|
||||
if (it.text.toString() != weight.toString()) {
|
||||
it.text = "$weight"
|
||||
}
|
||||
}
|
||||
if (weight <= WEIGHT_RESET_RECOGNIZE) {
|
||||
//检测到秤上没有东西,重新启动识别菜品 && presentation?.mealPickupMode == 1
|
||||
checkedItem = null
|
||||
}
|
||||
if (settlementMode == 0) {
|
||||
//联合支付-------------------------------------------
|
||||
//0-即放即取,1-余量计量
|
||||
@@ -344,7 +351,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
override fun registerDataChange() {
|
||||
super.registerDataChange()
|
||||
SensorScaleUtils.addWeightListener { value ->
|
||||
readWeight(value)
|
||||
runOnUiThread {
|
||||
readWeight(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,7 +365,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
presentation?.updateWeight(weight)
|
||||
|
||||
if (weight <= WEIGHT_RESET_RECOGNIZE) {
|
||||
log("recognizeByWeight---00002,秤重未超过5克")
|
||||
log("recognizeByWeight---00002,秤重未超过${WEIGHT_RESET_RECOGNIZE}克")
|
||||
//检测到秤上没有东西,重新启动识别菜品 && presentation?.mealPickupMode == 1
|
||||
isRecognitionFood = true
|
||||
return
|
||||
@@ -364,8 +373,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
|
||||
if (isWeightChange && isRecognitionFood) {
|
||||
log("recognizeByWeight---00003,mealPickupMode=${presentation?.mealPickupMode}")
|
||||
if (presentation?.mealPickupMode == 1) {
|
||||
if (presentation?.mealPickupMode == 1 && checkedItem != null) {
|
||||
isRecognitionFood = false
|
||||
return
|
||||
}
|
||||
debouncer.debounce {
|
||||
log("recognizeByWeight---00004")
|
||||
@@ -1171,4 +1181,5 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
// ObjectBox.init(this)
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user