Commit d46334f8 authored by liujiangnan's avatar liujiangnan

feat: 支付失败的处理

parent eb614c2c
......@@ -319,7 +319,7 @@ export function initAir(_this) {
} else if (method == 'stopRecord') {
window.air.recordCallBack(recordMockData);
} else if (method == 'startBuyToAppStore') {
window.air.startBuyToAppStoreCallBack({productid: 1, puid: 22, receiptData: "HelloWorld"});
window.air.startBuyToAppStoreCallBack({productid: 1, puid: 22, receiptData: "HelloWorld", error: ""});
} else{
console.error(`${method}方法还没有Mock数据,请联系技术支持人员添加`);
}
......
......@@ -135,6 +135,20 @@ export default class NewClass extends middleLayerBase {
if (typeof (res) == 'string') {
res = JSON.parse(res);
}
if (res.error) {
cc.find(`buy_status_text`, statusWin).getComponent(cc.Label).string = `支付失败`;
cc.find(`buy_status_sub_text`, statusWin).getComponent(cc.Label).string = res.error;
cc.find(`buy_status_sub_text`, statusWin).active = true;
setTimeout(() => {
cc.find(`buy_status_text`, statusWin).getComponent(cc.Label).string = "";
cc.find(`buy_status_sub_text`, statusWin).getComponent(cc.Label).string = "";
cc.find(`buy_status_sub_text`, statusWin).active = false;
statusWin.active = false;
cc.find(`middleLayer/iosActiveLayer/buyloading`).active = false;
}, 2000);
return;
}
const orderData:any = await this.asyncCallNetworkApiPost(`/api/oxford/v1/paid/ios/order/save`, {
productid: res.productid,
puid: res.puid,
......@@ -724,6 +738,14 @@ export default class NewClass extends middleLayerBase {
if (typeof (res) == 'string') {
res = JSON.parse(res);
}
if (res.error) {
cc.find(`middleLayer/exception_pay_win/buy_status_text`).getComponent(cc.Label).string = `支付失败\n${res.error}`;
setTimeout(() => {
cc.find(`middleLayer/exception_pay_win`).active = false;
cc.find(`middleLayer/exception_pay_win/buy_status_text`).getComponent(cc.Label).string = "正在处理支付订单\n请勿关闭App";
}, 2000);
return;
}
const orderData = await this.asyncCallNetworkApiPost(`/api/oxford/v1/paid/ios/order/save`, {
productid: res.productid,
puid: res.puid,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment