fix[litemall-wx, litemall-wx-api]: 修复订单详情里面的支付问题。
This commit is contained in:
@@ -500,9 +500,6 @@ public class WxOrderController {
|
||||
return ResponseUtil.fail(403, "订单不能支付");
|
||||
}
|
||||
|
||||
order.setOrderStatus(OrderUtil.STATUS_PAY);
|
||||
// 0 初始,1 预支付,2 支付成功
|
||||
order.setPayStatus((short)1);
|
||||
orderService.updateById(order);
|
||||
return ResponseUtil.ok(result);
|
||||
}
|
||||
@@ -549,9 +546,8 @@ public class WxOrderController {
|
||||
}
|
||||
|
||||
order.setPayId(payId);
|
||||
// 0 初始,1 预支付,2 支付成功
|
||||
order.setPayStatus((short)2);
|
||||
order.setPayTime(LocalDateTime.now());
|
||||
order.setOrderStatus(OrderUtil.STATUS_PAY);
|
||||
orderService.updateById(order);
|
||||
|
||||
return WxPayNotifyResponse.success("处理成功!");
|
||||
|
||||
@@ -33,22 +33,28 @@ Page({
|
||||
// “去付款”按钮点击效果
|
||||
payOrder: function () {
|
||||
let that = this;
|
||||
util.request(api.PayPrepayId, {
|
||||
util.request(api.OrderPrepay, {
|
||||
orderId: that.data.orderId
|
||||
}, 'POST').then(function (res) {
|
||||
if (res.errno === 0) {
|
||||
const payParam = res.data;
|
||||
console.log("支付过程开始")
|
||||
wx.requestPayment({
|
||||
'timeStamp': payParam.timeStamp,
|
||||
'nonceStr': payParam.nonceStr,
|
||||
'package': payParam.package,
|
||||
'package': payParam.packageValue,
|
||||
'signType': payParam.signType,
|
||||
'paySign': payParam.paySign,
|
||||
'success': function (res) {
|
||||
console.log(res)
|
||||
console.log("支付过程成功")
|
||||
util.redirect('/pages/ucenter/order/order');
|
||||
},
|
||||
'fail': function (res) {
|
||||
console.log(res)
|
||||
console.log("支付过程失败")
|
||||
util.showErrorToast('支付失败');
|
||||
},
|
||||
'complete': function (res) {
|
||||
console.log("支付过程结束")
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user