Commit 8fa11ab8 authored by liujiangnan's avatar liujiangnan

feat: 异常订单恢复

parent 499c8907
...@@ -719,14 +719,21 @@ export default class NewClass extends middleLayerBase { ...@@ -719,14 +719,21 @@ export default class NewClass extends middleLayerBase {
// 处理苹果支付的异常回调 // 处理苹果支付的异常回调
(<any>window).air.startBuyToAppStoreCallBack = async (res) => { (<any>window).air.startBuyToAppStoreCallBack = async (res) => {
cc.find(`middleLayer/exception_pay_win`).active = true;
if (typeof (res) == 'string') { if (typeof (res) == 'string') {
res = JSON.parse(res); res = JSON.parse(res);
} }
await this.asyncCallNetworkApiPost(`/v1/paid/ios/order/save`, { const orderData = await this.asyncCallNetworkApiPost(`/v1/paid/ios/order/save`, {
productid: res.productid, productid: res.productid,
puid: res.puid, puid: res.puid,
iospaidcode: res.receiptData iospaidcode: res.receiptData
}); });
if (orderData.code!=200) {
cc.find(`middleLayer/exception_pay_win/buy_status_text`).getComponent(cc.Label).string = `支付失败[${orderData.code}]\n请联系客服`;
return;
}
cc.find(`middleLayer/exception_pay_win/buy_status_text`).getComponent(cc.Label).string = `购买成功!\n快去探索绘玩绘拼自然拼读世界吧!`;
cc.find(`middleLayer/exception_pay_win/active_btn`).active = true;
} }
this.showWaitingLetters(); this.showWaitingLetters();
...@@ -934,6 +941,13 @@ export default class NewClass extends middleLayerBase { ...@@ -934,6 +941,13 @@ export default class NewClass extends middleLayerBase {
this.loadOnlineBundle('NJ_YouLeChang'); this.loadOnlineBundle('NJ_YouLeChang');
}); });
buttonOnClick(cc.find(`middleLayer/exception_pay_win/active_btn`), (btn) => {
cc.find(`middleLayer/exception_pay_win`).active = false;
cc.find(`middleLayer/exception_pay_win/buy_status_text`).getComponent(cc.Label).string = "正在处理支付订单\n请勿关闭App";
btn.active = false;
this.loadOnlineBundle('NJ_YouLeChang');
});
}; };
......
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