From f2025539d8bf4798b90a5ab8a47c5a379ab68e9b Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期二, 11 三月 2025 17:51:43 +0800 Subject: [PATCH] fix: 二期需求 --- packages/core/src/lifeRecharge.ts | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/core/src/lifeRecharge.ts b/packages/core/src/lifeRecharge.ts index a041d82..aa8c8e6 100644 --- a/packages/core/src/lifeRecharge.ts +++ b/packages/core/src/lifeRecharge.ts @@ -3,18 +3,18 @@ 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>) { + constructor(options: BlLifeRechargeOptions<TResponse, TRequestOptions>) { this.services = new BlLifeRechargeServices(options); this.accountModel = new BlLifeRechargeAccountModel({ userId: options.userId, @@ -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