【优化】移除旧版自定义交易组件。

This commit is contained in:
jianweie code
2023-09-02 01:49:22 +08:00
parent 651dc6b231
commit 0a07f3e005
108 changed files with 181 additions and 14817 deletions

View File

@@ -143,8 +143,6 @@
*/
console.log("支付宝支付入参app", data)
_this.$u.api.pay(data).then(res => {
//console.log("支付宝支付返回参数app", res)
//console.log("支付宝app支付get提交数据", res.data)
if (res.status) {
uni.requestPayment({
provider: "alipay",
@@ -168,12 +166,9 @@
})
break
case 'wechatpay':
// 微信app支付
_this.$u.api.pay(data).then(res => {
if (res.status) {
//console.log(JSON.stringify(res));
// 调用微信支付
uni.requestPayment({
provider: "wxpay",
orderInfo: {

View File

@@ -92,8 +92,6 @@
},
mounted() {
this.getPayments();
//console.log('类型:' + this.type);
//console.log('订单号:' + this.orderId);
},
methods: {
// 获取可用支付方式列表
@@ -123,7 +121,6 @@
},
// 用户点击支付方式处理
toPayHandler(e) {
//this.popShow = true;
uni.showLoading({
title: '加载中',
mask: true
@@ -152,58 +149,30 @@
this.$u.api.pay(data).then(res => {
console.log(res);
if (res.status) {
if (res.data.checkBeforeAddOrder && res.data.checkBeforeAddOrder.requireOrder == 1) {
console.log("自定义交易组件");
wx.requestOrderPayment({
timeStamp: res.data.paymentParameters.timeStamp + '',
nonceStr: res.data.paymentParameters.nonceStr,
package: res.data.paymentParameters.package,
signType: res.data.paymentParameters.signType,
paySign: res.data.paymentParameters.paySign,
success: function (e) {
uni.hideLoading();
if (e.errMsg === 'requestOrderPayment:ok') {
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
}
},
fail: function (res) {
if (res.errMsg === 'requestPayment:fail cancel') {
//_this.popHide();
_this.$u.toast("您已经取消此方式支付,可继续选择其他方式支付。")
}
setTimeout(function () {
uni.hideLoading();
}, 500);
console.log("普通订单");
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.paySign,
success: function (e) {
uni.hideLoading();
if (e.errMsg === 'requestPayment:ok') {
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
}
});
} else {
console.log("普通订单");
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.paySign,
success: function (e) {
uni.hideLoading();
if (e.errMsg === 'requestPayment:ok') {
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
}
},
fail: function (res) {
if (res.errMsg === 'requestPayment:fail cancel') {
//_this.popHide();
_this.$u.toast("您已经取消此方式支付,可继续选择其他方式支付。")
}
setTimeout(function () {
uni.hideLoading();
}, 500);
},
fail: function (res) {
if (res.errMsg === 'requestPayment:fail cancel') {
_this.$u.toast("您已经取消此方式支付,可继续选择其他方式支付。")
}
});
}
setTimeout(function () {
uni.hideLoading();
}, 500);
}
});
} else {
//_this.popHide();
setTimeout(function () {
uni.hideLoading();
_this.$u.toast(res.msg)
@@ -221,7 +190,6 @@
uni.hideLoading();
this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
} else {
//this.popHide();
setTimeout(function () {
_this.$u.toast(res.msg)
uni.hideLoading();