包含多个会话的累积代码变更: - backend: AI 聊天服务、触发器调度、认证增强、WebSocket、调度器最小间隔 - admin-web: ETL 状态页、任务管理、调度配置、登录优化 - miniprogram: 看板页面、聊天集成、UI 组件、导航更新 - etl: DWS 新任务(finance_area_daily/board_cache)、连接器增强 - tenant-admin: 项目初始化 - db: 19 个迁移脚本(etl_feiqiu 11 + zqyy_app 8) - packages/shared: 枚举和工具函数更新 - tools: 数据库工具、报表生成、健康检查 - docs: PRD/架构/部署/合约文档更新 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2.9 KiB
2.9 KiB
P9→NS1/RNS1 缺失项 #4:备注 AI 评分的星级展示规范
简要结论
- 状态:⚠️ 部分解决
- 风险等级:🟠 中
star-rating组件已实现(0-10 分→0-5 星,支持半星),设计规范文档已定义评分展示规范,但客户详情页备注区域未使用该组件,后端备注 API 未返回ai_score字段。
详细审查
审查范围
apps/miniprogram/miniprogram/components/star-rating/— 星级评分组件apps/backend/app/services/customer_service.py—_build_notes()实现apps/backend/app/schemas/xcx_customers.py—CustomerNoteschemaapps/miniprogram/miniprogram/pages/customer-detail/customer-detail.wxml— 备注区域docs/miniprogram-dev/design-system/DISPLAY-STANDARDS-2.md— 评分展示规范
发现
-
组件层:star-rating 已完整实现
- 接收
score(0-10),内部转换为 0-5 星,支持半星 - 使用 TDesign
t-rate组件渲染,金黄色(#fbbf24) - 支持只读模式
- 接收
-
设计规范:评分展示规范已定义
DISPLAY-STANDARDS-2.md第 8 节定义了:- 分制约定(后端 0-10 分,UI 0-5 星)
- 展示场景(任务卡片、备注满意度等)
- 半星映射规则(
scoreToHalfStar()) - 未评分态处理(
score=0/null/undefined→ 展示--)
-
后端:备注 API 未返回 ai_score
_build_notes()查询biz.notes表,只返回id、tag_label、created_at、contentCustomerNoteschema 无ai_score/score字段- 数据库
biz.notes表是否有ai_score列未确认
-
前端:备注区域未使用 star-rating 组件
customer-detail.wxml备注列表只展示tagLabel、createdAt、content- 无
<star-rating>组件引用 customer-detail.json未注册star-rating组件(需确认)
证据
后端 _build_notes() 无 score 字段:
return [
{
"id": r[0],
"tag_label": r[1] or "",
"created_at": r[2].isoformat() if r[2] else "",
"content": r[3] or "",
# 缺少 ai_score / score 字段
}
for r in rows
]
前端备注展示无星级:
<view class="note-item" wx:for="{{sortedNotes}}" wx:key="id">
<view class="note-top">
<text class="note-author">{{item.tagLabel}}</text>
<text class="note-time">{{item.createdAt}}</text>
</view>
<text class="note-content">{{item.content}}</text>
<!-- 缺少 <star-rating score="{{item.score}}" /> -->
</view>
建议(如未完全解决)
- 后端:
_build_notes()查询中增加ai_score字段(如biz.notes表有该列) - Schema:
CustomerNote添加score: int | None = None - 前端:备注卡片中添加
<star-rating score="{{item.score}}" size="32rpx" />,未评分时展示-- - tooltip:P9 定义的评分说明 tooltip 需额外实现(小程序原生不支持 tooltip,可用长按弹窗替代)