| | |
| | | UserAccountListOutput, |
| | | AddUpdateUserAccountInput, |
| | | GasParValueResponse, |
| | | GasParValueOutput, |
| | | ChannelRateOutput, |
| | | } from '@life-payment/core-vue'; |
| | | import { useQuery, useQueryClient } from '@tanstack/vue-query'; |
| | | import { computed, MaybeRef, reactive, unref } from 'vue'; |
| | |
| | | placeholderData: () => [] as LifePayRateListOutput[], |
| | | }); |
| | | |
| | | const lifePayPhoneRate = computed( |
| | | () => |
| | | const hasChannel = computed(() => !!blLifeRecharge.accountModel.channlesNum); |
| | | |
| | | const { data: channelRate } = useQuery({ |
| | | queryKey: ['blLifeRecharge/getChannelRate', blLifeRecharge.accountModel.channlesNum], |
| | | queryFn: async () => { |
| | | return await blLifeRecharge.services.getChannelRate( |
| | | { |
| | | checkChannelId: blLifeRecharge.accountModel.channlesNum, |
| | | }, |
| | | { showLoading: false } |
| | | ); |
| | | }, |
| | | placeholderData: () => ({} as ChannelRateOutput), |
| | | enabled: hasChannel, |
| | | }); |
| | | |
| | | const lifePayPhoneRate = computed(() => { |
| | | if (hasChannel.value && channelRate.value.channlesRate) { |
| | | return channelRate.value.channlesRate; |
| | | } |
| | | return ( |
| | | lifePayRateList.value.find( |
| | | (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.默认话费折扣 |
| | | )?.rate ?? 100 |
| | | ); |
| | | }); |
| | | |
| | | const lifePayElectricRate = computed( |
| | | () => |
| | | const lifePayElectricRate = computed(() => { |
| | | if (hasChannel.value && channelRate.value.channlesRate) { |
| | | return channelRate.value.channlesRate; |
| | | } |
| | | return ( |
| | | lifePayRateList.value.find( |
| | | (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.默认电费折扣 |
| | | )?.rate ?? 100 |
| | | ); |
| | | }); |
| | | |
| | | const lifePayGasRate = computed( |
| | | () => |
| | | const lifePayGasRate = computed(() => { |
| | | if (hasChannel.value && channelRate.value.channlesRate) { |
| | | return channelRate.value.channlesRate; |
| | | } |
| | | return ( |
| | | lifePayRateList.value.find( |
| | | (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.默认燃气折扣 |
| | | )?.rate ?? 100 |
| | | ); |
| | | }); |
| | | |
| | | return { |
| | | lifePayRateList, |