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, () => {