导入支付订单状态刷新
This commit is contained in:
parent
3462805cee
commit
8a39eb18b1
12
api/pay/pay.js
Normal file
12
api/pay/pay.js
Normal 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 },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -65,6 +65,7 @@ import {
|
||||||
getPeriodPackagesByDevId,
|
getPeriodPackagesByDevId,
|
||||||
} from '../../api/lease/lease.js'
|
} from '../../api/lease/lease.js'
|
||||||
import { getIsRealName } from '../../api'
|
import { getIsRealName } from '../../api'
|
||||||
|
import { refreshPayResult } from '../../api/pay/pay'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -107,6 +108,9 @@ export default {
|
||||||
packageLoading: false,
|
packageLoading: false,
|
||||||
selectedPackage: null,
|
selectedPackage: null,
|
||||||
renewData: {},
|
renewData: {},
|
||||||
|
|
||||||
|
//订单id
|
||||||
|
no: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -410,8 +414,10 @@ export default {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
const data = response.data
|
const data = response.data
|
||||||
|
this.no = data.pay.no
|
||||||
|
console.log('data.pay.no:', this.no)
|
||||||
const wxpPayParams = data.payParams
|
const wxpPayParams = data.payParams
|
||||||
console.log(data)
|
console.log('续费response:', data)
|
||||||
|
|
||||||
const payParams = {
|
const payParams = {
|
||||||
package: wxpPayParams.packageVal, // 后端返回的字段名
|
package: wxpPayParams.packageVal, // 后端返回的字段名
|
||||||
|
|
@ -424,12 +430,14 @@ export default {
|
||||||
|
|
||||||
wx.requestPayment({
|
wx.requestPayment({
|
||||||
...payParams,
|
...payParams,
|
||||||
success: function (res) {
|
success: async function (res) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付成功',
|
title: '支付成功',
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
})
|
})
|
||||||
|
await refreshPayResult(this.no)
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/myOrder/orderDetail?id=${data.pay.bstId}`,
|
url: `/pages/myOrder/orderDetail?id=${data.pay.bstId}`,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user