【fix】优化代码
This commit is contained in:
@ -91,44 +91,42 @@ export function useOrder(handleOrderInfo = () => {
|
||||
|
||||
/**
|
||||
* 微信确认收货弹窗
|
||||
* @param params
|
||||
* @param transactionId
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
const showWsReceipt = (transactionId) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// // #ifdef MP-WEIXIN
|
||||
// //拉起确认收货组件
|
||||
// if (wx.openBusinessView) {
|
||||
// wx.openBusinessView({
|
||||
// businessType: 'weappOrderConfirm',
|
||||
// extraData: {
|
||||
// // merchant_id: '',//用户交易商户号
|
||||
// // merchant_trade_no: "",//商户订单号
|
||||
// transaction_id: transactionId //用户交易单号
|
||||
// },
|
||||
// success: (e) => {
|
||||
// resolve('success');
|
||||
// }, fail: e => {
|
||||
// resolve('success');
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// } else {
|
||||
// //引导用户升级微信版本
|
||||
// uni.showToast({
|
||||
// title: "请升级微信版本",
|
||||
// duration: 3000,
|
||||
// icon: "none",
|
||||
// });
|
||||
// }
|
||||
//
|
||||
//
|
||||
// // #endif
|
||||
// // #ifndef MP-WEIXIN
|
||||
// resolve('success');
|
||||
// // #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
// 如果没有transactionId,说明使用的不是微信支付,直接返回成功
|
||||
if (!transactionId) return resolve('success')
|
||||
//拉起确认收货组件
|
||||
if (wx.openBusinessView) {
|
||||
wx.openBusinessView({
|
||||
businessType: 'weappOrderConfirm',
|
||||
extraData: {
|
||||
// merchant_id: '',//用户交易商户号
|
||||
// merchant_trade_no: "",//商户订单号
|
||||
transaction_id: transactionId //用户交易单号
|
||||
},
|
||||
success: (e) => {
|
||||
resolve('success');
|
||||
}, fail: e => {
|
||||
reject(e)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//引导用户升级微信版本
|
||||
uni.showToast({
|
||||
title: "请升级微信版本",
|
||||
duration: 3000,
|
||||
icon: "none",
|
||||
});
|
||||
reject("请升级微信版本")
|
||||
}
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
resolve('success');
|
||||
|
||||
// #endif
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user