feat(mp): 小程序功能完善 — 服务层扩展 + 页面优化

- 新增 actionInbox 服务层(待办事项列表/线程查询)
- consultation 服务扩展(会话详情/发送消息)
- 多页面代码优化(profile/messages/health/article)
- 新增 navigate 工具函数
This commit is contained in:
iven
2026-05-13 23:26:38 +08:00
parent 93c77c5857
commit 616e0a1539
10 changed files with 141 additions and 23 deletions

View File

@@ -20,12 +20,12 @@ interface NotificationItem {
read?: boolean;
}
const NOTIFY_ICONS: Record<string, { icon: string; bg: string; color: string }> = {
appointment: { icon: '约', bg: '#F0DDD4', color: '#C4623A' },
alert: { icon: '警', bg: '#FFF3E0', color: '#C4873A' },
followup: { icon: '随', bg: '#E8F0E8', color: '#5B7A5E' },
points: { icon: '分', bg: '#F0DDD4', color: '#C4623A' },
report: { icon: '报', bg: '#E8F0E8', color: '#5B7A5E' },
const NOTIFY_ICONS: Record<string, { icon: string; cls: string }> = {
appointment: { icon: '约', cls: 'notify-type-appointment' },
alert: { icon: '警', cls: 'notify-type-alert' },
followup: { icon: '随', cls: 'notify-type-followup' },
points: { icon: '分', cls: 'notify-type-points' },
report: { icon: '报', cls: 'notify-type-report' },
};
export default function Messages() {
@@ -68,6 +68,7 @@ export default function Messages() {
if (isRefresh) {
if (tab === 'consultation') setSessions([]);
else setNotifications([]);
Taro.showToast({ title: '加载失败,下拉重试', icon: 'none' });
}
} finally {
setLoading(false);
@@ -202,8 +203,8 @@ export default function Messages() {
const isUnread = !n.read;
return (
<View key={n.id} className={`notify-card ${isUnread ? '' : 'notify-card-muted'}`}>
<View className='notify-icon' style={`background:${cfg.bg};`}>
<Text className='notify-icon-char' style={`color:${cfg.color};`}>{cfg.icon}</Text>
<View className={`notify-icon ${cfg.cls}`}>
<Text className={`notify-icon-char ${cfg.cls}`}>{cfg.icon}</Text>
</View>
<View className='notify-body'>
<View className='notify-row'>