支付相关
This commit is contained in:
@@ -35,6 +35,7 @@ export class PaymentService {
|
|||||||
async startPayment(req: proto.cs.ICSCreateOrderReq, open: OpenStrategy = "system"): Promise<proto.cs.ICSQueryOrderRes | null> {
|
async startPayment(req: proto.cs.ICSCreateOrderReq, open: OpenStrategy = "system"): Promise<proto.cs.ICSQueryOrderRes | null> {
|
||||||
// 下单
|
// 下单
|
||||||
const create = await PaymentApi.I.createOrder(req);
|
const create = await PaymentApi.I.createOrder(req);
|
||||||
|
console.log("创建订单的响应数据:", create);
|
||||||
if (create.code !== proto.cs.EnmRetCode.SUCCESS || !create.data) {
|
if (create.code !== proto.cs.EnmRetCode.SUCCESS || !create.data) {
|
||||||
return { status: -1, retCode: -1 };
|
return { status: -1, retCode: -1 };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { WalletData } from "../../data/WalletData";
|
|||||||
import { ShopData } from "../../data/ShopData";
|
import { ShopData } from "../../data/ShopData";
|
||||||
import { GirlData } from "../../data/GirlData";
|
import { GirlData } from "../../data/GirlData";
|
||||||
import { ShopService } from "db://assets/Scripts/chat18x/network/services/ShopService";
|
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 proto from 'db://assets/Scripts/proto/proto.pb.js';
|
||||||
import GameRootUI from "../../../Main/Common/GameRootUI";
|
import GameRootUI from "../../../Main/Common/GameRootUI";
|
||||||
|
|
||||||
@@ -119,7 +120,12 @@ export class PurchasePanel extends li_BaseView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setDiamondTag(id: number) {
|
setDiamondTag(id: number) {
|
||||||
this.reqBuyGood(id);
|
const shopData = DataManager.I.getDataById<ShopData>(DataId.Shop);
|
||||||
|
const isRechargeId = shopData.isRechargeId(id);
|
||||||
|
if (isRechargeId) {
|
||||||
|
// 需要外部支付进行购买
|
||||||
|
this.startPayment(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getPlayerMerData() {
|
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() {
|
onDestroy() {
|
||||||
Utils.removeInnerEL(InnerMsgCode.BalanceChange, this, () => {
|
Utils.removeInnerEL(InnerMsgCode.BalanceChange, this, () => {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user