| | |
| | | QueryLifePayOrderListInput, |
| | | LifeRechargeConstants, |
| | | ElectricParValueResponse, |
| | | ElectricSupportAreaResponse, |
| | | } from '@life-payment/core-vue'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import { computed, MaybeRef, reactive, unref } from 'vue'; |
| | |
| | | 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 { |
| | |
| | | label-position="top" |
| | | class="order-bill-recharge electric" |
| | | > |
| | | <FormItem label="所在城市" class="bole-form-item" prop="province" required> |
| | | <FormItem label="所在区域" class="bole-form-item" prop="province" required> |
| | | <ChooseInputWithPicker |
| | | v-model="form.province" |
| | | placeholder="请选择城市" |
| | | placeholder="请选择区域" |
| | | :value-enum="electricParValueList" |
| | | enum-label-key="areaName" |
| | | enum-value-key="areaName" |
| | | enum-label-key="cityName" |
| | | enum-value-key="cityName" |
| | | /> |
| | | </FormItem> |
| | | <FormItem label="所在城市" class="bole-form-item" prop="city" required v-if="form.province"> |
| | | <ChooseInputWithPicker |
| | | v-model="form.city" |
| | | placeholder="请选择城市" |
| | | :value-enum="electricCityList" |
| | | enum-label-key="cityName" |
| | | enum-value-key="cityName" |
| | | /> |
| | | </FormItem> |
| | | <!-- <FormItem label="电网类型" class="bole-form-item" prop="electricType" required> |
| | |
| | | electricType: '', |
| | | electricAccountType: '', |
| | | province: '', |
| | | city: '', |
| | | sixID: '', |
| | | }); |
| | | |
| | |
| | | const { electricParValueList } = useGetElectricParValue(); |
| | | |
| | | const parValueList = computed( |
| | | () => electricParValueList.value.find((x) => x.areaName === form.province)?.parValue ?? [] |
| | | () => electricParValueList.value.find((x) => x.cityName === form.province)?.parValue ?? [] |
| | | ); |
| | | |
| | | const electricCityList = computed( |
| | | () => electricParValueList.value.find((x) => x.cityName === form.province)?.childCityList ?? [] |
| | | ); |
| | | |
| | | watch( |
| | | () => form.province, |
| | | (provinceName) => { |
| | | const electricParValue = electricParValueList.value.find( |
| | | (item) => item.areaName === provinceName |
| | | (item) => item.cityName === provinceName |
| | | ); |
| | | form.electricType = electricParValue.electricType; |
| | | } |
| | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const rules = reactive<FormRules>({ |
| | | province: [{ required: true, message: '请选择所在城市' }], |
| | | province: [{ required: true, message: '请选择所在区域' }], |
| | | city: [{ required: true, message: '请选择所在城市' }], |
| | | electricAccountType: [{ required: true, message: '请选择电费类型' }], |
| | | electricAccount: [{ required: true, message: '请输入电网户号', regex: /^\d{13}$/ }], |
| | | sixID: [ |
| | |
| | | electricAccountType: form.electricAccountType, |
| | | electricAccount: form.electricAccount, |
| | | province: form.province, |
| | | city: '', |
| | | city: form.city, |
| | | sixID: form.sixID, |
| | | }, |
| | | }; |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 获取电费充值区域 GET /api/LifePay/GetElectricSupportArea */ |
| | | async getElectricSupportArea(options?: RequestConfig) { |
| | | return this.request<ElectricSupportAreaResponse>('/api/LifePay/GetElectricSupportArea', { |
| | | method: 'GET', |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 获取电费面值 GET /api/LifePay/GetElectricParValue */ |
| | | async getElectricParValue(options?: RequestConfig) { |
| | | return this.request<ElectricParValueResponse>('/api/LifePay/GetElectricParValue', { |
| | |
| | | /** 退款时间 */ |
| | | refundTime?: string; |
| | | } |
| | | |
| | | export interface ElectricSupportAreaResponse { |
| | | success?: boolean; |
| | | requestNo?: string; |
| | | partnerId?: string; |
| | | service?: string; |
| | | version?: string; |
| | | protocol?: string; |
| | | context?: string; |
| | | ext?: any; |
| | | code?: string; |
| | | message?: string; |
| | | detail?: string; |
| | | electricAreaList?: ElectricSupportAreaListOutput[]; |
| | | } |
| | | |
| | | export interface ElectricSupportAreaListOutput { |
| | | childCityList?: ElectricSupportAreaChildCityListOutput[]; |
| | | cityName?: string; |
| | | cityParentId?: string; |
| | | ciytId?: string; |
| | | electricType?: string; |
| | | parValue?: string[]; |
| | | rate?: number; |
| | | } |
| | | |
| | | export interface ElectricSupportAreaChildCityListOutput { |
| | | cityName?: string; |
| | | cityParentId?: string; |
| | | ciytId?: string; |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 获取生活缴费用户身份会话信息 GET /api/Account/GetLifePayWxIndentity */ |
| | | export async function getLifePayWxIndentity( |
| | | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) |
| | | params: API.APIgetLifePayWxIndentityParams, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.WxMiniAppIndentityInfo>('/api/Account/GetLifePayWxIndentity', { |
| | | method: 'GET', |
| | | params: { |
| | | ...params, |
| | | }, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 此处后端没有提供注释 POST /api/Account/GetOssSTS */ |
| | | export async function getOssSTS(options?: API.RequestConfig) { |
| | | return request<API.OssSTSReponse>('/api/Account/GetOssSTS', { |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 获取电费充值区域 GET /api/LifePay/GetElectricSupportArea */ |
| | | export async function getElectricSupportArea(options?: API.RequestConfig) { |
| | | return request<API.ElectricSupportAreaResponse>('/api/LifePay/GetElectricSupportArea', { |
| | | method: 'GET', |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 获取订单分页数据 POST /api/LifePay/GetLifePayOrderPage */ |
| | | export async function getLifePayOrderPage( |
| | | body: API.QueryLifePayOrderListInput, |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 获取微信支付的JSAPI POST /api/LifePay/GetPayOrderForJsAPI */ |
| | | export async function getPayOrderForJsAPI( |
| | | body: API.GetPayOrderForJsAPIInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.ModelPayPrePayId>('/api/LifePay/GetPayOrderForJsAPI', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 根据订单号获取支付状态 GET /api/LifePay/GetPayStatusByOrderNo */ |
| | | export async function getPayStatusByOrderNo( |
| | | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) |
| | |
| | | }); |
| | | } |
| | | |
| | | /** 此处后端没有提供注释 GET /api/Test/TestH5Pay */ |
| | | export async function testH5Pay( |
| | | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) |
| | | params: API.APItestH5PayParams, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<string>('/api/Test/TestH5Pay', { |
| | | method: 'GET', |
| | | params: { |
| | | ...params, |
| | | }, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | |
| | | /** 此处后端没有提供注释 GET /api/Test/TestQRCodePay */ |
| | | export async function testQRCodePay( |
| | | // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) |
| | |
| | | id?: string; |
| | | } |
| | | |
| | | interface APIgetLifePayWxIndentityParams { |
| | | /** 用户登录凭证 */ |
| | | code?: string; |
| | | } |
| | | |
| | | interface APIgetListParams { |
| | | filter?: string; |
| | | clientId?: string; |
| | |
| | | |
| | | interface APItestGetPlatformServicePayParams { |
| | | id?: string; |
| | | } |
| | | |
| | | interface APItestH5PayParams { |
| | | payType?: LifePayTypeEnum; |
| | | outTradeNo?: string; |
| | | description?: string; |
| | | amount?: number; |
| | | h5Type?: string; |
| | | } |
| | | |
| | | interface APItestPayNotifyParams { |
| | |
| | | electricParValue?: ElectricParValueOutput[]; |
| | | } |
| | | |
| | | interface ElectricSupportAreaChildCityListOutput { |
| | | cityName?: string; |
| | | cityParentId?: string; |
| | | ciytId?: string; |
| | | } |
| | | |
| | | interface ElectricSupportAreaListOutput { |
| | | childCityList?: ElectricSupportAreaChildCityListOutput[]; |
| | | cityName?: string; |
| | | cityParentId?: string; |
| | | ciytId?: string; |
| | | electricType?: string; |
| | | parValue?: string[]; |
| | | rate?: number; |
| | | } |
| | | |
| | | interface ElectricSupportAreaResponse { |
| | | success?: boolean; |
| | | requestNo?: string; |
| | | partnerId?: string; |
| | | service?: string; |
| | | version?: string; |
| | | protocol?: string; |
| | | context?: string; |
| | | ext?: any; |
| | | code?: string; |
| | | message?: string; |
| | | detail?: string; |
| | | electricAreaList?: ElectricSupportAreaListOutput[]; |
| | | } |
| | | |
| | | interface EnableSearchSettingInput { |
| | | id: string; |
| | | status: boolean; |
| | |
| | | status?: ParkRewardStatusEnum; |
| | | /** 奖励名称 */ |
| | | rewardName?: string; |
| | | } |
| | | |
| | | interface GetPayOrderForJsAPIInput { |
| | | orderNo: string; |
| | | lifePayType?: LifePayTypeEnum; |
| | | openId?: string; |
| | | attach?: string; |
| | | } |
| | | |
| | | interface GetPermissionListResultDto { |
| | |
| | | defaultValue?: any; |
| | | } |
| | | |
| | | interface ModelPayPrePayId { |
| | | prepayId?: string; |
| | | code?: string; |
| | | message?: string; |
| | | } |
| | | |
| | | interface ModuleApiDescriptionModel { |
| | | rootPath?: string; |
| | | remoteServiceName?: string; |
| | |
| | | interface SetLifePayOrderPayTypeInput { |
| | | orderNo: string; |
| | | lifePayType?: LifePayTypeEnum; |
| | | h5Type?: string; |
| | | openId?: string; |
| | | attach?: string; |
| | | } |
| | | |
| | | interface SetManyContractTemplateHandSignKeyInput { |