Merge remote-tracking branch 'origin/feature/captcha' into feature/captcha
Showing
1 changed file
with
24 additions
and
5 deletions
@@ -155,11 +155,30 @@ let _getCoupon = function(data){ | @@ -155,11 +155,30 @@ let _getCoupon = function(data){ | ||
155 | 155 | ||
156 | if (res.code === 200) { | 156 | if (res.code === 200) { |
157 | utils.toast('领取成功', options); | 157 | utils.toast('领取成功', options); |
158 | - } else if (res.code === 401 && res.auth) { | ||
159 | - utils.toast('登录信息失效,请重新登录', options); | ||
160 | - setTimeout(() => { | ||
161 | - gotoLogin(); | ||
162 | - }, 1000); | 158 | + let $img = $(`#${data.token}`); |
159 | + if($img) { | ||
160 | + let statusImgs = $img.data('status-imgs'); | ||
161 | + if(statusImgs && statusImgs.received) { | ||
162 | + $img.attr('src', statusImgs.received); | ||
163 | + } | ||
164 | + } | ||
165 | + } else if (res.code === 401) { | ||
166 | + if(res.auth) { | ||
167 | + utils.toast('登录信息失效,请重新登录', options); | ||
168 | + setTimeout(() => { | ||
169 | + gotoLogin(); | ||
170 | + }, 1000); | ||
171 | + } | ||
172 | + if(res.message === '优惠券已经领取') { | ||
173 | + utils.toast(res.message, options); | ||
174 | + let $img = $(`#${data.token}`); | ||
175 | + if($img) { | ||
176 | + let statusImgs = $img.data('status-imgs'); | ||
177 | + if(statusImgs && statusImgs.received) { | ||
178 | + $img.attr('src', statusImgs.received); | ||
179 | + } | ||
180 | + } | ||
181 | + } | ||
163 | } else if (res.message) { | 182 | } else if (res.message) { |
164 | utils.toast(res.message, options); | 183 | utils.toast(res.message, options); |
165 | } else { | 184 | } else { |
-
Please register or login to post a comment