StandAPP/docs/superpowers/specs/2026-07-06-temp-call-ui-opt...

39 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 临时呼叫界面优化与 pocGid 逻辑对接设计规约 (Design Spec)
## 1. 需求概述
为 StandAPP 临时呼叫功能做进一步改进与视觉优化:
1. **pocGid 解析与覆盖**:异步查询接口 `/api/vid-pull-record/my-list` 后,若返回数据包含 `pocGid` 字段且有效,需要用其覆盖当前的 `currentTempGroupId` 缓存,并通知前端接口 `startPullGroupLock(pocGid)`
2. **第一排“临时群组”显示为 null 的修复**:防范传递的 Intent Extra `"group_name"` 出现为空、`null` 或 `"null"` 字符串的情形,确保兜底展示为 `"临时会话"`
3. **界面字体、颜色与确认按钮样式优化**:美化拉动记录卡片排版,包括增大标题字号、加粗、改变按钮背景与宽度、调整配色提升对比度等。
## 2. 方案设计
### 2.1 pocGid 覆盖机制
`TempCallActivity.kt``fetchPullRecord()` 成功响应体处理中:
```kotlin
val pocGid = record.optString("pocGid", "")
if (pocGid.isNotEmpty()) {
currentTempGroupId = pocGid
MainActivity.executeJs("if(window.startPullGroupLock){ window.startPullGroupLock('$currentTempGroupId'); }")
}
```
### 2.2 null 值防御
`onCreate()` 中,对 intent 传入的群组名称进行过滤判断:
```kotlin
val rawGroupName = intent.getStringExtra("group_name")
val groupName = if (rawGroupName.isNullOrEmpty() || rawGroupName == "null") "临时会话" else rawGroupName
currentGroupName = groupName
```
### 2.3 UI 优化
* **布局文件**`app/src/main/res/layout/activity_temp_call.xml`
* **拉动记录区域样式优化**
* `tv_pull_title` (标题):字体设为 `#FFFFFF``textSize="18sp"`,加粗,`layout_marginTop="12dp"`。
* `tv_pull_source_unit` (发送单位):字体设为 `#CCFFFFFF``textSize="13sp"``layout_marginTop="6dp"`。
* `tv_pull_time` (拉动时间):字体设为 `#99FFFFFF``textSize="12sp"``layout_marginTop="2dp"`。
* `tv_pull_content` (拉动内容):字体设为警示的红色 `#EF4444` 或黄色 `#FBBF24``textSize="14sp"`,加粗,`layout_marginTop="10dp"`。
* **确认按钮样式优化**
* 修改为固定宽度 `layout_width="160dp"`(居中显示),高为 `40dp`
* 背景使用带有圆角的深蓝或半透明按钮背景,字体颜色为纯白,字号为 `14sp`