From d4d68c4aeca16a2403d43eb29c9e8b00875ac03e Mon Sep 17 00:00:00 2001 From: chen wei bo <1025839511@qq.com> Date: Thu, 11 Sep 2025 10:44:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scripts/chat18x/payment/PaymentService.ts | 1 + .../chat18x/ui/panels/PurchasePanel.ts | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/assets/Scripts/chat18x/payment/PaymentService.ts b/assets/Scripts/chat18x/payment/PaymentService.ts index 907e0ae3..5fc08385 100644 --- a/assets/Scripts/chat18x/payment/PaymentService.ts +++ b/assets/Scripts/chat18x/payment/PaymentService.ts @@ -35,6 +35,7 @@ export class PaymentService { async startPayment(req: proto.cs.ICSCreateOrderReq, open: OpenStrategy = "system"): Promise { // 下单 const create = await PaymentApi.I.createOrder(req); + console.log("创建订单的响应数据:", create); if (create.code !== proto.cs.EnmRetCode.SUCCESS || !create.data) { return { status: -1, retCode: -1 }; } diff --git a/assets/Scripts/chat18x/ui/panels/PurchasePanel.ts b/assets/Scripts/chat18x/ui/panels/PurchasePanel.ts index 1d287a30..4a63647b 100644 --- a/assets/Scripts/chat18x/ui/panels/PurchasePanel.ts +++ b/assets/Scripts/chat18x/ui/panels/PurchasePanel.ts @@ -13,6 +13,7 @@ import { WalletData } from "../../data/WalletData"; import { ShopData } from "../../data/ShopData"; import { GirlData } from "../../data/GirlData"; import { ShopService } from "db://assets/Scripts/chat18x/network/services/ShopService"; +import { PaymentService } from "db://assets/Scripts/chat18x/payment/PaymentService"; import proto from 'db://assets/Scripts/proto/proto.pb.js'; import GameRootUI from "../../../Main/Common/GameRootUI"; @@ -119,7 +120,12 @@ export class PurchasePanel extends li_BaseView { } setDiamondTag(id: number) { - this.reqBuyGood(id); + const shopData = DataManager.I.getDataById(DataId.Shop); + const isRechargeId = shopData.isRechargeId(id); + if (isRechargeId) { + // 需要外部支付进行购买 + this.startPayment(id); + } } getPlayerMerData() { @@ -174,6 +180,18 @@ export class PurchasePanel extends li_BaseView { } } + // 创建订单 + async startPayment(goodId: number) { + // 请求数据 + const reqData = { + goodId + }; + // let res = await PaymentService.I.startPayment(reqData); + // if (res) { + + // } + } + onDestroy() { Utils.removeInnerEL(InnerMsgCode.BalanceChange, this, () => {