| | |
| | | } |
| | | if (!!code && !wxCode.value) { |
| | | userStore.setWxCode(router.params.code ?? ''); |
| | | getLifePayWxIndentity(code); |
| | | // getLifePayWxIndentity(code); |
| | | } |
| | | } catch (error) {} |
| | | }); |
| | |
| | | let res = await blLifeRecharge.services.getLifePayWxIndentity(params, { |
| | | showLoading: false, |
| | | }); |
| | | userStore.setWxOpenId(res.openId); |
| | | if (res.openId) { |
| | | userStore.setWxOpenId(res.openId); |
| | | } |
| | | return res; |
| | | } catch (error) {} |
| | | } |
| | |
| | | const { getLifePayWxIndentity } = useLifePayWxIndentity(); |
| | | |
| | | async function ensureOpenId() { |
| | | if (wxOpenId) { |
| | | if (wxOpenId.value) { |
| | | return wxOpenId.value; |
| | | } else { |
| | | let rea = await getLifePayWxIndentity(wxCode.value); |
| | | return rea.openId; |
| | | return rea.openId ? rea.openId : wxOpenId.value; |
| | | } |
| | | } |
| | | |
| | |
| | | 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, |
| | |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 获取渠道折扣 GET /api/LifePay/GetChannelRate */ |
| | | async getChannelRate(body: ChannelsBaseInput, options?: RequestConfig) { |
| | | return this.request<ChannelRateOutput>('/api/LifePay/GetChannelRate', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | } |
| | | |
| | | export interface PhoneMesssageCodeLoginInput { |
| | |
| | | } |
| | | |
| | | export type IntroInfoTypeEnum = 0 | 1 | 2 | 3 | 4; |
| | | |
| | | export interface ChannelRateOutput { |
| | | channlesRate?: number; |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 获取渠道折扣 POST /api/LifePay/GetChannelRate */ |
| | | export async function getChannelRate(body: API.ChannelsBaseInput, options?: API.RequestConfig) { |
| | | return request<API.ChannelRateOutput>('/api/LifePay/GetChannelRate', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 获取电费面值 POST /api/LifePay/GetElectricParValue */ |
| | | export async function getElectricParValue( |
| | | body: API.ChannelsBaseInput, |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 导出退款订单Excel POST /api/LifePay/GetLifePayRefudOrderPageExport */ |
| | | export async function getLifePayRefudOrderPageExport( |
| | | body: API.QueryLifePayRefundOrderListInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<any>('/api/LifePay/GetLifePayRefudOrderPageExport', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 获取退款订单详情 GET /api/LifePay/GetLifePayRefundOrderDetail */ |
| | | export async function getLifePayRefundOrderDetail( |
| | | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) |
| | |
| | | type?: number; |
| | | } |
| | | |
| | | interface ChannelRateOutput { |
| | | channlesRate?: number; |
| | | } |
| | | |
| | | interface ChannelsBaseInput { |
| | | pageModel?: Pagination; |
| | | checkChannelId?: string; |
| | |
| | | name?: string; |
| | | /** 手机号 */ |
| | | phoneNumber?: string; |
| | | /** 密码 */ |
| | | password?: string; |
| | | /** 账户 */ |
| | | userName?: string; |
| | |
| | | payStatus?: LifePayStatusEnum; |
| | | acoolyStatus?: ACOOLYStatusEnum; |
| | | lifePayOrderStatus?: LifePayOrderStatusEnum; |
| | | lifePayRefundStatus?: LifePayRefundStatusEnum; |
| | | /** 用户Id */ |
| | | userId?: string; |
| | | /** 搜索关键词 */ |
| | |
| | | name?: string; |
| | | /** 手机号 */ |
| | | phoneNumber?: string; |
| | | /** 密码 */ |
| | | password?: string; |
| | | /** 账户 */ |
| | | userName?: string; |