From d1c34cb833e9b2e5f4142a98c7faa00f15f2af3d Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Mon, 21 Sep 2026 16:58:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=90=91=E5=AF=BC):=20Windows=20=E7=AC=AC?= =?UTF-8?q?=202=20=E6=AD=A5"=E5=B7=B2=E8=BF=9E=E6=8E=A5"=E8=AF=AF=E6=8A=A5?= =?UTF-8?q?=E2=80=94=E2=80=94online=20=E4=B8=8D=E7=AD=89=E4=BA=8E=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pavo 后端的 online 只要枚举到打印机就为 true(与 C# 版语义一致), status 可能同时是 0x80 离线;向导 ready 原判定只看 online,掩盖了 "打印机已断开连接或已关机"的真实状态(管理端如实显示,App 却说已连接, 用户实测被误导)。改为 status 为就绪/打印中才算通过,离线等状态走 badText 如实显示 statusText。 --- lib/ui/setup_wizard.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ui/setup_wizard.dart b/lib/ui/setup_wizard.dart index 8f86ea3..5d7cfef 100644 --- a/lib/ui/setup_wizard.dart +++ b/lib/ui/setup_wizard.dart @@ -223,7 +223,11 @@ class _SetupWizardState extends State { Widget _stepPrinter(ColorScheme scheme) { final s = _printerStatus; - final ready = s != null && s.online; + // 就绪/打印中才算通过:Windows 后端的 online=只要枚举到打印机就 true, + // 不代表设备可用(status 可能是 0x80 离线)——必须看 statusText 如实显示 + final ready = s != null && + s.online && + (s.status == 0 || s.status == 0x00000002 || s.status == 0x00000005 || s.status == 0x00000006); final driverMissing = _driverInstalled == false; final bundledInstaller = DriverInstall.bundledInstallerPath(); return Column(