隐藏load ,提高用户体验

This commit is contained in:
张成
2025-09-29 10:35:34 +08:00
parent 090a44fd6e
commit 9b6e3e15d0
5 changed files with 36 additions and 170 deletions

View File

@@ -40,23 +40,23 @@ export interface UnreadMountResponse {
class NoticeService {
// 获取用户消息通知列表
async getNotificationList({ notification_type, is_read }: NoticeListParams): Promise<ApiResponse<NoticeListResponse>> {
return httpService.post("/notifications/list", { notification_type, is_read }, { showLoading: true });
return httpService.post("/notifications/list", { notification_type, is_read }, { showLoading: false });
}
// 获取消息通知详情
async getNotificationDetail(notification_id: number): Promise<ApiResponse<Notice>> {
return httpService.post("/notifications/detail", { notification_id }, { showLoading: true });
return httpService.post("/notifications/detail", { notification_id }, { showLoading: false });
}
// 标记消息为已读
async markNotificationRead({ notification_ids, mark_all }: MarkReadParams): Promise<ApiResponse<{ marked_count: number }>> {
return httpService.post("/notifications/mark_read", { notification_ids, mark_all }, { showLoading: true });
return httpService.post("/notifications/mark_read", { notification_ids, mark_all }, { showLoading: false });
}
// 删除消息通知
async delNotification({ notification_ids, delete_all }: DeleteParams): Promise<ApiResponse<{ deleted_count: number }>> {
return httpService.post("/notifications/delete", { notification_ids, delete_all }, { showLoading: true });
return httpService.post("/notifications/delete", { notification_ids, delete_all }, { showLoading: false });
}
// 获取未读消息数量
async getNotificationUnreadCount(): Promise<ApiResponse<UnreadMountResponse>> {
return httpService.post("/notifications/unread_count", {}, { showLoading: true });
return httpService.post("/notifications/unread_count", {}, { showLoading: false });
}
}