导入支付订单状态刷新

This commit is contained in:
WindowBird 2025-09-15 10:46:50 +08:00
parent 3462805cee
commit 8a39eb18b1
2 changed files with 22 additions and 2 deletions

12
api/pay/pay.js Normal file
View File

@ -0,0 +1,12 @@
import request from '../../utils/request'
export function refreshPayResult(no) {
return request({
url: '/app/pay/refreshPayResult',
method: 'PUT',
header: {
'Content-Type': 'application/x-www-form-urlencoded',
},
data: { no: no },
})
}

View File

@ -65,6 +65,7 @@ import {
getPeriodPackagesByDevId,
} from '../../api/lease/lease.js'
import { getIsRealName } from '../../api'
import { refreshPayResult } from '../../api/pay/pay'
export default {
components: {
@ -107,6 +108,9 @@ export default {
packageLoading: false,
selectedPackage: null,
renewData: {},
//id
no: '',
}
},
@ -410,8 +414,10 @@ export default {
uni.hideLoading()
if (response.code === 200) {
const data = response.data
this.no = data.pay.no
console.log('data.pay.no:', this.no)
const wxpPayParams = data.payParams
console.log(data)
console.log('续费response:', data)
const payParams = {
package: wxpPayParams.packageVal, //
@ -424,12 +430,14 @@ export default {
wx.requestPayment({
...payParams,
success: function (res) {
success: async function (res) {
uni.showToast({
title: '支付成功',
icon: 'success',
duration: 3000,
})
await refreshPayResult(this.no)
setTimeout(() => {
uni.navigateTo({
url: `/pages/myOrder/orderDetail?id=${data.pay.bstId}`,