...
|
...
|
@@ -155,11 +155,30 @@ let _getCoupon = function(data){ |
|
|
|
|
|
if (res.code === 200) {
|
|
|
utils.toast('领取成功', options);
|
|
|
} else if (res.code === 401 && res.auth) {
|
|
|
utils.toast('登录信息失效,请重新登录', options);
|
|
|
setTimeout(() => {
|
|
|
gotoLogin();
|
|
|
}, 1000);
|
|
|
let $img = $(`#${data.token}`);
|
|
|
if($img) {
|
|
|
let statusImgs = $img.data('status-imgs');
|
|
|
if(statusImgs && statusImgs.received) {
|
|
|
$img.attr('src', statusImgs.received);
|
|
|
}
|
|
|
}
|
|
|
} else if (res.code === 401) {
|
|
|
if(res.auth) {
|
|
|
utils.toast('登录信息失效,请重新登录', options);
|
|
|
setTimeout(() => {
|
|
|
gotoLogin();
|
|
|
}, 1000);
|
|
|
}
|
|
|
if(res.message === '优惠券已经领取') {
|
|
|
utils.toast(res.message, options);
|
|
|
let $img = $(`#${data.token}`);
|
|
|
if($img) {
|
|
|
let statusImgs = $img.data('status-imgs');
|
|
|
if(statusImgs && statusImgs.received) {
|
|
|
$img.attr('src', statusImgs.received);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} else if (res.message) {
|
|
|
utils.toast(res.message, options);
|
|
|
} else {
|
...
|
...
|
|