From f95d3066203612a450e462edd679eb5a4973f35c Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期一, 10 十一月 2025 16:59:29 +0800
Subject: [PATCH] fix: bug
---
apps/cMiniApp/src/subpackages/task/taskDetail/InnerPage.vue | 60 +++++++++++++++++++++++++-----------------------------------
1 files changed, 25 insertions(+), 35 deletions(-)
diff --git a/apps/cMiniApp/src/subpackages/task/taskDetail/InnerPage.vue b/apps/cMiniApp/src/subpackages/task/taskDetail/InnerPage.vue
index 7591634..d7a1d9c 100644
--- a/apps/cMiniApp/src/subpackages/task/taskDetail/InnerPage.vue
+++ b/apps/cMiniApp/src/subpackages/task/taskDetail/InnerPage.vue
@@ -75,7 +75,7 @@
v-if="
from === 'hire' &&
!(
- detail?.checkReceiveMethod === EnumTaskCheckReceiveMethod.CheckIn &&
+ isContainCheckIn &&
detail?.hireButton === GetTaskInfoQueryResultHireButton.ApplyCheckReceive
)
"
@@ -128,6 +128,8 @@
EnumTaskCheckReceiveMethod,
} from '@12333/constants';
import { useAccessLogin } from '@/hooks';
+import { useTaskInfo } from '@12333/hooks';
+import _ from 'lodash';
defineOptions({
name: 'InnerPage',
@@ -141,26 +143,7 @@
const id = router.params?.id ?? '';
const from = router.params?.from ?? '';
-const {
- isLoading,
- isError,
- data: detail,
- refetch,
-} = useQuery({
- queryKey: ['taskServices/getTaskInfo', id],
- queryFn: async () => {
- return await taskServices.getTaskInfo(
- { id: id },
- {
- showLoading: false,
- }
- );
- },
- placeholderData: () => ({} as API.GetTaskInfoQueryResult),
- onSuccess(data) {
- // if (data.isExistTradeChatRecord) setTrue();
- },
-});
+const { isLoading, isError, detail, refetch, isContainCheckIn } = useTaskInfo({ id });
const { isCollapse, setTrue } = useToggle();
@@ -180,20 +163,27 @@
}
});
-const handleApply = useAccessReal(
- async () => {
- try {
- let params: API.ApplyTaskCommand = {
- ids: [id],
- };
- let res = await taskUserServices.applyTask(params);
- if (res) {
- Message.success('鎶ュ悕鎴愬姛');
- refetch({ type: 'inactive' });
- }
- } catch (error) {}
- },
- { message: '瀹炲悕鎴愬姛鍚庢墠鍙姤鍚嶏紝璇峰墠寰�瀹炲悕璁よ瘉' }
+const handleApply = _.debounce(
+ useAccessReal(
+ async () => {
+ try {
+ let params: API.ApplyTaskCommand = {
+ ids: [id],
+ };
+ let res = await taskUserServices.applyTask(params);
+ if (res) {
+ Message.success('鎶ュ悕鎴愬姛');
+ refetch({ type: 'inactive' });
+ }
+ } catch (error) {}
+ },
+ { message: '瀹炲悕鎴愬姛鍚庢墠鍙姤鍚嶏紝璇峰墠寰�瀹炲悕璁よ瘉' }
+ ),
+ 1000,
+ {
+ leading: true,
+ trailing: false,
+ }
);
const handleAttention = useAccessLogin(async () => {
--
Gitblit v1.9.1