|
|
@@ -1097,6 +1097,11 @@ cc.Class({
|
|
|
callback(res, vaule);
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ //用cnt购买种子,种子的payType类型是 4
|
|
|
+ onBuySeedsWithCNT(cntAmount,seedId,callback){
|
|
|
+ this.payCNT(cntAmount, 4, seedId, callback);
|
|
|
+ },
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -1118,11 +1123,20 @@ cc.Class({
|
|
|
}, this);
|
|
|
return;
|
|
|
}
|
|
|
+ gameToast.getInstance().show(cc.find("Canvas/UICamera"), "支付处理中...", 10, () => {
|
|
|
+ console.log("finish toast!");
|
|
|
+ }, this);
|
|
|
+
|
|
|
GlobalD.dapp.payCnt(cntAmount, payType, itemType).then((data) => {
|
|
|
const [err, tx] = data;
|
|
|
if (err === null) {
|
|
|
// TODO 成功, 支付为链上操作,需要提供回调接口给这边服务端确认交易成功后修改购买订单结果
|
|
|
console.log(tx) // 交易hash,唯一标识符
|
|
|
+
|
|
|
+ gameToast.getInstance().hide(this);
|
|
|
+ gameToast.getInstance().show(cc.find("Canvas/UICamera"), "支付成功!", 10, () => {
|
|
|
+ console.log("finish toast!");
|
|
|
+ }, this);
|
|
|
} else {
|
|
|
console.log(err)
|
|
|
}
|