提交 44a5c5a8 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 修改支付

上级 8488deb6
......@@ -23,10 +23,14 @@ export default class ScoreAPI extends BaseAPI {
getFormDetail = (params = {}) => {
return this.get('/api/microservices/api/v3/apply/teacher-form-detail', params, {})
}
// 下单
getOrder = (obj = {}) => this.post('/api/microservices/api/v3/apply/unified-order', obj)
// 查看订单状态
checkPay = id => this.get(`/api/pay/v1/order/status/${id}`)
checkPay = id =>
this.post('/api/pay/order/query', { order_id: id }, { headers: { 'Content-Type': 'application/json' } })
// 支付完成通知
payEnd = (obj = {}) => this.post('/api/microservices/api/v3/apply/pay-end', obj)
// 更新用户信息
......
......@@ -306,8 +306,8 @@ export default {
this.form = Object.assign(this.form, res.data.detail)
this.form.sex = this.form.sex && this.form.sex.toString()
this.form.live_status = this.form.live_status && this.form.live_status.toString()
if (res.data.detail.order_no !== '') {
this.checkPay(res.data.detail.order_no, call)
if (res.data.detail.order_info) {
this.checkPay(res.data.detail.order_info.pay_order_id, call)
}
}
}
......@@ -317,7 +317,8 @@ export default {
checkPay(id, call) {
action.articleAction.checkPay(id).then(res => {
if (res.code === 0) {
if (res.order.status === 1) {
const [order = {}] = res.data
if (order.status === 1) {
this.isPayStatus = true
} else {
call()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论