|
@@ -25,7 +25,8 @@ export default {
|
25
|
25
|
DataLock: true,
|
26
|
26
|
From: null,
|
27
|
27
|
OrderStatus: null,
|
28
|
|
- Jwt: window.localStorage.Jwt
|
|
28
|
+ Jwt: window.localStorage.Jwt,
|
|
29
|
+ Timer: null
|
29
|
30
|
}
|
30
|
31
|
},
|
31
|
32
|
computed: {
|
|
@@ -48,15 +49,31 @@ export default {
|
48
|
49
|
...mapUserMutations([
|
49
|
50
|
'UpdateUserInfo'
|
50
|
51
|
]),
|
51
|
|
- Init () { // 初始化
|
52
|
|
- if (this.$route.query.orderId !== undefined) {
|
53
|
|
- this.GetAliPayStatus({ urlData: { id: this.$route.query.orderId } }).then((res) => {
|
54
|
|
- this.OrderStatus = res.data.data === 1 ? 'Success' : 'Error'
|
|
52
|
+ CheckOrder () {
|
|
53
|
+ this.GetAliPayStatus({ urlData: { id: this.$route.query.orderId } }).then((res) => {
|
|
54
|
+ if (res.data.data === 1) {
|
|
55
|
+ window.clearTimeout(this.Timer)
|
|
56
|
+ this.OrderStatus = 'Success'
|
55
|
57
|
this.GetCurrentUserInfo().then(() => {
|
56
|
58
|
this.DataLock = false
|
57
|
59
|
}).catch(() => {
|
58
|
60
|
this.DataLock = false
|
59
|
61
|
})
|
|
62
|
+ } else {
|
|
63
|
+ this.Timer = window.setTimeout(() => {
|
|
64
|
+ this.CheckOrder()
|
|
65
|
+ }, 5000)
|
|
66
|
+ }
|
|
67
|
+ }).catch(() => {
|
|
68
|
+ this.Timer = window.setTimeout(() => {
|
|
69
|
+ this.CheckOrder()
|
|
70
|
+ }, 5000)
|
|
71
|
+ })
|
|
72
|
+ },
|
|
73
|
+ Init () { // 初始化
|
|
74
|
+ if (this.$route.query.orderId !== undefined) {
|
|
75
|
+ this.GetAliPayStatus({ urlData: { id: this.$route.query.orderId } }).then((res) => {
|
|
76
|
+ this.CheckOrder()
|
60
|
77
|
})
|
61
|
78
|
} else {
|
62
|
79
|
this.GetCurrentUserInfo().then(() => {
|