fix(ui): 修复复合铺贴结果页面倒计时返回功能

- 添加 completeCountdownSeconds 变量用于倒计时控制
- 修改 completeRunnable 中的逻辑,实现正确的倒计时功能
- 修复倒计时显示文本为"任务列表界面"而不是"铺贴任务界面"
- 将倒计时从3秒改为1秒间隔更新,提升用户体验
- 添加对非 COMPLETE 模式的提前返回处理,避免无效操作
这个提交包含在:
徐勤民 2026-04-23 10:38:57 +08:00
父节点 f8d71bf8b4
当前提交 deb267dec0
共有 2 个文件被更改,包括 11 次插入3 次删除

查看文件

@ -37,6 +37,7 @@ public class MyApplication extends App {
public static AppComponent appComponent2; public static AppComponent appComponent2;
// 单证检验服务的 Dagger 网络组件 // 单证检验服务的 Dagger 网络组件
public static AppComponent appComponent3; public static AppComponent appComponent3;
// 铺贴
public static AppComponent appComponent4; public static AppComponent appComponent4;
@Override @Override

查看文件

@ -59,6 +59,7 @@ class CompositeLayupResultActivity : BaseActivity<ActivityCompositeLayupResultBi
private var isPhoto = false private var isPhoto = false
private var uiMode = UiMode.RECOGNIZE_SUCCESS private var uiMode = UiMode.RECOGNIZE_SUCCESS
private var completeCountdownSeconds = 0
private val layupWorkingRunnable: Runnable = Runnable { private val layupWorkingRunnable: Runnable = Runnable {
if (isFinishing || isDestroyed) return@Runnable if (isFinishing || isDestroyed) return@Runnable
@ -68,9 +69,14 @@ class CompositeLayupResultActivity : BaseActivity<ActivityCompositeLayupResultBi
} }
private val completeRunnable: Runnable = Runnable { private val completeRunnable: Runnable = Runnable {
if (isFinishing || isDestroyed) return@Runnable if (isFinishing || isDestroyed) return@Runnable
if (uiMode == UiMode.COMPLETE) { if (uiMode != UiMode.COMPLETE) return@Runnable
completeCountdownSeconds -= 1
if (completeCountdownSeconds <= 0) {
goTaskList() goTaskList()
return@Runnable
} }
binding.subtitle1.text = "${completeCountdownSeconds}S后自动返回任务列表界面"
uiHandler.postDelayed(completeRunnable, 1000L)
} }
private val listener: OfflineCmdListener = object : OfflineCmdListener { private val listener: OfflineCmdListener = object : OfflineCmdListener {
@ -209,11 +215,12 @@ class CompositeLayupResultActivity : BaseActivity<ActivityCompositeLayupResultBi
UiMode.COMPLETE -> { UiMode.COMPLETE -> {
binding.icon.setImageResource(R.mipmap.ocr_true) binding.icon.setImageResource(R.mipmap.ocr_true)
binding.title.text = "恭喜完成当前铺贴任务!" binding.title.text = "恭喜完成当前铺贴任务!"
binding.subtitle1.text = "3S后自动返回铺贴任务界面" completeCountdownSeconds = 3
binding.subtitle1.text = "3S后自动返回任务列表界面"
binding.subtitle2.text = "" binding.subtitle2.text = ""
renderActions(listOf("返回任务列表")) renderActions(listOf("返回任务列表"))
binding.hint.text = "" binding.hint.text = ""
uiHandler.postDelayed(completeRunnable, 3000L) uiHandler.postDelayed(completeRunnable, 1000L)
} }
} }
binding.icon.visibility = android.view.View.VISIBLE binding.icon.visibility = android.view.View.VISIBLE