From dfb8f993f691eedc558d52347b1a93a105f6b0d2 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期一, 03 三月 2025 16:43:14 +0800 Subject: [PATCH] fix: 对接 --- packages/components/src/hooks/index.ts | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletions(-) diff --git a/packages/components/src/hooks/index.ts b/packages/components/src/hooks/index.ts index 687cb7c..1f8861f 100644 --- a/packages/components/src/hooks/index.ts +++ b/packages/components/src/hooks/index.ts @@ -5,7 +5,9 @@ PhoneParValueResponse, QueryLifePayOrderListInput, LifeRechargeConstants, -} from '../utils'; + ElectricParValueResponse, + ElectricSupportAreaResponse, +} from '@life-payment/core-vue'; import { useQuery } from '@tanstack/vue-query'; import { computed, MaybeRef, reactive, unref } from 'vue'; import { useInfiniteLoading } from './infiniteLoading'; @@ -62,6 +64,25 @@ }; } +export function useGetElectricParValue() { + const { blLifeRecharge } = useLifeRechargeContext(); + + const { data: electricParValueList, isLoading } = useQuery({ + queryKey: ['blLifeRecharge/getElectricSupportArea'], + queryFn: async () => { + return await blLifeRecharge.services.getElectricSupportArea({ showLoading: false }); + }, + select(data) { + return data.electricAreaList ?? []; + }, + placeholderData: () => ({} as ElectricSupportAreaResponse), + }); + + return { + electricParValueList, + }; +} + export type UseGetUserLifePayOrderPageOptions = { lifePayOrderType?: MaybeRef<LifeRechargeConstants.LifePayOrderTypeEnum>; }; -- Gitblit v1.9.1