修改月卡充值支付取消订单状态不是待支付的bug
This commit is contained in:
parent
d8eb80efd9
commit
0c810d32ab
@ -344,20 +344,69 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 构建跳转参数
|
// 构建跳转参数
|
||||||
|
// const params = {
|
||||||
|
// headerTitle: this.headerTitle,
|
||||||
|
// selectedParkType: this.selectedParkType,
|
||||||
|
// selectedParkId: this.selectedParkId,
|
||||||
|
// selectedCarPlateId: this.selectedCarPlateId,
|
||||||
|
// selectedCarPlate: this.selectedCarPlate,
|
||||||
|
// monthPrice: this.monthPrice,
|
||||||
|
// monthCount: this.monthCount,
|
||||||
|
// startTime: this.startTime,
|
||||||
|
// endTime: this.endTime,
|
||||||
|
// paymentAmount: this.paymentAmount,
|
||||||
|
// selectedBillingRule: this.selectedBillingRule,
|
||||||
|
// };
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
headerTitle: this.headerTitle,
|
user_id: uni.getStorageSync('userId'),
|
||||||
selectedParkType: this.selectedParkType,
|
parking_id: this.selectedParkId,
|
||||||
selectedParkId: this.selectedParkId,
|
car_id: this.selectedCarPlateId,
|
||||||
selectedCarPlateId: this.selectedCarPlateId,
|
billing_rules: this.selectedBillingRule,
|
||||||
selectedCarPlate: this.selectedCarPlate,
|
month_count: this.monthCount,
|
||||||
monthPrice: this.monthPrice,
|
total_amount: this.paymentAmount,
|
||||||
monthCount: this.monthCount,
|
start_time: this.startTime,
|
||||||
startTime: this.startTime,
|
end_time: this.endTime,
|
||||||
endTime: this.endTime,
|
}
|
||||||
paymentAmount: this.paymentAmount,
|
request(apiArr.monthCardCreate, "POST", params).then((resVal) => {
|
||||||
selectedBillingRule: this.selectedBillingRule,
|
// 根据平台设置不同的trans_type值
|
||||||
};
|
// 小程序: 71, App: 51
|
||||||
NavgateTo(`../parkOrderDetail/index?item=${encodeURIComponent(JSON.stringify(params))}`);
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
|
let trans_type = 51; // 默认App环境
|
||||||
|
|
||||||
|
// 运行时判断是否为小程序环境
|
||||||
|
if (systemInfo.platform === 'devtools' || systemInfo.platform === 'unknown') {
|
||||||
|
trans_type = 71; // 开发工具或未知环境默认为小程序
|
||||||
|
}
|
||||||
|
|
||||||
|
// 条件编译:针对不同平台设置不同值
|
||||||
|
// #ifdef MP
|
||||||
|
trans_type = 71; // 所有小程序平台
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
trans_type = 51; // App平台
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
order_id: resVal.order_id,
|
||||||
|
user_id: uni.getStorageSync('userId'),
|
||||||
|
trans_type: trans_type,
|
||||||
|
headerTitle: this.headerTitle,
|
||||||
|
selectedParkType: this.selectedParkType,
|
||||||
|
selectedParkId: this.selectedParkId,
|
||||||
|
selectedCarPlateId: this.selectedCarPlateId,
|
||||||
|
selectedCarPlate: this.selectedCarPlate,
|
||||||
|
monthPrice: this.monthPrice,
|
||||||
|
monthCount: this.monthCount,
|
||||||
|
startTime: this.startTime,
|
||||||
|
endTime: this.endTime,
|
||||||
|
paymentAmount: this.paymentAmount,
|
||||||
|
selectedBillingRule: this.selectedBillingRule,
|
||||||
|
}
|
||||||
|
|
||||||
|
NavgateTo(`../parkOrderDetail/index?item=${encodeURIComponent(JSON.stringify(params))}`);
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查看订单记录
|
// 查看订单记录
|
||||||
|
|||||||
@ -92,77 +92,46 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 提交支付
|
// 提交支付
|
||||||
submitPayment() {
|
submitPayment() {
|
||||||
const params = {
|
const param = {
|
||||||
|
order_id: this.itemObj.order_id,
|
||||||
user_id: uni.getStorageSync('userId'),
|
user_id: uni.getStorageSync('userId'),
|
||||||
parking_id: this.itemObj.selectedParkId,
|
trans_type: this.itemObj.trans_type,
|
||||||
car_id: this.itemObj.selectedCarPlateId,
|
|
||||||
billing_rules: this.itemObj.selectedBillingRule,
|
|
||||||
month_count: this.itemObj.monthCount,
|
|
||||||
total_amount: this.itemObj.paymentAmount,
|
|
||||||
start_time: this.itemObj.startTime,
|
|
||||||
end_time: this.itemObj.endTime,
|
|
||||||
}
|
}
|
||||||
request(apiArr.monthCardCreate, "POST", params).then((resVal) => {
|
request(apiArr.monthCardOrderPreorder, "POST", param).then(res => {
|
||||||
// 根据平台设置不同的trans_type值
|
if (res && res.timeStamp && res.nonceStr && res.package && res.signType && res.paySign) {
|
||||||
// 小程序: 71, App: 51
|
// 调用微信支付
|
||||||
const systemInfo = uni.getSystemInfoSync();
|
uni.requestPayment({
|
||||||
let trans_type = 51; // 默认App环境
|
timeStamp: res.timeStamp,
|
||||||
|
nonceStr: res.nonceStr,
|
||||||
// 运行时判断是否为小程序环境
|
package: res.package,
|
||||||
if (systemInfo.platform === 'devtools' || systemInfo.platform === 'unknown') {
|
signType: res.signType,
|
||||||
trans_type = 71; // 开发工具或未知环境默认为小程序
|
paySign: res.paySign,
|
||||||
}
|
success: (payRes) => {
|
||||||
|
const params = {
|
||||||
// 条件编译:针对不同平台设置不同值
|
order_id: resVal.order_id,
|
||||||
// #ifdef MP
|
|
||||||
trans_type = 71; // 所有小程序平台
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
trans_type = 51; // App平台
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
const param = {
|
|
||||||
order_id: resVal.order_id,
|
|
||||||
user_id: uni.getStorageSync('userId'),
|
|
||||||
trans_type: trans_type
|
|
||||||
}
|
|
||||||
request(apiArr.monthCardOrderPreorder, "POST", param).then(res => {
|
|
||||||
if (res && res.timeStamp && res.nonceStr && res.package && res.signType && res.paySign) {
|
|
||||||
// 调用微信支付
|
|
||||||
uni.requestPayment({
|
|
||||||
timeStamp: res.timeStamp,
|
|
||||||
nonceStr: res.nonceStr,
|
|
||||||
package: res.package,
|
|
||||||
signType: res.signType,
|
|
||||||
paySign: res.paySign,
|
|
||||||
success: (payRes) => {
|
|
||||||
const params = {
|
|
||||||
order_id: resVal.order_id,
|
|
||||||
}
|
|
||||||
request(apiArr.monthCardOrderQuery, "POST", params).then(res => {
|
|
||||||
this.boxshadow1 = true
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
|
||||||
fail: (payErr) => {
|
|
||||||
uni.showToast({
|
|
||||||
title: payErr.errMsg == 'requestPayment:fail cancel' ? '用户取消支付' : '支付失败',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
complete: () => {
|
|
||||||
// 支付完成后的回调,无论成功失败都会执行
|
|
||||||
}
|
}
|
||||||
})
|
request(apiArr.monthCardOrderQuery, "POST", params).then(res => {
|
||||||
} else {
|
this.boxshadow1 = true
|
||||||
console.error("获取支付参数失败,缺少必要参数")
|
})
|
||||||
uni.showToast({
|
|
||||||
title: '获取支付信息失败',
|
},
|
||||||
icon: 'none'
|
fail: (payErr) => {
|
||||||
})
|
uni.showToast({
|
||||||
}
|
title: payErr.errMsg == 'requestPayment:fail cancel' ? '用户取消支付' : '支付失败',
|
||||||
})
|
icon: 'none'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: () => {
|
||||||
|
// 支付完成后的回调,无论成功失败都会执行
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.error("获取支付参数失败,缺少必要参数")
|
||||||
|
uni.showToast({
|
||||||
|
title: '获取支付信息失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user