| | |
| | | <template> |
| | | <PageLayout title="话费充值" class="selectPayType-page-wrapper" hasBorder> |
| | | <PageLayout :title="TitleText[lifePayOrderType]" class="selectPayType-page-wrapper" hasBorder> |
| | | <InnerPage /> |
| | | </PageLayout> |
| | | </template> |
| | |
| | | <script setup lang="ts"> |
| | | import { PageLayout } from '@/components'; |
| | | import InnerPage from './InnerPage.vue'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { LifeRechargeConstants } from '@life-payment/core-vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'selectPayType', |
| | | }); |
| | | |
| | | const router = Taro.useRouter(); |
| | | const lifePayOrderType = Number(router.params?.lifePayOrderType ?? ''); |
| | | const TitleText = { |
| | | [LifeRechargeConstants.LifePayOrderTypeEnum.话费订单]: '话费充值', |
| | | [LifeRechargeConstants.LifePayOrderTypeEnum.电费订单]: '电费充值', |
| | | }; |
| | | </script> |
| | |
| | | |
| | | |
| | | ## [0.0.9](http://120.26.58.240:8888/r/LifePaymentFront/compare/components/v0.0.8...components/v0.0.9) (2025-03-10) |
| | | |
| | | |
| | | ### Bug Fixes |
| | | |
| | | * 二期需求 ([5dd9eb5](http://120.26.58.240:8888/r/LifePaymentFront/commits/5dd9eb5d8a69fa8c2b66706434a6cc7748ff4786)) |
| | | |
| | | ## [0.0.8](http://120.26.58.240:8888/r/LifePaymentFront/compare/components/v0.0.7...components/v0.0.8) (2025-03-10) |
| | | |
| | | |
| | | ### Bug Fixes |
| | | |
| | | * 二期需求 ([6bc53a7](http://120.26.58.240:8888/r/LifePaymentFront/commits/6bc53a7251d5a323475757358d00ff051f166497)) |
| | | * some ([c4db0ed](http://120.26.58.240:8888/r/LifePaymentFront/commits/c4db0ed5c4218dba29c9924511dc2bbcf169d468)) |
| | | |
| | | ## [0.0.7](http://120.26.58.240:8888/r/LifePaymentFront/compare/components/v0.0.6...components/v0.0.7) (2025-03-10) |
| | | |
| | | |
| | |
| | | "main": "src/index.ts", |
| | | "module": "./src/index.ts", |
| | | "source": "./src/index.ts", |
| | | "version": "0.0.7", |
| | | "version": "0.0.9", |
| | | "scripts": { |
| | | "clean": "rimraf dist", |
| | | "build": "pnpm run clean && vite build", |
| | |
| | | return await blLifeRecharge.services.getPhoneParValue({ showLoading: false }); |
| | | }, |
| | | select(data) { |
| | | return data.phoneParValue ?? []; |
| | | return data?.phoneParValue ?? []; |
| | | }, |
| | | placeholderData: () => ({} as PhoneParValueResponse), |
| | | }); |
| | |
| | | state.msg = '请在微信中打开'; |
| | | state.show = true; |
| | | } |
| | | } else if (Taro.getEnv() === Taro.ENV_TYPE.WEAPP) { |
| | | handleWeixinPayByMini(); |
| | | } |
| | | } |
| | | |
| | | async function handleWeixinPayByJsApi() { |
| | | async function getPayOrderForJsAPI() { |
| | | try { |
| | | let params: GetPayOrderForJsAPIInput = { |
| | | orderNo: props.orderNo, |
| | | lifePayType: blLifeRecharge.constants.LifePayTypeEnum.WxPay, |
| | | openId: props.openId, |
| | | attach: Date.now().toString(), |
| | | payAppId: props.appId, |
| | | }; |
| | | let res = await blLifeRecharge.services.getPayOrderForJsAPI(params); |
| | | return res; |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function handleWeixinPayByJsApi() { |
| | | try { |
| | | let res = await getPayOrderForJsAPI(); |
| | | |
| | | if (res) { |
| | | //@ts-ignore |
| | |
| | | } |
| | | } |
| | | ); |
| | | } else if (Taro.getEnv() === Taro.ENV_TYPE.WEAPP) { |
| | | Taro.requestPayment({ |
| | | timeStamp: res.timestamp, |
| | | nonceStr: res.nonceStr, |
| | | package: res.package, |
| | | signType: res.signType as any, |
| | | paySign: res.paySign, |
| | | success: function (res) { |
| | | console.log('res: ', res); |
| | | // if(res.errMsg) |
| | | }, |
| | | fail: function (res) {}, |
| | | }); |
| | | } |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function handleWeixinPayByMini() { |
| | | try { |
| | | let res = await getPayOrderForJsAPI(); |
| | | |
| | | if (res) { |
| | | Taro.requestPayment({ |
| | | timeStamp: res.timestamp, |
| | | nonceStr: res.nonceStr, |
| | | package: res.package, |
| | | signType: res.signType as any, |
| | | paySign: res.paySign, |
| | | success: function (res) { |
| | | console.log('res: ', res); |
| | | // if(res.errMsg) |
| | | }, |
| | | fail: function (res) {}, |
| | | }); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function setLifePayOrderPayType(lifePayType: LifeRechargeConstants.LifePayTypeEnum) { |
| | | try { |
| | | let params: SetLifePayOrderPayTypeInput = { |
| | |
| | | lifePayType?: LifeRechargeConstants.LifePayTypeEnum; |
| | | openId?: string; |
| | | attach?: string; |
| | | payAppId?: string; |
| | | } |
| | | |
| | | export interface ModelPaymentMiniPay { |
| | |
| | | |
| | | /** life pay手机验证码登录 POST /api/Account/LifePayPhoneMesssageCodeLogin */ |
| | | export async function lifePayPhoneMesssageCodeLogin( |
| | | body: API.PhoneMesssageCodeLoginInput, |
| | | body: API.LifePayPhoneMesssageCodeLoginInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<string>('/api/Account/LifePayPhoneMesssageCodeLogin', { |
| | |
| | | body: API.GetPayOrderForJsAPIInput, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.ModelPayPrePayId>('/api/LifePay/GetPayOrderForJsAPI', { |
| | | return request<API.ModelPaymentMiniPay>('/api/LifePay/GetPayOrderForJsAPI', { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | |
| | | interface ElectricSupportAreaChildCityListOutput { |
| | | cityName?: string; |
| | | cityParentId?: string; |
| | | ciytId?: string; |
| | | cityId?: string; |
| | | } |
| | | |
| | | interface ElectricSupportAreaListOutput { |
| | | childCityList?: ElectricSupportAreaChildCityListOutput[]; |
| | | cityName?: string; |
| | | cityParentId?: string; |
| | | ciytId?: string; |
| | | cityId?: string; |
| | | electricType?: string; |
| | | parValue?: string[]; |
| | | rate?: number; |
| | |
| | | lifePayType?: LifePayTypeEnum; |
| | | openId?: string; |
| | | attach?: string; |
| | | payAppId?: string; |
| | | } |
| | | |
| | | interface GetPermissionListResultDto { |
| | |
| | | |
| | | type LifePayOrderTypeEnum = 10 | 20; |
| | | |
| | | interface LifePayPhoneMesssageCodeLoginInput { |
| | | /** 手机号 */ |
| | | phoneNumber: string; |
| | | } |
| | | |
| | | interface LifePayRateListOutput { |
| | | rateType?: LifePayRateTypeEnum; |
| | | rate?: number; |
| | |
| | | defaultValue?: any; |
| | | } |
| | | |
| | | interface ModelPayPrePayId { |
| | | prepayId?: string; |
| | | code?: string; |
| | | interface ModelPaymentMiniPay { |
| | | nonceStr?: string; |
| | | package?: string; |
| | | signType?: string; |
| | | paySign?: string; |
| | | timestamp?: string; |
| | | timeExpire?: string; |
| | | message?: string; |
| | | } |
| | | |