# 智惠巡修 · 门店收银版 · 打包与运行说明

## 目录真源

`deploy/zhigong-field-usb/zhihui-pos-support/`（客户端安装时复制到 `%LOCALAPPDATA%\ZhigongXunxiu\support\`）

## 三种入口

| 入口 | 文件 | 场景 |
|------|------|------|
| **对话助手（推荐）** | 安装包 `Start-XunxiuChat.bat` | 网页对话 + 本机桥接 9340 |
| **客户端菜单** | `START-客户端.bat` | 诊断 → 上传 → 应用方案 |
| **U 盘** | `START-收银.bat` | 不能装软件时 |

## 打包 ZIP（网站下载）

```powershell
cd D:\my_website\deploy
.\package-xunxiu-client.ps1   # → downloads\zhigong-xunxiu-client.zip
.\package-xunxiu-usb.ps1      # → downloads\zhigong-xunxiu-pos-usb.zip
```

## 标准流程（002 机）

1. `prompt-user-report.ps1` 选现象（可选）
2. `diagnose-pos.ps1` → `reports\pos-*.json` + `auto_findings[]` + 会话码
3. **上传**：`upload-report.ps1` → `/zhihui/api/xunxiu/report`（**自动生成草案 fix-plan**）
4. **拉取**：`pull-fix-plan.ps1` → `playbooks/fix-plan-latest.json`
5. **【X·巡修】** 可 `GET /xunxiu/pending` 查看 · `POST .../fix-plan` 覆盖签发
6. 菜单 **⑤** → `apply-fix-plan.ps1` 按 steps 执行 `fixes\`

## fixes 白名单

| 脚本 | 用途 |
|------|------|
| fixes/01-restart-pos.ps1 | 重启/打开收银网页 |
| fixes/02-rebuild-pos-ui.ps1 | npm build UI（需确认） |
| fixes/03-fix-api-base.bat | 改 API 地址（店长确认） |
| fixes/04-clear-pos-cache.ps1 | A 档清缓存（需确认） |
| fixes/05-setup-lpt1.ps1 | LPT1 小票机 |

## 试点配置

`pilot-config.json`：华联万家晏婴店 `0001` · 机号 `002`

## 安全

- 包内无 JWT、无登录密码
- 店员一页纸不写试点口令
- 报告 24h 内删除

## 自测

```powershell
cd deploy\zhigong-field-usb\zhihui-pos-support
powershell -ExecutionPolicy Bypass -File .\diagnose-pos.ps1 -Channel client
```
