物业缴费未支付成功的订单请求删除接口

This commit is contained in:
赵毅 2025-09-25 15:57:59 +08:00
parent e59eab06f9
commit 292a74351e
2 changed files with 36 additions and 34 deletions

View File

@ -52,4 +52,6 @@ export const apiArr = {
tradeQuery: "/api/v2/wechat/community-order-pay/trade-query", //缴费查单 tradeQuery: "/api/v2/wechat/community-order-pay/trade-query", //缴费查单
checkComm: "/api/v2/wechat/community/check-comm", //检查小区是否属于当前用户 checkComm: "/api/v2/wechat/community/check-comm", //检查小区是否属于当前用户
delPay: "/api/v2/wechat/community-order-pay/del", //检查小区是否属于当前用户
}; };

View File

@ -138,7 +138,7 @@
<view class="bottom_left"> <view class="bottom_left">
<span>合计</span> <span>合计</span>
<p></p> <p></p>
{{ currentMoney.toFixed(2) }} {{ currentMoney }}
</view> </view>
<view class="bottom_right" @click="createPay">立即支付</view> <view class="bottom_right" @click="createPay">立即支付</view>
</view> </view>
@ -486,42 +486,42 @@ export default {
await request(apiArr.OrderPay, "POST", { order_pay_id: this.payInfoId }).then( await request(apiArr.OrderPay, "POST", { order_pay_id: this.payInfoId }).then(
async (res) => { async (res) => {
if (res && res.timeStamp && res.nonceStr && res.package && res.signType && res.paySign) { if (res && res.timeStamp && res.nonceStr && res.package && res.signType && res.paySign) {
// //
uni.requestPayment({ uni.requestPayment({
timeStamp: res.timeStamp, timeStamp: res.timeStamp,
nonceStr: res.nonceStr, nonceStr: res.nonceStr,
package: res.package, package: res.package,
signType: res.signType, signType: res.signType,
paySign: res.paySign, paySign: res.paySign,
success: (payRes) => { success: (payRes) => {
const params = { const params = {
order_pay_id: this.payInfoId, order_pay_id: this.payInfoId,
} }
request(apiArr.tradeQuery, "POST", params).then(res => { request(apiArr.tradeQuery, "POST", params).then(res => {
})
},
fail: (payErr) => {
uni.showToast({
title: payErr.errMsg == 'requestPayment:fail cancel' ? '已取消支付' : '支付失败',
icon: 'none'
})
const params = {
order_ids: orderId,
}
request(apiArr.cancelPay, "POST", params).then(res => {
})
},
complete: () => {
//
}
}) })
} else { },
console.error("获取支付参数失败,缺少必要参数") fail: (payErr) => {
uni.showToast({ uni.showToast({
title: '获取支付信息失败', title: payErr.errMsg == 'requestPayment:fail cancel' ? '已取消支付' : '支付失败',
icon: 'none' icon: 'none'
}) })
} const params = {
order_pay_id: this.payInfoId,
}
request(apiArr.delPay, "POST", params).then(res => {
})
},
complete: () => {
//
}
})
} else {
console.error("获取支付参数失败,缺少必要参数")
uni.showToast({
title: '获取支付信息失败',
icon: 'none'
})
}
} }
); );
}, },