修复:点击web3的充值档位多打开了一个空白网页

This commit is contained in:
chen wei bo
2025-10-13 18:31:51 +08:00
parent 76e9d8f1a1
commit 5a4ce9dd1c
2 changed files with 16 additions and 1 deletions
@@ -50,6 +50,7 @@ export class PaymentService {
Utils.sendInnerMsg(InnerMsgCode.PayOrderCreateSucc, { orderId: orderId, payType: req.payType,goodId:req.goodId });
// 分发流程
logger.log("选择支付分发流程:", payMethod);
const flow = this.flowMap.get(payMethod);
return flow?.run(orderId, payUrl, open) ?? null;
}
@@ -178,6 +178,20 @@ export class PurchasePanel extends li_BaseView {
}
}
// 获取支付方式
getPaymentMethod(): PaymentMethod {
if (this.currentPayType === proto.cs.EnmPayType.EPT_Cash_INR) {
// 现金支付
return PaymentMethod.CashPay;
} else if (this.currentPayType === proto.cs.EnmPayType.EPT_WEB3_USD) {
// Web3支付
return PaymentMethod.Web3;
} else {
// Web3支付
return PaymentMethod.Web3;
}
}
purchaseGood(id: number, networkType: proto.cs.EnmNetworkType) {
const shopData = DataManager.I.getDataById<ShopData>(DataId.Shop);
const isRechargeId = shopData.isRechargeId(id);
@@ -187,7 +201,7 @@ export class PurchasePanel extends li_BaseView {
id,
this.currentPayType,
networkType,
PaymentMethod.CashPay
this.getPaymentMethod()
);
}
//测试用