feat(miniprogram): 通知 Tab 对接 erp-message 消息 API — 替换空壳
This commit is contained in:
@@ -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([]);
|
||||
|
||||
Reference in New Issue
Block a user