Showing
2 changed files
with
15 additions
and
10 deletions
@@ -53,6 +53,7 @@ | @@ -53,6 +53,7 @@ | ||
53 | const $ = require('jquery'); | 53 | const $ = require('jquery'); |
54 | const tip = require('common/tip'); | 54 | const tip = require('common/tip'); |
55 | const Modal = require('common/modal'); | 55 | const Modal = require('common/modal'); |
56 | + const yoho = require('yoho'); | ||
56 | 57 | ||
57 | module.exports = { | 58 | module.exports = { |
58 | data() { | 59 | data() { |
@@ -69,7 +70,7 @@ | @@ -69,7 +70,7 @@ | ||
69 | this.reload(); | 70 | this.reload(); |
70 | 71 | ||
71 | document.addEventListener('visibilitychange', () => { | 72 | document.addEventListener('visibilitychange', () => { |
72 | - if (!document.hidden) { | 73 | + if (!document.hidden && yoho.store.get('refundOrder')) { |
73 | this.reload(); | 74 | this.reload(); |
74 | } | 75 | } |
75 | }); | 76 | }); |
@@ -83,6 +84,8 @@ | @@ -83,6 +84,8 @@ | ||
83 | this.emptybox= 'hide'; | 84 | this.emptybox= 'hide'; |
84 | 85 | ||
85 | this.getRefundData(); | 86 | this.getRefundData(); |
87 | + | ||
88 | + yoho.store.remove('refundOrder'); | ||
86 | }, | 89 | }, |
87 | getRefundData() { | 90 | getRefundData() { |
88 | this.busy = true; | 91 | this.busy = true; |
@@ -124,6 +124,16 @@ | @@ -124,6 +124,16 @@ | ||
124 | detail: {} | 124 | detail: {} |
125 | }; | 125 | }; |
126 | }, | 126 | }, |
127 | + created() { | ||
128 | + this.reload(); | ||
129 | + | ||
130 | + document.addEventListener('visibilitychange', () => { | ||
131 | + if (!document.hidden && yoho.store.get('refundStatus')) { | ||
132 | + this.reload(); | ||
133 | + yoho.store.set('refundOrder', true); | ||
134 | + } | ||
135 | + }); | ||
136 | + }, | ||
127 | methods: { | 137 | methods: { |
128 | reload() { | 138 | reload() { |
129 | this.id = ''; | 139 | this.id = ''; |
@@ -182,21 +192,13 @@ | @@ -182,21 +192,13 @@ | ||
182 | }).then(data => { | 192 | }).then(data => { |
183 | if (data.code === 200) { | 193 | if (data.code === 200) { |
184 | _this.reload(); | 194 | _this.reload(); |
195 | + yoho.store.set('refundOrder', true); | ||
185 | } else { | 196 | } else { |
186 | tip(data.message); | 197 | tip(data.message); |
187 | } | 198 | } |
188 | }); | 199 | }); |
189 | }); | 200 | }); |
190 | } | 201 | } |
191 | - }, | ||
192 | - created() { | ||
193 | - this.reload(); | ||
194 | - | ||
195 | - document.addEventListener('visibilitychange', () => { | ||
196 | - if (!document.hidden && yoho.store.get('refundStatus')) { | ||
197 | - this.reload(); | ||
198 | - } | ||
199 | - }); | ||
200 | } | 202 | } |
201 | }; | 203 | }; |
202 | </script> | 204 | </script> |
-
Please register or login to post a comment