From fa5ee26bb701b816efc811c193ee55504a6efd51 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期三, 03 十二月 2025 17:51:23 +0800
Subject: [PATCH] feat: 通知
---
packages/hooks/task.ts | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/packages/hooks/task.ts b/packages/hooks/task.ts
index 58642d8..3e2af80 100644
--- a/packages/hooks/task.ts
+++ b/packages/hooks/task.ts
@@ -10,6 +10,7 @@
EnumTaskStatus,
EnumUserGender,
EnumTaskUserApplyStatus,
+ EnumReadScene,
} from '@12333/constants';
import _ from 'lodash';
import { OrderUtils, trim } from '@12333/utils';
@@ -228,24 +229,28 @@
type UseTaskInfoOptions = {
id: MaybeRef<string>;
+ readScene?: string | EnumReadScene;
onSuccess?: (data: API.GetTaskInfoQueryResult) => any;
};
-export function useTaskInfo({ id, onSuccess }: UseTaskInfoOptions) {
+export function useTaskInfo({ id, readScene, onSuccess }: UseTaskInfoOptions) {
const {
isLoading,
isError,
data: detail,
refetch,
} = useQuery({
- queryKey: ['taskServices/getTaskInfo', id],
+ queryKey: ['taskServices/getTaskInfo', id, readScene],
queryFn: async () => {
- return await taskServices.getTaskInfo(
- { id: unref(id) },
- {
- showLoading: false,
- }
- );
+ const params: API.APIgetTaskInfoParams = {
+ id: unref(id),
+ };
+ if (!!readScene) {
+ params.readScene = Number(readScene);
+ }
+ return await taskServices.getTaskInfo(params, {
+ showLoading: false,
+ });
},
placeholderData: () => ({} as API.GetTaskInfoQueryResult),
onSuccess(data) {
--
Gitblit v1.9.1