mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:43:26 +08:00
Merge branch 'develop' into 'master'
【优化】优化支付界面业务效果,弹窗支付成功失败,改为loading遮罩层效果,防止网络堵塞杜能造成多次请求支付的问题。 See merge request jianweie/coreshoppro!8
This commit is contained in:
@@ -123,7 +123,11 @@
|
||||
},
|
||||
// 用户点击支付方式处理
|
||||
toPayHandler(e) {
|
||||
this.popShow = true;
|
||||
//this.popShow = true;
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
});
|
||||
let code = e.target.value.code;
|
||||
|
||||
let data = {
|
||||
@@ -158,17 +162,21 @@
|
||||
signType: res.data.paymentParameters.signType,
|
||||
paySign: res.data.paymentParameters.paySign,
|
||||
success: function (e) {
|
||||
console.log(e);
|
||||
if (e.errMsg === 'requestOrderPayment:ok') {
|
||||
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
||||
}
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
}, 500);
|
||||
},
|
||||
fail: function (res) {
|
||||
if (res.errMsg === 'requestPayment:fail cancel') {
|
||||
_this.popHide();
|
||||
//_this.popHide();
|
||||
_this.$u.toast("您已经取消此方式支付,可继续选择其他方式支付。")
|
||||
}
|
||||
console.log(res);
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -181,23 +189,30 @@
|
||||
signType: res.data.signType,
|
||||
paySign: res.data.paySign,
|
||||
success: function (e) {
|
||||
console.log(e);
|
||||
if (e.errMsg === 'requestPayment:ok') {
|
||||
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
||||
}
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
}, 500);
|
||||
},
|
||||
fail: function (res) {
|
||||
if (res.errMsg === 'requestPayment:fail cancel') {
|
||||
_this.popHide();
|
||||
//_this.popHide();
|
||||
_this.$u.toast("您已经取消此方式支付,可继续选择其他方式支付。")
|
||||
}
|
||||
console.log(res);
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
_this.$u.toast(res.msg)
|
||||
_this.popHide();
|
||||
//_this.popHide();
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
_this.$u.toast(res.msg)
|
||||
}, 500);
|
||||
}
|
||||
})
|
||||
break
|
||||
@@ -209,9 +224,15 @@
|
||||
this.$u.api.pay(data).then(res => {
|
||||
if (res.status) {
|
||||
this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
}, 500);
|
||||
} else {
|
||||
this.$u.toast(res.msg)
|
||||
this.popHide();
|
||||
//this.popHide();
|
||||
setTimeout(function () {
|
||||
_this.$u.toast(res.msg)
|
||||
uni.hideLoading();
|
||||
}, 500);
|
||||
}
|
||||
})
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user