提交 b34e98e9 authored 作者: lihuihui's avatar lihuihui

修改支付

上级 960de049
...@@ -13,6 +13,29 @@ export function getOpenId(params) { ...@@ -13,6 +13,29 @@ export function getOpenId(params) {
}) })
} }
/**
* 获取订单状态
*/
export function getOrderStatus() {
return httpRequest.get('/api/pay/v1/mall/order/status')
}
/**
* 获取订单
*/
export function getOrder(orderId) {
return httpRequest.get(`/api/pay/v1/mall/order/${orderId}`)
}
// upload 支付状态
export function uploadPay(id, data) {
return httpRequest({
url: `/api/alumni/v1/certification/change/${id}`,
method: 'post',
data
})
}
/** /**
* 生成订单 * 生成订单
*/ */
...@@ -33,18 +56,3 @@ export function genOrder(data) { ...@@ -33,18 +56,3 @@ export function genOrder(data) {
export function getProduct(productId) { export function getProduct(productId) {
return httpRequest.get(`/api/pay/v2/mall/product/${productId}`) return httpRequest.get(`/api/pay/v2/mall/product/${productId}`)
} }
/**
* 获取订单
*/
export function getOrder(orderId) {
return httpRequest.get(`/api/pay/v2/mall/order/${orderId}`)
}
/**
* 获取订单状态
*/
export function getOrderStatus() {
return httpRequest.get('/api/pay/v2/mall/order/status')
}
...@@ -12,6 +12,7 @@ export default { ...@@ -12,6 +12,7 @@ export default {
}, },
data() { data() {
return { return {
clearTime: null,
openId: '', openId: '',
order: { options: {} } order: { options: {} }
} }
...@@ -47,10 +48,22 @@ export default { ...@@ -47,10 +48,22 @@ export default {
} }
api.genOrder(params).then(response => { api.genOrder(params).then(response => {
this.order = response.data this.order = response.data
this.clearTime = setInterval(() => {
this.getOrderStatus(this.order.order_no)
}, 1000)
// 调起微信支付 // 调起微信支付
this.wxPay() this.wxPay()
}) })
}, },
getOrderStatus(id) {
api.getOrder(id).then(response => {
const code = parseInt(response.data.status)
if (code !== -1) {
clearInterval(this.clearTime)
this.$router.go(0)
}
})
},
// 微信支付 // 微信支付
wxPay() { wxPay() {
const options = this.order.options const options = this.order.options
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<div class="icon-yes" v-if="item.approve_status"></div> <div class="icon-yes" v-if="item.approve_status"></div>
</div> </div>
</template> </template>
<div class="btn" @click="orderPays" style="font-size:30px;position: relative;z-index: 999;">支付</div> <!-- <div class="btn" @click="orderPays" style="font-size:30px;position: relative;z-index: 999;">支付</div> -->
<template v-if="data.length == 0"> <template v-if="data.length == 0">
<van-empty description="您还没有提交申请"/> <van-empty description="您还没有提交申请"/>
<div class="list-btn" v-if="data.length == 0" @click="apply">申请三级认证</div> <div class="list-btn" v-if="data.length == 0" @click="apply">申请三级认证</div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论