优化订单显示档口机标识;优化当前菜品信息的问题;

This commit is contained in:
2026-03-26 18:57:20 +08:00
parent fb4278d2b7
commit 57f8920442
3 changed files with 138 additions and 65 deletions
@@ -2,6 +2,7 @@ package com.sw.dualscreen.adapter
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.TextView
@@ -31,13 +32,15 @@ class FoodOrderAdapter(list: MutableList<FoodItem>) :
@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: VH, position: Int, item: FoodItem?) {
val binding = holder.binding
setTextColor(binding.tvFoodName, binding.tvPriceNorm, binding.tvWeight, binding.tvAmount)
item?.let {
binding.tvFoodName.text = it.foodName
binding.tvFoodName.setTextColor(if (it.isLocalData) Color.GREEN else "#FF33446A".toColorInt())
if (it.orderFrom == 2) {
binding.tvPriceNorm.text = if (it.specName.isNullOrBlank()) "${it.specWeight}" else "${it.specName}/${it.specWeight}"
} else {
val foodPrice = it.foodPrice.format2String(2)
binding.tvPriceNorm.text = "${foodPrice}/${it.num}"
binding.tvPriceNorm.text = "${foodPrice}/100"
}
//if (it.specName.isNullOrBlank().not()) {
// binding.tvPriceFlag.text = "[${it.specName}]"
@@ -48,7 +51,6 @@ class FoodOrderAdapter(list: MutableList<FoodItem>) :
if (it.orderFrom == 2) visible() else gone()
}
}
setTextColor(binding.tvFoodName, binding.tvPriceNorm, binding.tvWeight, binding.tvAmount)
binding.root.updateLayoutParams<RecyclerView.LayoutParams> {
topMargin = 2.dp
bottomMargin = 2.dp