| | |
| | | name: 'InnerPage', |
| | | }); |
| | | |
| | | function goPay() { |
| | | function goPay(orderNo: string) { |
| | | Taro.navigateTo({ |
| | | url: RouterPath.selectPayType, |
| | | url: `${RouterPath.selectPayType}?orderNo=${orderNo}`, |
| | | }); |
| | | } |
| | | </script> |
| | |
| | | export * from './lifeRechargeServices'; |
| | | export * from './types'; |
| | | export * from './validator'; |
| | | export * from './lifeRechargeConstants'; |
| | |
| | | } |
| | | ); |
| | | } |
| | | |
| | | async setLifePayOrderPayType(body: SetLifePayOrderPayTypeInput, options?: RequestConfig) { |
| | | return this.request<string>('/api/LifePay/SetLifePayOrderPayType', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | }); |
| | | } |
| | | } |
| | | |
| | | export interface PhoneMesssageCodeLoginInput { |
| | |
| | | |
| | | export interface LifePhoneDataCreateLifePayOrderInput { |
| | | userId?: string; |
| | | lifePayType?: LifeRechargeConstants.LifePayTypeEnum; |
| | | productData?: LifePhoneData; |
| | | } |
| | | |
| | |
| | | |
| | | export interface CreateLifePayOrderOutput { |
| | | orderNo?: string; |
| | | payUrl?: string; |
| | | } |
| | | |
| | | export interface LifeElectricDataCreateLifePayOrderInput { |
| | | userId?: string; |
| | | lifePayType?: LifeRechargeConstants.LifePayTypeEnum; |
| | | productData?: LifeElectricData; |
| | | } |
| | | |
| | |
| | | export interface APIgetPayStatusByOrderNoParams { |
| | | orderNo?: string; |
| | | } |
| | | |
| | | export interface SetLifePayOrderPayTypeInput { |
| | | orderNo: string; |
| | | lifePayType?: LifeRechargeConstants.LifePayTypeEnum; |
| | | } |
| | |
| | | const emit = defineEmits<{ |
| | | ( |
| | | e: 'goPay', |
| | | form: { |
| | | ispCode: typeof BlLifeRecharge.constants.IspCode; |
| | | phone: string; |
| | | parValue: number; |
| | | name: string; |
| | | } |
| | | // form: { |
| | | // ispCode: typeof BlLifeRecharge.constants.IspCode; |
| | | // phone: string; |
| | | // parValue: number; |
| | | // name: string; |
| | | // } |
| | | orderNo: string |
| | | ): void; |
| | | }>(); |
| | | |
| | |
| | | confirmDialogVisible.value = true; |
| | | } |
| | | |
| | | async function createLifePayPhoneOrder() { |
| | | async function goPay() { |
| | | try { |
| | | let params: LifePhoneDataCreateLifePayOrderInput = { |
| | | userId: blLifeRecharge.userId, |
| | | // lifePayType: 10, |
| | | productData: { |
| | | ispCode: form.ispCode, |
| | | parValue: 0.1, |
| | | phone: '18858418480', |
| | | phone: form.phone, |
| | | name: form.ispCode === BlLifeRecharge.constants.IspCode.dianxin ? form.name : '', |
| | | }, |
| | | }; |
| | | let res = await blLifeRecharge.services.createLifePayPhoneOrder(params); |
| | | emit('goPay', res.orderNo); |
| | | } catch (error) {} |
| | | } |
| | | |
| | | function goPay() { |
| | | emit('goPay'); |
| | | } |
| | | </script> |
| | |
| | | <script setup lang="ts"> |
| | | import IconWeixin from '../../../assets/icon-weixin-pay.png'; |
| | | import IconAliPay from '../../../assets/icon-alipay.png'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { |
| | | useLifeRechargeContext, |
| | | SetLifePayOrderPayTypeInput, |
| | | LifeRechargeConstants, |
| | | } from '../../utils'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | |
| | | defineOptions({ |
| | | name: 'SelectPayTypeView', |
| | |
| | | |
| | | // const props = withDefaults(defineProps<Props>(), {}); |
| | | |
| | | function handleAliPay() {} |
| | | const emit = defineEmits<{ |
| | | (e: 'paySuccess', id: number): void; |
| | | }>(); |
| | | |
| | | const router = Taro.useRouter(); |
| | | const orderNo = router.params?.orderNo ?? ''; |
| | | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | async function handleAliPay() { |
| | | try { |
| | | let res = await setLifePayOrderPayType(blLifeRecharge.constants.LifePayTypeEnum.AliPay); |
| | | if (res) { |
| | | location.href = res; |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function setLifePayOrderPayType(lifePayType: LifeRechargeConstants.LifePayTypeEnum) { |
| | | try { |
| | | let params: SetLifePayOrderPayTypeInput = { |
| | | orderNo: orderNo, |
| | | lifePayType: lifePayType, |
| | | }; |
| | | return await blLifeRecharge.services.setLifePayOrderPayType(params); |
| | | } catch (error) {} |
| | | } |
| | | |
| | | // useQuery({ |
| | | // queryKey: ['platformServicePayServices/getPlaformServicePayQRCode', orderNo], |
| | | // queryFn: async () => { |
| | | // return await blLifeRecharge.services.getPayStatusByOrderNo( |
| | | // { |
| | | // orderNo, |
| | | // }, |
| | | // { |
| | | // showLoading: false, |
| | | // } |
| | | // ); |
| | | // }, |
| | | // onSuccess(data) { |
| | | // if (data === blLifeRecharge.constants.LifePayStatusEnum.已支付) { |
| | | // } |
| | | // }, |
| | | // refetchInterval: 1000 * 3, |
| | | // }); |
| | | </script> |