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

修改支付模块

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