修复修改支付方式时为跳转到详情页面的问题
This commit is contained in:
@ -5,47 +5,44 @@ export const weappPay = (option) => {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// 吊起微信支付
|
// 吊起微信支付
|
||||||
// getProvider('payment').then(provider => {
|
// getProvider('payment').then(provider => {
|
||||||
let orderInfo = {
|
let orderInfo = {
|
||||||
appid: option.appid,
|
appid: option.appid,
|
||||||
noncestr: option.noncestr,
|
noncestr: option.noncestr,
|
||||||
package: option.package,
|
package: option.package,
|
||||||
partnerid: option.partnerid,
|
partnerid: option.partnerid,
|
||||||
prepayid: option.prepayid,
|
prepayid: option.prepayid,
|
||||||
sign: option.sign,
|
sign: option.sign,
|
||||||
timestamp: option.timestamp + '',
|
timestamp: option.timestamp + '',
|
||||||
|
}
|
||||||
|
console.log({
|
||||||
|
provider: 'wxpay',
|
||||||
|
// signType: "MD5",
|
||||||
|
// timeStamp: orderInfo.timeStamp,
|
||||||
|
// nonceStr: orderInfo.noncestr,
|
||||||
|
// package: orderInfo.prepayid,
|
||||||
|
// signType: "MD5",
|
||||||
|
// paySign: orderInfo.sign,
|
||||||
|
orderInfo,
|
||||||
|
}, '发起支付')
|
||||||
|
// 调用登录接口
|
||||||
|
uni.requestPayment({
|
||||||
|
provider: 'wxpay',
|
||||||
|
...option,
|
||||||
|
timestamp: orderInfo.timestamp,
|
||||||
|
orderInfo,
|
||||||
|
success: (success) => {
|
||||||
|
console.log(success)
|
||||||
|
uni.showToast({
|
||||||
|
title: JSON.stringify(success), icon: 'success', duration: 5000
|
||||||
|
});
|
||||||
|
resolve(success)
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.log(error)
|
||||||
|
uni.showToast({ title: JSON.stringify(error), icon: 'none', duration: 5000 });
|
||||||
|
reject(error)
|
||||||
}
|
}
|
||||||
console.log({
|
})
|
||||||
provider: 'wxpay',
|
|
||||||
// signType: "MD5",
|
|
||||||
// timeStamp: orderInfo.timeStamp,
|
|
||||||
// nonceStr: orderInfo.noncestr,
|
|
||||||
// package: orderInfo.prepayid,
|
|
||||||
// signType: "MD5",
|
|
||||||
// paySign: orderInfo.sign,
|
|
||||||
orderInfo,
|
|
||||||
}, '发起支付')
|
|
||||||
// 调用登录接口
|
|
||||||
uni.requestPayment({
|
|
||||||
provider: 'wxpay',
|
|
||||||
// timeStamp: orderInfo.timeStamp,
|
|
||||||
// nonceStr: orderInfo.noncestr,
|
|
||||||
// package: orderInfo.prepayid,
|
|
||||||
// signType: "MD5",
|
|
||||||
// paySign: orderInfo.sign,
|
|
||||||
orderInfo,
|
|
||||||
success: (success) => {
|
|
||||||
console.log(success)
|
|
||||||
uni.showToast({
|
|
||||||
title: JSON.stringify(success), icon: 'success', duration: 5000
|
|
||||||
});
|
|
||||||
resolve(success)
|
|
||||||
},
|
|
||||||
fail: (error) => {
|
|
||||||
console.log(error)
|
|
||||||
uni.showToast({ title: JSON.stringify(error), icon: 'none', duration: 5000 });
|
|
||||||
reject(error)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// })
|
// })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -508,6 +508,18 @@
|
|||||||
switch (data.status) {
|
switch (data.status) {
|
||||||
case "ORDER_EXIST":
|
case "ORDER_EXIST":
|
||||||
case "EXTEND_ORDER":
|
case "EXTEND_ORDER":
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
this.$yrouter.replace({
|
||||||
|
path: "/pages/order/OrderDetails/index",
|
||||||
|
query: {
|
||||||
|
id: data.result.orderId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
case "PAY_DEFICIENCY":
|
case "PAY_DEFICIENCY":
|
||||||
case "PAY_ERROR":
|
case "PAY_ERROR":
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@ -549,24 +561,24 @@
|
|||||||
break;
|
break;
|
||||||
case "WECHAT_PAY":
|
case "WECHAT_PAY":
|
||||||
// 小程序支付
|
// 小程序支付
|
||||||
weappPay(data.result.jsConfig).then(res => {
|
weappPay(data.result.jsConfig).finally(()=>{
|
||||||
this.$yrouter.replace({
|
this.$yrouter.replace({
|
||||||
path: "/pages/order/OrderDetails/index",
|
path: "/pages/order/OrderDetails/index",
|
||||||
query: {
|
query: {
|
||||||
id: data.result.orderId
|
id: data.result.orderId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
case "WECHAT_APP_PAY":
|
case "WECHAT_APP_PAY":
|
||||||
// APP支付
|
// APP支付
|
||||||
weappPay(data.result.jsConfig).then(res => {
|
weappPay(data.result.jsConfig).finally(()=>{
|
||||||
this.$yrouter.replace({
|
this.$yrouter.replace({
|
||||||
path: "/pages/order/OrderDetails/index",
|
path: "/pages/order/OrderDetails/index",
|
||||||
query: {
|
query: {
|
||||||
id: data.result.orderId
|
id: data.result.orderId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
|
||||||
// 下面为原先微信支付方式,
|
// 下面为原先微信支付方式,
|
||||||
// pay(data.result.jsConfig).finally(() => {
|
// pay(data.result.jsConfig).finally(() => {
|
||||||
|
Reference in New Issue
Block a user