订单相关修改同步test

This commit is contained in:
GaoHao
2024-10-16 09:05:52 +08:00
parent 3288d1ed9b
commit 3ad4d7af68
16 changed files with 363 additions and 4678 deletions

View File

@@ -314,7 +314,7 @@
* 立即付款
*/
async showpopupclick(item) {
let res = await this.api.payorderPay({
let res = await this.api.orderPay({
orderId: item.id,
// #ifdef MP-WEIXIN
payType: 'wechatPay',
@@ -328,8 +328,8 @@
title: '加载中',
mask: true
})
// #ifdef MP-WEIXIN
uni.requestPayment({
// #ifdef MP-WEIXIN
provider: 'wxpay', //支付类型-固定值
partnerid: res.data.appId, // 微信支付商户号
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
@@ -337,60 +337,55 @@
package: res.data.package, // 固定值
signType: res.data.signType, //固定值
paySign: res.data.paySign, //签名
// #endif
// #ifdef MP-ALIPAY
provider: 'alipay', //支付类型-固定值
orderInfo: res.data.tradeNo, // 微信支付商户号
// #endif
success: (res) => {
let _this = this
uni.showToast({
title: "支付成功"
})
setTimeout(res => {
uni.hideLoading()
uni.switchTab({
url: '/pages/order/order'
});
}, 500)
this.paymodfiyOrderInfo()
// #ifdef MP-WEIXIN
uni.requestSubscribeMessage({
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
complete() {
// uni.cache.set('shopUser', '') //删除shopUser
setTimeout(res => {
uni.hideLoading()
uni.switchTab({
url: '/pages/order/order'
});
}, 500)
_this.paymodfiyOrderInfo()
},
})
// #endif
// #ifdef MP-ALIPAY
_this.paymodfiyOrderInfo()
uni.switchTab({
url: '/pages/order/order'
});
// #endif
},
fail: (err) => {
fail: async(err) => {
let res = await this.api.cancelOrderPay({
orderId: item.id,
}) //判断是否支付成功
uni.showToast({
icon: 'none',
title: '支付失败'
})
setTimeout(res => {
uni.hideLoading()
uni.switchTab({
url: '/pages/order/order'
});
}, 500)
}
});
// #endif
// #ifdef MP-ALIPAY
uni.requestPayment({
provider: 'alipay', //支付类型-固定值
orderInfo: res.data.tradeNo, // 微信支付商户号
success: (res) => {
let _this = this
// uni.requestSubscribeMessage({
// tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
// complete() {
// uni.showToast({
// title: "支付成功"
// })
// // uni.cache.set('shopUser', '') //删除shopUser
// },
// })
_this.paymodfiyOrderInfo()
uni.redirectTo({
url: '/pagesOrder/order_detail/index?orderId=' + _this
.listinfoid
});
},
fail: () => {
uni.hideLoading()
}
});
// #endif
}
},
/**