Commit cf7acf34e93d77a612ae2333b44f178bdea055bc
1 parent
4912d9bb
安卓支付回调后检测是否已支付
Showing
1 changed file
with
37 additions
and
5 deletions
src/pages/myGiftBox/myGiftBox.vue
| @@ -537,12 +537,44 @@ export default { | @@ -537,12 +537,44 @@ export default { | ||
| 537 | }, | 537 | }, |
| 538 | // 安卓支付成功回调 | 538 | // 安卓支付成功回调 |
| 539 | payFinish() { | 539 | payFinish() { |
| 540 | - // 取消订单 | ||
| 541 | - if (this.orderOperation.item.status == "0") { | ||
| 542 | - // status=1(已支付可分享状态) | ||
| 543 | - this.$set(this.orderOperation.item, "status", "1"); | 540 | + // 检测是否已支付 |
| 541 | + this.cancelorder(this.orderOperation.item) | ||
| 542 | + }, | ||
| 543 | + // 安卓调用支付后检测是否已支付 | ||
| 544 | + cancelorder(item) { | ||
| 545 | + // 加载中提示 | ||
| 546 | + Indicator.open("加载中..."); | ||
| 547 | + | ||
| 548 | + // 获取送礼礼物列表接口 | ||
| 549 | + this.http( | ||
| 550 | + "/Api/" + this.getApiVersion().index + "/isOrderPay", | ||
| 551 | + { | ||
| 552 | + orderId: item.orderid, // 订单编号 | ||
| 553 | + }, | ||
| 554 | + this.cancelorderCallback, | ||
| 555 | + { | ||
| 556 | + method: "post", | ||
| 557 | + item | ||
| 558 | + } | ||
| 559 | + ); | ||
| 560 | + }, | ||
| 561 | + /** | ||
| 562 | + * 取消订单回调获取取消原因数据 | ||
| 563 | + * @param {object} res [服务器返回数据] | ||
| 564 | + * @param {object} ext [扩展参数] | ||
| 565 | + */ | ||
| 566 | + cancelorderCallback(res, ext) { | ||
| 567 | + // 加载完成 | ||
| 568 | + Indicator.close(); | ||
| 569 | + // 返回处理 | ||
| 570 | + if (res.code == 200) { | ||
| 571 | + // 订单支付成功 | ||
| 572 | + if (ext.item.status == "0") { | ||
| 573 | + // status=3(订单已经关闭) | ||
| 574 | + this.$set(ext.item, "status", "1"); | ||
| 575 | + } | ||
| 544 | } | 576 | } |
| 545 | - } | 577 | + }, |
| 546 | } | 578 | } |
| 547 | }; | 579 | }; |
| 548 | </script> | 580 | </script> |