Authored by shuaiguo

feat(feature): 优惠券领取成功展示已领取

{
"name": "yoho-js-sdk",
"version": "1.3.24",
"version": "1.3.25",
"description": "YOHO!前端js的功能封装包,主要用于在活动页面中,对主要功能的封装。",
"keywords": [
"YOHO!",
... ...
... ... @@ -154,11 +154,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 {
... ...