From d042bb3c5679375956c7616e6b1afe681fb82d9b Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期三, 24 十二月 2025 16:12:02 +0800
Subject: [PATCH] fix: 甲方小程序

---
 apps/housekeepingMiniApp/src/pages/home/hooks/index.ts |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/apps/housekeepingMiniApp/src/pages/home/hooks/index.ts b/apps/housekeepingMiniApp/src/pages/home/hooks/index.ts
new file mode 100644
index 0000000..7c89e56
--- /dev/null
+++ b/apps/housekeepingMiniApp/src/pages/home/hooks/index.ts
@@ -0,0 +1,42 @@
+import { useQuery, useQueryClient } from '@tanstack/vue-query';
+import * as advertisementServices from '@12333/services/apiV2/advertisement';
+import { EnumAdvertisementPage, CategoryCode, PositionCodeEnum } from '@12333/constants';
+import { useDictionaryDataSelect } from '@12333/hooks';
+import _ from 'lodash';
+
+export function useShowAdvertisements() {
+  const { data: advertisements, refetch } = useQuery({
+    queryKey: ['enterpriseWalletServices/getEnterpriseWalletAccessSelect'],
+    queryFn: () => {
+      return advertisementServices.getShowAdvertisements(
+        {
+          page: EnumAdvertisementPage.PartAWxmpHome,
+        },
+        {
+          showLoading: false,
+        }
+      );
+    },
+    placeholderData: () => [] as API.GetShowAdvertisementsQueryResultItem[],
+  });
+  return {
+    advertisements,
+    advertisementRefetch: refetch,
+  };
+}
+
+export function usePositionGrid() {
+  const { dictionaryDataList: positionList } = useDictionaryDataSelect({
+    categoryCode: CategoryCode.Position,
+    field1: PositionCodeEnum.Housekeeping,
+  });
+
+  const positionListChunk = computed(() => _.chunk(positionList.value, 10));
+
+  const positionGrid = computed(() => positionList.value.slice(0, 10));
+
+  return {
+    positionListChunk,
+    positionGrid,
+  };
+}

--
Gitblit v1.10.0