修改月卡充值支付取消订单状态不是待支付的bug

This commit is contained in:
赵毅 2025-09-06 17:43:27 +08:00
parent d8eb80efd9
commit 0c810d32ab
2 changed files with 99 additions and 81 deletions

View File

@ -344,20 +344,69 @@ export default {
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 = {
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))}`);
user_id: uni.getStorageSync('userId'),
parking_id: this.selectedParkId,
car_id: this.selectedCarPlateId,
billing_rules: this.selectedBillingRule,
month_count: this.monthCount,
total_amount: this.paymentAmount,
start_time: this.startTime,
end_time: this.endTime,
}
request(apiArr.monthCardCreate, "POST", params).then((resVal) => {
// trans_type
// : 71, App: 51
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))}`);
})
},
//

View File

@ -92,77 +92,46 @@ export default {
methods: {
//
submitPayment() {
const params = {
const param = {
order_id: this.itemObj.order_id,
user_id: uni.getStorageSync('userId'),
parking_id: this.itemObj.selectedParkId,
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,
trans_type: this.itemObj.trans_type,
}
request(apiArr.monthCardCreate, "POST", params).then((resVal) => {
// trans_type
// : 71, App: 51
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 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.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,
}
})
} else {
console.error("获取支付参数失败,缺少必要参数")
uni.showToast({
title: '获取支付信息失败',
icon: 'none'
})
}
})
request(apiArr.monthCardOrderQuery, "POST", params).then(res => {
this.boxshadow1 = true
})
},
fail: (payErr) => {
uni.showToast({
title: payErr.errMsg == 'requestPayment:fail cancel' ? '用户取消支付' : '支付失败',
icon: 'none'
})
},
complete: () => {
//
}
})
} else {
console.error("获取支付参数失败,缺少必要参数")
uni.showToast({
title: '获取支付信息失败',
icon: 'none'
})
}
})
}
},