From 914de3f2cb37768dc2d2a74b7a86514a46e5d025 Mon Sep 17 00:00:00 2001 From: YunaiV <> Date: Sun, 21 Apr 2019 02:17:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=20+=20=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=EF=BC=9A=E6=94=AF=E4=BB=98=E7=95=8C=E9=9D=A2~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile-web/src/page/pay/index.vue | 25 +++++++++++++++---- mobile-web/src/page/user/order/list.vue | 2 +- .../mall/pay/api/bo/PayTransactionBO.java | 3 ++- .../pay/api/bo/PayTransactionSubmitBO.java | 4 ++- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/mobile-web/src/page/pay/index.vue b/mobile-web/src/page/pay/index.vue index 7678f1327..dfbc95611 100644 --- a/mobile-web/src/page/pay/index.vue +++ b/mobile-web/src/page/pay/index.vue @@ -20,6 +20,7 @@ return { appId: this.$route.query.appId, orderId: this.$route.query.orderId, + returnUrl: this.$route.query.returnUrl, transaction: {}, } }, @@ -34,13 +35,27 @@ methods: { submit(payChannel) { let that = this; - debugger; submitTransaction(this.appId, this.orderId, payChannel).then(data => { pingpp.createPayment(data.invokeResponse, function(result, err) { - debugger; - console.log(result); - console.log(err.msg); - console.log(err.extra); + if (result === 'success') { + Dialog.alert({ + title: '系统提示', + message: '支付成功', + beforeClose: function (action, done) { + // 关闭弹窗 + done(); + // 跳转到我的优惠劵 + that.$router.push(decodeURI(that.returnUrl)); + } + }); + } else { + // console.log(err.msg); + // console.log(err.extra); + Dialog.alert({ + title: '系统提示', + message: '支付失败:' + err.msg, + }); + } }); }); } diff --git a/mobile-web/src/page/user/order/list.vue b/mobile-web/src/page/user/order/list.vue index a8505e3ff..c11a4abc8 100644 --- a/mobile-web/src/page/user/order/list.vue +++ b/mobile-web/src/page/user/order/list.vue @@ -63,7 +63,7 @@ }, methods: { goPay(itemId) { - this.$router.push('/pay?appId=POd4RC6a&orderId=' + itemId); + this.$router.push('/pay?appId=POd4RC6a&orderId=' + itemId + '&returnUrl=' + encodeURI('/user/order/info/' + itemId)); }, onTabChange(index) { diff --git a/pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/bo/PayTransactionBO.java b/pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/bo/PayTransactionBO.java index a1803089c..c48900d92 100644 --- a/pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/bo/PayTransactionBO.java +++ b/pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/bo/PayTransactionBO.java @@ -3,6 +3,7 @@ package cn.iocoder.mall.pay.api.bo; import lombok.Data; import lombok.experimental.Accessors; +import java.io.Serializable; import java.util.Date; /** @@ -10,7 +11,7 @@ import java.util.Date; */ @Data @Accessors(chain = true) -public class PayTransactionBO { +public class PayTransactionBO implements Serializable { /** * 编号,自增 diff --git a/pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/bo/PayTransactionSubmitBO.java b/pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/bo/PayTransactionSubmitBO.java index affad3d1e..6d2277533 100644 --- a/pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/bo/PayTransactionSubmitBO.java +++ b/pay/pay-service-api/src/main/java/cn/iocoder/mall/pay/api/bo/PayTransactionSubmitBO.java @@ -3,12 +3,14 @@ package cn.iocoder.mall.pay.api.bo; import lombok.Data; import lombok.experimental.Accessors; +import java.io.Serializable; + /** * 支付交易提交结果 BO */ @Data @Accessors(chain = true) -public class PayTransactionSubmitBO { +public class PayTransactionSubmitBO implements Serializable { /** * 支付交易拓展单编号