餐盘柜优化-不绑定用户可多次取盘

This commit is contained in:
mazengfei
2026-01-16 16:45:13 +08:00
parent cf2d2db42f
commit 1b4762916a
5 changed files with 44 additions and 61 deletions
@@ -126,24 +126,24 @@ class SettingListFragment :
item: EquipmentUserInfo,
position: Int
) {
if (item.isPlaceholder()) {
this.llRoot.isVisible = false
return
}
// if (item.isPlaceholder()) {
// this.llRoot.isVisible = false
// return
// }
this.llRoot.isVisible = true
this.tvNum.text = formatNumber(item.equipmentBoxCode ?: "")
if (item.isBound()) {
val date = DateTimeUtils.parseDateTime(item.updateTime)
val timeInMillis = date?.time ?: 0L
val isOldTime = DateTimeUtils.isMoreThanHoursFromNow(timeInMillis)
if (item.plateNumber.isNullOrBlank().not()) {
// val date = DateTimeUtils.parseDateTime(item.updateTime)
// val timeInMillis = date?.time ?: 0L
// val isOldTime = DateTimeUtils.isMoreThanHoursFromNow(timeInMillis)
this.llRoot.setBackgroundResource(R.drawable.grid_item_bind)
this.tvNum.setTextColor(resources.getColor(R.color.bind_4E535D))
this.tvLastTime.setTextColor(
if (isOldTime) resources.getColor(R.color.bind_time_old) else resources.getColor(
R.color.bind_585868
)
)
// this.tvLastTime.setTextColor(
// if (isOldTime) resources.getColor(R.color.bind_time_old) else resources.getColor(
// R.color.bind_585868
// )
// )
this.llOpen.setBackgroundResource(R.drawable.grid_button_bind)
this.tvOpen.setTextColor(resources.getColor(R.color.bind_FFCC99))
this.llBindInfo.visibility = View.VISIBLE
@@ -152,7 +152,7 @@ class SettingListFragment :
// this.tvName.text = item.name.maskName()
this.tvName.text = item.plateNumber
this.tvLastTime.text = DateTimeUtils.getTimeAgo(date)
// this.tvLastTime.text = DateTimeUtils.getTimeAgo(date)
} else {
this.llRoot.setBackgroundResource(R.drawable.grid_item_unbind)
this.tvNum.setTextColor(resources.getColor(R.color.bind_FFCC99))
@@ -160,7 +160,7 @@ class SettingListFragment :
this.tvOpen.setTextColor(resources.getColor(R.color.unbind_32283C))
this.llBindInfo.visibility = View.GONE
this.tvUnbind.visibility = View.VISIBLE
this.tvUnbind.text = if (item.plateNumber.isNullOrBlank()) "未绑定" else "未绑定(${item.plateNumber})"
// this.tvUnbind.text = "未绑定"
}
// this.llRoot.setOnClickListener {
//// Timber.d("itemClick llRoot ${item.name}, position = $position")