前端 + 后端:支付界面~

This commit is contained in:
YunaiV 2019-04-21 02:17:48 +08:00
parent 0b35a92b01
commit 914de3f2cb
4 changed files with 26 additions and 8 deletions

View File

@ -20,6 +20,7 @@
return { return {
appId: this.$route.query.appId, appId: this.$route.query.appId,
orderId: this.$route.query.orderId, orderId: this.$route.query.orderId,
returnUrl: this.$route.query.returnUrl,
transaction: {}, transaction: {},
} }
}, },
@ -34,13 +35,27 @@
methods: { methods: {
submit(payChannel) { submit(payChannel) {
let that = this; let that = this;
debugger;
submitTransaction(this.appId, this.orderId, payChannel).then(data => { submitTransaction(this.appId, this.orderId, payChannel).then(data => {
pingpp.createPayment(data.invokeResponse, function(result, err) { pingpp.createPayment(data.invokeResponse, function(result, err) {
debugger; if (result === 'success') {
console.log(result); Dialog.alert({
console.log(err.msg); title: '系统提示',
console.log(err.extra); 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,
});
}
}); });
}); });
} }

View File

@ -63,7 +63,7 @@
}, },
methods: { methods: {
goPay(itemId) { 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) { onTabChange(index) {

View File

@ -3,6 +3,7 @@ package cn.iocoder.mall.pay.api.bo;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
@ -10,7 +11,7 @@ import java.util.Date;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class PayTransactionBO { public class PayTransactionBO implements Serializable {
/** /**
* 编号自增 * 编号自增

View File

@ -3,12 +3,14 @@ package cn.iocoder.mall.pay.api.bo;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
/** /**
* 支付交易提交结果 BO * 支付交易提交结果 BO
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class PayTransactionSubmitBO { public class PayTransactionSubmitBO implements Serializable {
/** /**
* 支付交易拓展单编号 * 支付交易拓展单编号