Compare commits
2 Commits
f4b536accb
...
a1fa51206f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1fa51206f | ||
|
|
0fb8b98c72 |
@@ -2,6 +2,7 @@ import { useState } from 'react';
|
||||
import { View, Text } from '@tarojs/components';
|
||||
import Taro, { useDidShow } from '@tarojs/taro';
|
||||
import { listConsultations, ConsultationSession } from '../../services/consultation';
|
||||
import { notificationService } from '../../services/notification';
|
||||
import Loading from '../../components/Loading';
|
||||
import './index.scss';
|
||||
|
||||
@@ -32,9 +33,8 @@ export default function Messages() {
|
||||
const res = await listConsultations({ page: 1, page_size: 20 });
|
||||
setSessions(res.data || []);
|
||||
} else {
|
||||
// 通知目前从咨询中提取状态变化作为示例
|
||||
// 后续可对接独立通知 API
|
||||
setNotifications([]);
|
||||
const res = await notificationService.list<{ data: unknown[] }>({ page: 1, page_size: 20 });
|
||||
setNotifications((res as { data?: unknown[] })?.data || []);
|
||||
}
|
||||
} catch {
|
||||
if (tab === 'consultation') setSessions([]);
|
||||
|
||||
@@ -18,6 +18,8 @@ const MENU_ITEMS = [
|
||||
{ label: '透析处方', icon: '💊', bg: '#E8F0E8' },
|
||||
{ label: '知情同意', icon: '📋', bg: '#F3E8F8' },
|
||||
{ label: '积分明细', icon: '📊', bg: '#F0DDD4' },
|
||||
{ label: '我的预约', icon: '📅', bg: '#E8F0F8' },
|
||||
{ label: '在线咨询', icon: '💬', bg: '#E8F0E8' },
|
||||
{ label: '设置', icon: '⚙️', bg: '#f0f0f0' },
|
||||
];
|
||||
|
||||
@@ -34,6 +36,8 @@ const MENU_PATHS: Record<string, string> = {
|
||||
'透析记录': '/pages/pkg-profile/dialysis-records/index',
|
||||
'透析处方': '/pages/pkg-profile/dialysis-prescriptions/index',
|
||||
'知情同意': '/pages/pkg-profile/consents/index',
|
||||
'我的预约': '/pages/pkg-appointment/index',
|
||||
'在线咨询': '/pages/consultation/index',
|
||||
'设置': '/pages/pkg-profile/settings/index',
|
||||
};
|
||||
|
||||
|
||||
12
apps/miniprogram/src/services/notification.ts
Normal file
12
apps/miniprogram/src/services/notification.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { api } from './request';
|
||||
|
||||
export const notificationService = {
|
||||
list: (params?: { page?: number; page_size?: number }) =>
|
||||
api.get('/messages', params as Record<string, string | number | undefined>),
|
||||
markRead: (id: string) =>
|
||||
api.put(`/messages/${id}/read`),
|
||||
markAllRead: () =>
|
||||
api.put('/messages/read-all'),
|
||||
getUnreadCount: () =>
|
||||
api.get('/messages/unread-count'),
|
||||
};
|
||||
Reference in New Issue
Block a user