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

修改支付模块

上级 941d33fd
......@@ -235,9 +235,9 @@
}
},
"@babel/plugin-syntax-jsx": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.10.4.tgz",
"integrity": "sha512-KCg9mio9jwiARCB7WAcQ7Y1q+qicILjoK8LP/VkPkEKaf5dkaZZK1EcTe91a3JJlZ3qy6L5s9X52boEYi8DM9g==",
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz",
"integrity": "sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg==",
"requires": {
"@babel/helper-plugin-utils": "^7.10.4"
}
......@@ -348,9 +348,9 @@
}
},
"@ezijing/vue-form": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/@ezijing/vue-form/-/vue-form-2.0.7.tgz",
"integrity": "sha512-UZZ5IsQ3dLDlX9e/bFES0KTHMh+WwJfX/7NXRLJ4VIWRtY9p8rV7NTOOEDmwQGCK8zKaatcfWvI3XxcBruM+xw==",
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/@ezijing/vue-form/-/vue-form-2.0.8.tgz",
"integrity": "sha512-zH2YT0G5xmZKkVz3+bTL6YaNXkjtHqowZCHOuxuXRPaN9ey7hkVksCAdPhvZwwc+Nk1xFiUPMrDG7/2IoKYXRA==",
"requires": {
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"@vue/babel-preset-jsx": "^1.1.2",
......@@ -504,72 +504,90 @@
}
},
"@vue/babel-helper-vue-jsx-merge-props": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.0.0.tgz",
"integrity": "sha512-6tyf5Cqm4m6v7buITuwS+jHzPlIPxbFzEhXR5JGZpbrvOcp1hiQKckd305/3C7C36wFekNTQSxAtgeM0j0yoUw=="
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.2.1.tgz",
"integrity": "sha512-QOi5OW45e2R20VygMSNhyQHvpdUwQZqGPc748JLGCYEy+yp8fNFNdbNIGAgZmi9e+2JHPd6i6idRuqivyicIkA=="
},
"@vue/babel-plugin-transform-vue-jsx": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.1.2.tgz",
"integrity": "sha512-YfdaoSMvD1nj7+DsrwfTvTnhDXI7bsuh+Y5qWwvQXlD24uLgnsoww3qbiZvWf/EoviZMrvqkqN4CBw0W3BWUTQ==",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.2.1.tgz",
"integrity": "sha512-HJuqwACYehQwh1fNT8f4kyzqlNMpBuUK4rSiSES5D4QsYncv5fxFsLyrxFPG2ksO7t5WP+Vgix6tt6yKClwPzA==",
"requires": {
"@babel/helper-module-imports": "^7.0.0",
"@babel/plugin-syntax-jsx": "^7.2.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.2.1",
"html-tags": "^2.0.0",
"lodash.kebabcase": "^4.1.1",
"svg-tags": "^1.0.0"
}
},
"@vue/babel-preset-jsx": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@vue/babel-preset-jsx/-/babel-preset-jsx-1.1.2.tgz",
"integrity": "sha512-zDpVnFpeC9YXmvGIDSsKNdL7qCG2rA3gjywLYHPCKDT10erjxF4U+6ay9X6TW5fl4GsDlJp9bVfAVQAAVzxxvQ==",
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/@vue/babel-preset-jsx/-/babel-preset-jsx-1.2.4.tgz",
"integrity": "sha512-oRVnmN2a77bYDJzeGSt92AuHXbkIxbf/XXSE3klINnh9AXBmVS1DGa1f0d+dDYpLfsAKElMnqKTQfKn7obcL4w==",
"requires": {
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"@vue/babel-plugin-transform-vue-jsx": "^1.1.2",
"@vue/babel-sugar-functional-vue": "^1.1.2",
"@vue/babel-sugar-inject-h": "^1.1.2",
"@vue/babel-sugar-v-model": "^1.1.2",
"@vue/babel-sugar-v-on": "^1.1.2"
"@vue/babel-helper-vue-jsx-merge-props": "^1.2.1",
"@vue/babel-plugin-transform-vue-jsx": "^1.2.1",
"@vue/babel-sugar-composition-api-inject-h": "^1.2.1",
"@vue/babel-sugar-composition-api-render-instance": "^1.2.4",
"@vue/babel-sugar-functional-vue": "^1.2.2",
"@vue/babel-sugar-inject-h": "^1.2.2",
"@vue/babel-sugar-v-model": "^1.2.3",
"@vue/babel-sugar-v-on": "^1.2.3"
}
},
"@vue/babel-sugar-composition-api-inject-h": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@vue/babel-sugar-composition-api-inject-h/-/babel-sugar-composition-api-inject-h-1.2.1.tgz",
"integrity": "sha512-4B3L5Z2G+7s+9Bwbf+zPIifkFNcKth7fQwekVbnOA3cr3Pq71q71goWr97sk4/yyzH8phfe5ODVzEjX7HU7ItQ==",
"requires": {
"@babel/plugin-syntax-jsx": "^7.2.0"
}
},
"@vue/babel-sugar-composition-api-render-instance": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/@vue/babel-sugar-composition-api-render-instance/-/babel-sugar-composition-api-render-instance-1.2.4.tgz",
"integrity": "sha512-joha4PZznQMsxQYXtR3MnTgCASC9u3zt9KfBxIeuI5g2gscpTsSKRDzWQt4aqNIpx6cv8On7/m6zmmovlNsG7Q==",
"requires": {
"@babel/plugin-syntax-jsx": "^7.2.0"
}
},
"@vue/babel-sugar-functional-vue": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.1.2.tgz",
"integrity": "sha512-YhmdJQSVEFF5ETJXzrMpj0nkCXEa39TvVxJTuVjzvP2rgKhdMmQzlJuMv/HpadhZaRVMCCF3AEjjJcK5q/cYzQ==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.2.2.tgz",
"integrity": "sha512-JvbgGn1bjCLByIAU1VOoepHQ1vFsroSA/QkzdiSs657V79q6OwEWLCQtQnEXD/rLTA8rRit4rMOhFpbjRFm82w==",
"requires": {
"@babel/plugin-syntax-jsx": "^7.2.0"
}
},
"@vue/babel-sugar-inject-h": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.1.2.tgz",
"integrity": "sha512-VRSENdTvD5htpnVp7i7DNuChR5rVMcORdXjvv5HVvpdKHzDZAYiLSD+GhnhxLm3/dMuk8pSzV+k28ECkiN5m8w==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.2.2.tgz",
"integrity": "sha512-y8vTo00oRkzQTgufeotjCLPAvlhnpSkcHFEp60+LJUwygGcd5Chrpn5480AQp/thrxVm8m2ifAk0LyFel9oCnw==",
"requires": {
"@babel/plugin-syntax-jsx": "^7.2.0"
}
},
"@vue/babel-sugar-v-model": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.1.2.tgz",
"integrity": "sha512-vLXPvNq8vDtt0u9LqFdpGM9W9IWDmCmCyJXuozlq4F4UYVleXJ2Fa+3JsnTZNJcG+pLjjfnEGHci2339Kj5sGg==",
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.2.3.tgz",
"integrity": "sha512-A2jxx87mySr/ulAsSSyYE8un6SIH0NWHiLaCWpodPCVOlQVODCaSpiR4+IMsmBr73haG+oeCuSvMOM+ttWUqRQ==",
"requires": {
"@babel/plugin-syntax-jsx": "^7.2.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"@vue/babel-plugin-transform-vue-jsx": "^1.1.2",
"@vue/babel-helper-vue-jsx-merge-props": "^1.2.1",
"@vue/babel-plugin-transform-vue-jsx": "^1.2.1",
"camelcase": "^5.0.0",
"html-tags": "^2.0.0",
"svg-tags": "^1.0.0"
}
},
"@vue/babel-sugar-v-on": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.1.2.tgz",
"integrity": "sha512-T8ZCwC8Jp2uRtcZ88YwZtZXe7eQrJcfRq0uTFy6ShbwYJyz5qWskRFoVsdTi9o0WEhmQXxhQUewodOSCUPVmsQ==",
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.2.3.tgz",
"integrity": "sha512-kt12VJdz/37D3N3eglBywV8GStKNUhNrsxChXIV+o0MwVXORYuhDTHJRKPgLJRb/EY3vM2aRFQdxJBp9CLikjw==",
"requires": {
"@babel/plugin-syntax-jsx": "^7.2.0",
"@vue/babel-plugin-transform-vue-jsx": "^1.1.2",
"@vue/babel-plugin-transform-vue-jsx": "^1.2.1",
"camelcase": "^5.0.0"
}
},
......
......@@ -67,7 +67,7 @@
"webpack-merge": "^4.2.2"
},
"dependencies": {
"@ezijing/vue-form": "^2.0.7",
"@ezijing/vue-form": "^2.0.8",
"animate.css": "^4.1.0",
"axios": "^0.19.2",
"cross-env": "^7.0.2",
......
......@@ -55,7 +55,8 @@ export default {
order: { id: '', payment_url: '' },
qrcodeError: false,
dialogVisible: false,
timer: null
timer: null,
paymentRecords: [] // 所有订单
}
},
computed: {
......@@ -66,6 +67,16 @@ export default {
// 支付成功
paySuccess() {
return this.order.payment_status === 'SUCCESS'
},
// 待支付订单
orderList() {
// 筛选待支付订单
const list = this.paymentRecords.filter(item => {
return item.bill_type === 'APPLICATION_FEE' && item.payment_status === 'WAITING_FOR_PAY'
})
// 待支付订单是否有当前订单
const found = list.find(item => item.id === this.order.id)
return found ? list : [...list, this.order]
}
},
methods: {
......@@ -73,6 +84,8 @@ export default {
async getApplication() {
await api.getApplication().then(response => {
const { payment_records: paymentRecords = [] } = response.data.material
// 获取支付订单
this.paymentRecords = paymentRecords
if (paymentRecords && paymentRecords.length) {
// 获取支付成功的订单
const orderPaySuccess = paymentRecords.find(item => {
......@@ -109,13 +122,13 @@ export default {
this.getOrder()
},
// 检查支付状态
async checkPay() {
async checkPay(order) {
if (this.paySuccess) {
this.timer && clearInterval(this.timer)
return
}
const userId = window.G.UserInfo.id
await api.checkPay(this.order.id, { user_id: userId }).then(response => {
await api.checkPay(order.id, { user_id: userId }).then(response => {
if (response.data.payment_status === 'SUCCESS') {
this.timer && clearInterval(this.timer)
this.dialogVisible = true
......@@ -124,7 +137,11 @@ export default {
},
setCheckPayTimer() {
this.timer && clearInterval(this.timer)
this.timer = setInterval(this.checkPay, 3000)
this.timer = setInterval(() => {
this.orderList.forEach(order => {
this.checkPay(order)
})
}, 3000)
},
// 申请面试
toInterview() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论