fix(health): 修复患者端咨询权限+聊天页UI+SVG模板警告
- consultation_handler: create_message/mark_session_read 从 .manage 降为 .list, 患者端只有 list 权限,导致发送消息和标记已读 403 - consultation.ts: 同步后端 DTO doctor_name/patient_name 等缺失字段 - messages/index.tsx: 咨询卡片显示医生姓名替代 consultation_type - consultation/index.tsx: 同步显示 doctor_name - pkg-consultation/detail: 按原型重写聊天页(医生头像+在线状态+非对称气泡+药丸输入栏) - ProgressRing: SVG 替换为 conic-gradient 纯 CSS,消除 tmpl_0_svg 模板警告 - usePageData: stopPullDownRefresh 加 try-catch 防止 DevTools fd race
This commit is contained in:
@@ -143,6 +143,13 @@
|
||||
color: $tx;
|
||||
}
|
||||
|
||||
.consult-type-tag {
|
||||
font-size: var(--tk-font-micro);
|
||||
font-weight: 400;
|
||||
color: $tx3;
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
.consult-time {
|
||||
font-size: var(--tk-font-micro);
|
||||
color: var(--tk-text-secondary);
|
||||
|
||||
@@ -159,7 +159,8 @@ export default function Messages() {
|
||||
) : (
|
||||
<View className='msg-list'>
|
||||
{sessions.map((session) => {
|
||||
const doctorName = session.last_message?.slice(0, 1) || '医';
|
||||
const displayName = session.doctor_name || '在线咨询';
|
||||
const avatarChar = session.doctor_name?.charAt(0) || '咨';
|
||||
const hasUnread = session.unread_count_patient > 0;
|
||||
return (
|
||||
<ContentCard
|
||||
@@ -169,12 +170,17 @@ export default function Messages() {
|
||||
className={`consult-card ${hasUnread ? '' : 'consult-card-muted'}`}
|
||||
>
|
||||
<View className={`consult-avatar ${hasUnread ? 'consult-avatar-active' : ''}`}>
|
||||
<Text className='consult-avatar-char'>{doctorName}</Text>
|
||||
<Text className='consult-avatar-char'>{avatarChar}</Text>
|
||||
</View>
|
||||
<View className='consult-body'>
|
||||
<View className='consult-row'>
|
||||
<Text className='consult-doctor'>
|
||||
{session.consultation_type === 'online' ? '在线咨询' : '门诊咨询'}
|
||||
{displayName}
|
||||
{session.consultation_type && (
|
||||
<Text className='consult-type-tag'>
|
||||
{session.consultation_type === 'online' ? '在线' : '门诊'}
|
||||
</Text>
|
||||
)}
|
||||
</Text>
|
||||
<Text className='consult-time'>{formatTime(session.last_message_at)}</Text>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user