| | |
| | | binding.tvStationName.text = group.stationName |
| | | binding.tvPackageCount.text = "共${group.packages.size}个包裹" |
| | | |
| | | // 根据驿站名称设置相应的图标 |
| | | val stationName = group.stationName.lowercase() |
| | | val stationIconResId = when { |
| | | stationName.isEmpty() || stationName == "未知" -> R.drawable.express_normal |
| | | stationName.contains("菜鸟") -> R.drawable.express_cainiao |
| | | stationName.contains("多多") -> R.drawable.express_duoduo |
| | | stationName.contains("兔喜") -> R.drawable.express_tuxi |
| | | stationName.contains("妈妈") -> R.drawable.express_mama |
| | | stationName.contains("小兵") -> R.drawable.express_xiaobing |
| | | stationName.contains("蓝店") -> R.drawable.express_landian |
| | | else -> R.drawable.express_normal |
| | | } |
| | | |
| | | binding.ivStationIcon.setImageResource(stationIconResId) |
| | | |
| | | // 确保所有数据都被更新 |
| | | packagesAdapter.submitList(null) |
| | | packagesAdapter.submitList(group.packages) |
| | |
| | | binding.tvCompany.text = pack.company |
| | | binding.tvCreateTime.text = pack.createTime |
| | | binding.tvTrackingNumber.text = pack.trackingNumber |
| | | |
| | | // 根据快递公司名称设置相应的图标 |
| | | val companyName = pack.company.lowercase() |
| | | val logoResId = when { |
| | | companyName.isEmpty() || companyName == "未知" -> R.drawable.reminder_package_express |
| | | companyName.contains("顺丰") -> R.drawable.express_package_shunfeng |
| | | companyName.contains("韵达") -> R.drawable.express_package_yunda |
| | | companyName.contains("圆通") -> R.drawable.express_package_yuantong |
| | | companyName.contains("申通") -> R.drawable.express_package_shentong |
| | | companyName.contains("邮政") || companyName.contains("ems") -> R.drawable.express_package_youzheng |
| | | companyName.contains("极兔") -> R.drawable.express_package_jitu |
| | | else -> R.drawable.express_normal |
| | | } |
| | | |
| | | binding.ivCompanyLogo.setImageResource(logoResId) |
| | | } |
| | | } |
| | | } |
| | |
| | | // else R.drawable.circle |
| | | R.drawable.circle |
| | | ) |
| | | |
| | | // 根据快递公司名称设置相应的图标 |
| | | val companyName = pack.company.lowercase() |
| | | val logoResId = when { |
| | | companyName.isEmpty() || companyName == "未知" -> R.drawable.reminder_package_express |
| | | companyName.contains("顺丰") -> R.drawable.express_package_shunfeng |
| | | companyName.contains("韵达") -> R.drawable.express_package_yunda |
| | | companyName.contains("圆通") -> R.drawable.express_package_yuantong |
| | | companyName.contains("申通") -> R.drawable.express_package_shentong |
| | | companyName.contains("邮政") || companyName.contains("ems") -> R.drawable.express_package_youzheng |
| | | companyName.contains("极兔") -> R.drawable.express_package_jitu |
| | | else -> R.drawable.express_normal |
| | | } |
| | | |
| | | binding.ivCompanyLogo.setImageResource(logoResId) |
| | | } |
| | | } |
| | | } |