70 行
3.4 KiB
Markdown
70 行
3.4 KiB
Markdown
---
|
||
schema: "hl-changelog/v2"
|
||
ticket: "frontend-house-detail-tabs-empty"
|
||
title: "房务订单详情「定制师需求/配房行程/操作日志」tab 全显示 0/暂无数据,但后端数据正常返回"
|
||
consumer: "admin"
|
||
author: "wx(GIT)"
|
||
change_type: "前端缺陷"
|
||
backend_status: "not_required"
|
||
gateway_status: "not_required"
|
||
frontend_status: "implemented"
|
||
frontend_owner: "mmg"
|
||
frontend_ref: "fa59235d"
|
||
target_release: ""
|
||
verified_at: ""
|
||
status_note: "已修复。真根因:父组件 v-if+show 同拍驱动 OrderDetailModal,挂载瞬间 show 已是 true,驱动 load() 的 watch 无 immediate 漏触发 → 详情接口从未调用 → 三 tab 全 0(非 adapter 断点,探针证伪 changelog 原自述)。修复:OrderDetailModal setup 末尾 onMounted 兜底,挂载时 show+orderId 就位即补 load();新增 OrderDetailModal.spec 回归。frontend_ref=fa59235d。"
|
||
updated_at: "2026-08-09"
|
||
base: "dev-v3"
|
||
generated: "2026-08-09T16:10:00+08:00"
|
||
---
|
||
|
||
# 房务订单详情 tab 全显示 0/暂无数据,但后端数据正常
|
||
|
||
> 前端缺陷,待前端排查。后端数据正常。
|
||
|
||
## 现象(TEST 实测,订单 26-3559 吴国强,order_id=2086270159575535618)
|
||
|
||
定制师已提交用房需求,但房务打开订单详情:
|
||
- **配房行程**:计数 0,内容「暂无配房行程数据」
|
||
- **定制师需求**:计数 0
|
||
- **操作日志**:计数 0
|
||
|
||
## 后端数据实测正常(不是后端问题)
|
||
|
||
```
|
||
GET https://api.test.1814.love:9443/admin/house/orders/2086270159575535618
|
||
```
|
||
|
||
返回 code=200,data 包含完整数据:
|
||
- `requirement.current.days`:完整需求明细(day1 8/24 满洲里市 标间 STANDARD 4间 预算 1120.00 等,consultantName=王骁)
|
||
- `requirement.current`:requirementId=2086358876319375361,status=PROCESSING,isCurrent=true
|
||
- `itinerary`:配房行程 1 条(dayNumber=1, stayDate=2026-08-24, 海拉尔区, arrange=pending 待配房, expectedRoom 标间4间)
|
||
- `tabCounts`:`{"itineraryCount":0,"messageCount":1,"unreadMessageCount":0,"operationLogCount":3}`
|
||
|
||
**后端需求/行程/日志数据都正常返回了**,但前端三个 tab 全显示 0/空。
|
||
|
||
## 前端问题定位线索
|
||
|
||
`OrderDetailModal.vue` 的 tab 计数绑定:
|
||
- 配房行程:`merged.days.length`
|
||
- 定制师需求:`messageCount`(computed 读 `merged.messageCount`)
|
||
- 操作日志:`operationLogCount`(computed 读 `merged.operationLogCount`)
|
||
|
||
`merged` 来自 `orderDetailAdapter.js`。后端 `tabCounts.messageCount=1`、`operationLogCount=3`、`itinerary`/`requirement.current.days` 都有数据,但前端全显示 0——**疑似 adapter 没正确把后端的 itinerary/requirement.current.days/tabCounts 映射进 merged.days/messageCount/operationLogCount**,或组件读取字段与 adapter 输出字段对不上。
|
||
|
||
## 期望
|
||
|
||
房务订单详情正确显示:
|
||
- 配房行程 tab:显示 itinerary 的每日配房行程(待配房/已配房)
|
||
- 定制师需求 tab:显示 requirement.current 的需求明细(每天房型/间数/预算/备注)
|
||
- 操作日志 tab:显示操作日志(operationLogCount=3 条)
|
||
|
||
## 复现路径
|
||
|
||
房务(housekeeper)→ 订单详情(26-3559 吴国强)→ 看「配房行程/定制师需求/操作日志」三个 tab 计数与内容。
|
||
|
||
## 备注
|
||
|
||
- 后端接口数据完整(上方实测),**纯前端渲染/适配问题**。
|
||
- 建议前端在浏览器 DevTools 看 `/admin/house/orders/{orderId}` 实际响应 vs 组件渲染,定位 adapter 映射断点。
|