From e53e33dd46fdf138c851b10f12cdc00131a8d644 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期二, 25 二月 2025 17:12:44 +0800 Subject: [PATCH] fix: bug --- 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