From 9525a39e2174aebfc690c57cab64705680e4d23b Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期五, 21 三月 2025 17:24:00 +0800 Subject: [PATCH] fix: 三期需求 --- packages/components/src/hooks/index.ts | 35 ++++++++++++++++++++++++++++++++++- 1 files changed, 34 insertions(+), 1 deletions(-) diff --git a/packages/components/src/hooks/index.ts b/packages/components/src/hooks/index.ts index ec903cc..d8ff400 100644 --- a/packages/components/src/hooks/index.ts +++ b/packages/components/src/hooks/index.ts @@ -127,7 +127,11 @@ }); res.data = res.data.map((x) => ({ ...x, - frontStatus: convertOrderFrontStatus(x.payStatus, x.lifePayOrderStatus), + frontStatus: convertOrderFrontStatus( + x.payStatus, + x.lifePayOrderStatus, + x.lifePayRefundStatus + ), })); return res; }, @@ -276,3 +280,32 @@ gasParValueList, }; } + +type UseIntroInfoOptions = { + lifePayOrderType: MaybeRef<LifeRechargeConstants.LifePayOrderTypeEnum>; + onSuccess?: (data: API.LifePayIntroInfoOutput[]) => any; +}; + +export function useIntroInfo({ lifePayOrderType, onSuccess }: UseIntroInfoOptions) { + const { blLifeRecharge } = useLifeRechargeContext(); + + const { data: introInfo } = useQuery({ + queryKey: ['blLifeRecharge/getIntroInfo', lifePayOrderType], + queryFn: async () => { + return await blLifeRecharge.services.getIntroInfo( + { + type: unref(lifePayOrderType), + }, + { + showLoading: false, + } + ); + }, + placeholderData: () => [] as API.LifePayIntroInfoOutput[], + onSuccess: (data) => { + onSuccess?.(data); + }, + }); + + return { introInfo }; +} -- Gitblit v1.9.1