Compare commits
No commits in common. "36924eed8a157da1a8e733c09ffa34484bbbb888" and "30d02b25856acb19a5af3316c6dbec21660b7c21" have entirely different histories.
36924eed8a
...
30d02b2585
|
@ -198,8 +198,9 @@ export default class JiaZai extends cc.Component {
|
||||||
if (cc.fx.GameConfig.GM_INFO.hp < 5) {
|
if (cc.fx.GameConfig.GM_INFO.hp < 5) {
|
||||||
this.startHeathTimeCutDown(timeNode);
|
this.startHeathTimeCutDown(timeNode);
|
||||||
}
|
}
|
||||||
if (cc.fx.GameConfig.GM_INFO.hp == 0 && cc.fx.GameConfig.GM_INFO.userPowerTime == 0) {
|
if (cc.fx.GameConfig.GM_INFO.hp == 0) {
|
||||||
// 体力为0,显示spriteFrames[1],只显示第二个按钮
|
// 体力为0,显示spriteFrames[1],只显示第二个按钮
|
||||||
|
|
||||||
if (switchButtons[0]) { switchButtons[0].active = false; swichs[0].active = false; }
|
if (switchButtons[0]) { switchButtons[0].active = false; swichs[0].active = false; }
|
||||||
if (switchButtons[1]) { switchButtons[1].active = true; swichs[1].active = true; }
|
if (switchButtons[1]) { switchButtons[1].active = true; swichs[1].active = true; }
|
||||||
} else if (cc.fx.GameConfig.GM_INFO.hp < 5 && cc.fx.GameConfig.GM_INFO.hp > 0) {
|
} else if (cc.fx.GameConfig.GM_INFO.hp < 5 && cc.fx.GameConfig.GM_INFO.hp > 0) {
|
||||||
|
|
|
@ -384,126 +384,128 @@ export default class NewClass extends cc.Component {
|
||||||
type: systemType,
|
type: systemType,
|
||||||
}
|
}
|
||||||
cc.fx.GameTool.shushu_Track("init_order", data);
|
cc.fx.GameTool.shushu_Track("init_order", data);
|
||||||
this.openLoad();
|
|
||||||
//console.log("7.14_____________________", "调用充值接口");
|
|
||||||
Utils.buyProp(id, count, price, (res) => {
|
|
||||||
//console.log("获得充值结果", res);
|
|
||||||
if (res == null) {
|
|
||||||
MiniGameSdk.API.showToast("充值失败");
|
|
||||||
this.btn_Touch = true;
|
|
||||||
const dataFail = {
|
|
||||||
outTradeNo: Utils.outTradeNo,
|
|
||||||
price: price,
|
|
||||||
payment_name: productId,
|
|
||||||
payment_num: 1,
|
|
||||||
type: systemType,
|
|
||||||
fail_reason: "网络异常,没有拉起支付",
|
|
||||||
}
|
|
||||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
|
|
||||||
this.closeLoad();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (res.err) {
|
|
||||||
MiniGameSdk.API.showToast("充值失败");
|
|
||||||
//console.log(res);
|
|
||||||
this.btn_Touch = true;
|
|
||||||
let name = "支付拉起失败";
|
|
||||||
if (res.errCode == -2) {
|
|
||||||
name = "用户取消充值";
|
|
||||||
}
|
|
||||||
const dataFail = {
|
|
||||||
outTradeNo: Utils.outTradeNo,
|
|
||||||
price: price,
|
|
||||||
payment_name: productId,
|
|
||||||
payment_num: 1,
|
|
||||||
type: systemType,
|
|
||||||
fail_reason: name,
|
|
||||||
}
|
|
||||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
|
|
||||||
this.closeLoad();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Utils.getPayInfo((data) => {
|
|
||||||
//console.log("7.14_______________充值成功,准备轮训");
|
|
||||||
//console.log("获得轮训结果:", data);
|
|
||||||
this.closeLoad();
|
|
||||||
if (data.data.pay_state == 1) {
|
|
||||||
this.btn_Touch = true;
|
|
||||||
MiniGameSdk.API.showToast("取消充值");
|
|
||||||
const dataFail2 = {
|
|
||||||
outTradeNo: Utils.outTradeNo,
|
|
||||||
price: price,
|
|
||||||
payment_name: productId,
|
|
||||||
payment_num: 1,
|
|
||||||
type: systemType,
|
|
||||||
fail_reason: "用户取消支付",
|
|
||||||
}
|
|
||||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail2);
|
|
||||||
}
|
|
||||||
else if (data.data.pay_state == 2) {
|
|
||||||
this.btn_Touch = true;
|
|
||||||
const dataSuccess = {
|
|
||||||
outTradeNo: Utils.outTradeNo,
|
|
||||||
price: price,
|
|
||||||
payment_name: productId,
|
|
||||||
payment_num: 1,
|
|
||||||
type: systemType,
|
|
||||||
}
|
|
||||||
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
|
|
||||||
let name = "购买金币道具:" + productId;
|
|
||||||
MiniGameSdk.API.yinli_Pay(price, Utils.outTradeNo, name)
|
|
||||||
//console.log("7.14_______________充值成功,轮训成功,准备发货");
|
|
||||||
Utils.setPayInfo(
|
|
||||||
(res) => {
|
|
||||||
//console.log("设置轮训结果:", res);
|
|
||||||
if (res.code === 1) {
|
|
||||||
//console.log("7.14_________正式发货");
|
|
||||||
MiniGameSdk.API.showToast("充值成功");
|
MiniGameSdk.API.showToast("充值成功");
|
||||||
cc.fx.GameTool.shopBuy(productId);
|
cc.fx.GameTool.shopBuy(productId);
|
||||||
//console.log("充值成功获得金币");
|
// this.openLoad();
|
||||||
}
|
//console.log("7.14_____________________", "调用充值接口");
|
||||||
else {
|
// Utils.buyProp(id, count, price, (res) => {
|
||||||
MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
|
// //console.log("获得充值结果", res);
|
||||||
const dataFail4 = {
|
// if (res == null) {
|
||||||
outTradeNo: Utils.outTradeNo,
|
// MiniGameSdk.API.showToast("充值失败");
|
||||||
price: price,
|
// this.btn_Touch = true;
|
||||||
payment_name: productId,
|
// const dataFail = {
|
||||||
payment_num: 1,
|
// outTradeNo: Utils.outTradeNo,
|
||||||
type: systemType,
|
// price: price,
|
||||||
fail_reason: "成功付款,但是发货时请求服务器失败,充值成功未发货",
|
// payment_name: productId,
|
||||||
}
|
// payment_num: 1,
|
||||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail4);
|
// type: systemType,
|
||||||
}
|
// fail_reason: "网络异常,没有拉起支付",
|
||||||
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
|
// }
|
||||||
if (this.node.parent.getComponent("JiaZai"))
|
// cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
|
||||||
this.node.parent.getComponent("JiaZai").updateCoin();
|
// this.closeLoad();
|
||||||
else if (this.node.parent.getComponent("SceneManager")) {
|
// return;
|
||||||
this.node.parent.getComponent("SceneManager").updateCoin();
|
// }
|
||||||
}
|
// else if (res.err) {
|
||||||
}, null)
|
// MiniGameSdk.API.showToast("充值失败");
|
||||||
}
|
// //console.log(res);
|
||||||
else {
|
// this.btn_Touch = true;
|
||||||
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
|
// let name = "支付拉起失败";
|
||||||
const dataFail3 = {
|
// if (res.errCode == -2) {
|
||||||
outTradeNo: Utils.outTradeNo,
|
// name = "用户取消充值";
|
||||||
price: price,
|
// }
|
||||||
payment_name: productId,
|
// const dataFail = {
|
||||||
payment_num: 1,
|
// outTradeNo: Utils.outTradeNo,
|
||||||
type: systemType,
|
// price: price,
|
||||||
fail_reason: "拉起支付后,付款时网络异常付款失败",
|
// payment_name: productId,
|
||||||
}
|
// payment_num: 1,
|
||||||
cc.fx.GameTool.shushu_Track("payment_fail", dataFail3);
|
// type: systemType,
|
||||||
this.btn_Touch = true;
|
// fail_reason: name,
|
||||||
if (this.node.parent.getComponent("JiaZai"))
|
// }
|
||||||
this.node.parent.getComponent("JiaZai").updateCoin();
|
// cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
|
||||||
else if (this.node.parent.getComponent("SceneManager")) {
|
// this.closeLoad();
|
||||||
this.node.parent.getComponent("SceneManager").updateCoin();
|
// return;
|
||||||
}
|
// }
|
||||||
}
|
// else {
|
||||||
})
|
// Utils.getPayInfo((data) => {
|
||||||
}
|
// //console.log("7.14_______________充值成功,准备轮训");
|
||||||
});
|
// //console.log("获得轮训结果:", data);
|
||||||
|
// this.closeLoad();
|
||||||
|
// if (data.data.pay_state == 1) {
|
||||||
|
// this.btn_Touch = true;
|
||||||
|
// MiniGameSdk.API.showToast("取消充值");
|
||||||
|
// const dataFail2 = {
|
||||||
|
// outTradeNo: Utils.outTradeNo,
|
||||||
|
// price: price,
|
||||||
|
// payment_name: productId,
|
||||||
|
// payment_num: 1,
|
||||||
|
// type: systemType,
|
||||||
|
// fail_reason: "用户取消支付",
|
||||||
|
// }
|
||||||
|
// cc.fx.GameTool.shushu_Track("payment_fail", dataFail2);
|
||||||
|
// }
|
||||||
|
// else if (data.data.pay_state == 2) {
|
||||||
|
// this.btn_Touch = true;
|
||||||
|
// const dataSuccess = {
|
||||||
|
// outTradeNo: Utils.outTradeNo,
|
||||||
|
// price: price,
|
||||||
|
// payment_name: productId,
|
||||||
|
// payment_num: 1,
|
||||||
|
// type: systemType,
|
||||||
|
// }
|
||||||
|
// cc.fx.GameTool.shushu_Track("payment", dataSuccess);
|
||||||
|
// let name = "购买金币道具:" + productId;
|
||||||
|
// MiniGameSdk.API.yinli_Pay(price, Utils.outTradeNo, name)
|
||||||
|
// //console.log("7.14_______________充值成功,轮训成功,准备发货");
|
||||||
|
// Utils.setPayInfo(
|
||||||
|
// (res) => {
|
||||||
|
// //console.log("设置轮训结果:", res);
|
||||||
|
// if (res.code === 1) {
|
||||||
|
// //console.log("7.14_________正式发货");
|
||||||
|
// MiniGameSdk.API.showToast("充值成功");
|
||||||
|
// cc.fx.GameTool.shopBuy(productId);
|
||||||
|
// //console.log("充值成功获得金币");
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
|
||||||
|
// const dataFail4 = {
|
||||||
|
// outTradeNo: Utils.outTradeNo,
|
||||||
|
// price: price,
|
||||||
|
// payment_name: productId,
|
||||||
|
// payment_num: 1,
|
||||||
|
// type: systemType,
|
||||||
|
// fail_reason: "成功付款,但是发货时请求服务器失败,充值成功未发货",
|
||||||
|
// }
|
||||||
|
// cc.fx.GameTool.shushu_Track("payment_fail", dataFail4);
|
||||||
|
// }
|
||||||
|
// NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
|
||||||
|
// if (this.node.parent.getComponent("JiaZai"))
|
||||||
|
// this.node.parent.getComponent("JiaZai").updateCoin();
|
||||||
|
// else if (this.node.parent.getComponent("SceneManager")) {
|
||||||
|
// this.node.parent.getComponent("SceneManager").updateCoin();
|
||||||
|
// }
|
||||||
|
// }, null)
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
|
||||||
|
// const dataFail3 = {
|
||||||
|
// outTradeNo: Utils.outTradeNo,
|
||||||
|
// price: price,
|
||||||
|
// payment_name: productId,
|
||||||
|
// payment_num: 1,
|
||||||
|
// type: systemType,
|
||||||
|
// fail_reason: "拉起支付后,付款时网络异常付款失败",
|
||||||
|
// }
|
||||||
|
// cc.fx.GameTool.shushu_Track("payment_fail", dataFail3);
|
||||||
|
// this.btn_Touch = true;
|
||||||
|
// if (this.node.parent.getComponent("JiaZai"))
|
||||||
|
// this.node.parent.getComponent("JiaZai").updateCoin();
|
||||||
|
// else if (this.node.parent.getComponent("SceneManager")) {
|
||||||
|
// this.node.parent.getComponent("SceneManager").updateCoin();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user