From db365a5eff31c040c42463df4966bf34a5de6a6d Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期三, 12 三月 2025 15:00:42 +0800 Subject: [PATCH] fix: 二期需求 --- packages/core/src/lifeRecharge.ts | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/core/src/lifeRecharge.ts b/packages/core/src/lifeRecharge.ts index a041d82..87b10eb 100644 --- a/packages/core/src/lifeRecharge.ts +++ b/packages/core/src/lifeRecharge.ts @@ -3,19 +3,19 @@ PhoneMesssageCodeLoginInput, RequestConfig, } from './lifeRechargeServices'; -import { IRequest, BlLifeRechargeOptions } from './types'; +import { BlLifeRechargeOptions } from './types'; import { LifeRechargeConstants } from './lifeRechargeConstants'; import { BlLifeRechargeAccountModel } from './lifeRechargeAccountModel'; -export class BlLifeRecharge<T extends IRequest = IRequest> { - services: BlLifeRechargeServices<T>; +export class BlLifeRecharge<TResponse = any, TRequestOptions = any> { + services: BlLifeRechargeServices<TResponse, TRequestOptions>; accountModel: BlLifeRechargeAccountModel; static constants = LifeRechargeConstants; constants = LifeRechargeConstants; - constructor(options: BlLifeRechargeOptions<T>) { - this.services = new BlLifeRechargeServices(options); + constructor(options: BlLifeRechargeOptions<TResponse, TRequestOptions>) { + this.services = new BlLifeRechargeServices(this, options); this.accountModel = new BlLifeRechargeAccountModel({ userId: options.userId, phoneNumber: options.phoneNumber, @@ -43,6 +43,12 @@ } getRechargeParValue(amount: number | string, rate: number) { - return (Number(amount) * rate).toFixed(2); + return ((Number(amount) * rate) / 100).toFixed(2); + } + + MaxParValue = 300; + + filterParValueList(parValueList: string[]) { + return parValueList.filter((x) => Number(x) <= this.MaxParValue); } } -- Gitblit v1.9.1