zhengyiming
2025-03-10 5dd9eb5d8a69fa8c2b66706434a6cc7748ff4786
packages/components/src/hooks/index.ts
@@ -6,6 +6,7 @@
  QueryLifePayOrderListInput,
  LifeRechargeConstants,
  ElectricParValueResponse,
  ElectricSupportAreaResponse,
} from '@life-payment/core-vue';
import { useQuery } from '@tanstack/vue-query';
import { computed, MaybeRef, reactive, unref } from 'vue';
@@ -53,7 +54,7 @@
      return await blLifeRecharge.services.getPhoneParValue({ showLoading: false });
    },
    select(data) {
      return data.phoneParValue ?? [];
      return data?.phoneParValue ?? [];
    },
    placeholderData: () => ({} as PhoneParValueResponse),
  });
@@ -67,14 +68,14 @@
  const { blLifeRecharge } = useLifeRechargeContext();
  const { data: electricParValueList, isLoading } = useQuery({
    queryKey: ['blLifeRecharge/getElectricParValue'],
    queryKey: ['blLifeRecharge/getElectricSupportArea'],
    queryFn: async () => {
      return await blLifeRecharge.services.getElectricParValue({ showLoading: false });
      return await blLifeRecharge.services.getElectricSupportArea({ showLoading: false });
    },
    select(data) {
      return data.electricParValue ?? [];
      return data.electricAreaList ?? [];
    },
    placeholderData: () => ({} as ElectricParValueResponse),
    placeholderData: () => ({} as ElectricSupportAreaResponse),
  });
  return {