Showing
1 changed file
with
53 additions
and
50 deletions
@@ -581,60 +581,63 @@ $(function() { | @@ -581,60 +581,63 @@ $(function() { | ||
581 | couponIds.push($(this).attr('data-id')); | 581 | couponIds.push($(this).attr('data-id')); |
582 | }); | 582 | }); |
583 | 583 | ||
584 | - $.ajax({ | ||
585 | - type: 'GET', | ||
586 | - url: '/product/students/userAcquireStatus', | ||
587 | - data: { | ||
588 | - couponIds: couponIds | ||
589 | - }, | ||
590 | - success: function(res) { | ||
591 | - var code = res.code, | ||
592 | - i, | ||
593 | - text, | ||
594 | - $a; | ||
595 | - | ||
596 | - if (code === 200) { | ||
597 | - for (i = 0; i < res.data.length; i++) { | ||
598 | - $a = $('[data-id=\'' + res.data[i].couponId + '\']'); | ||
599 | - | ||
600 | - text = ''; | ||
601 | - | ||
602 | - if (res.data[i].status === 1) { | ||
603 | - text = '<div class="normal">' + | ||
604 | - '<p>点击</p>' + | ||
605 | - '<p>领取</p>' + | ||
606 | - '</div>'; | ||
607 | - } | ||
608 | - if (res.data[i].status === 2) { | ||
609 | - $a.removeClass('enable'); | ||
610 | - text = '<div class="empty">' + | ||
611 | - '<p>已抢光</p>' + | ||
612 | - '<p class="guang">去逛逛</p>' + | ||
613 | - '</div>'; | ||
614 | - } | ||
615 | - if (res.data[i].status === 3) { | ||
616 | - $a.removeClass('enable'); | ||
617 | - text = '<div class="got">' + | ||
618 | - '<p>已领取</p>' + | ||
619 | - '<p class="guang">去使用</p>' + | ||
620 | - '</div>'; | ||
621 | - } | ||
622 | - if (res.data[i].status === 4) { | ||
623 | - $a.removeClass('enable'); | ||
624 | - text = '<div class="normal">' + | ||
625 | - '<p>已过期</p>' + | ||
626 | - '<p class="guang">去逛逛</p>' + | ||
627 | - '</div>'; | 584 | + if (couponIds.length > 0) { |
585 | + | ||
586 | + $.ajax({ | ||
587 | + type: 'GET', | ||
588 | + url: '/product/students/userAcquireStatus', | ||
589 | + data: { | ||
590 | + couponIds: couponIds | ||
591 | + }, | ||
592 | + success: function(res) { | ||
593 | + var code = res.code, | ||
594 | + i, | ||
595 | + text, | ||
596 | + $a; | ||
597 | + | ||
598 | + if (code === 200) { | ||
599 | + for (i = 0; i < res.data.length; i++) { | ||
600 | + $a = $('[data-id=\'' + res.data[i].couponId + '\']'); | ||
601 | + | ||
602 | + text = ''; | ||
603 | + | ||
604 | + if (res.data[i].status === 1) { | ||
605 | + text = '<div class="normal">' + | ||
606 | + '<p>点击</p>' + | ||
607 | + '<p>领取</p>' + | ||
608 | + '</div>'; | ||
609 | + } | ||
610 | + if (res.data[i].status === 2) { | ||
611 | + $a.removeClass('enable'); | ||
612 | + text = '<div class="empty">' + | ||
613 | + '<p>已抢光</p>' + | ||
614 | + '<p class="guang">去逛逛</p>' + | ||
615 | + '</div>'; | ||
616 | + } | ||
617 | + if (res.data[i].status === 3) { | ||
618 | + $a.removeClass('enable'); | ||
619 | + text = '<div class="got">' + | ||
620 | + '<p>已领取</p>' + | ||
621 | + '<p class="guang">去使用</p>' + | ||
622 | + '</div>'; | ||
623 | + } | ||
624 | + if (res.data[i].status === 4) { | ||
625 | + $a.removeClass('enable'); | ||
626 | + text = '<div class="normal">' + | ||
627 | + '<p>已过期</p>' + | ||
628 | + '<p class="guang">去逛逛</p>' + | ||
629 | + '</div>'; | ||
630 | + } | ||
631 | + | ||
632 | + $a.find('.info').html(text); | ||
628 | } | 633 | } |
629 | 634 | ||
630 | - $a.find('.info').html(text); | ||
631 | } | 635 | } |
632 | - | 636 | + }, |
637 | + error: function() { | ||
633 | } | 638 | } |
634 | - }, | ||
635 | - error: function() { | ||
636 | - } | ||
637 | - }); | 639 | + }); |
640 | + } | ||
638 | 641 | ||
639 | if ($('#identity-success').length > 0) { | 642 | if ($('#identity-success').length > 0) { |
640 | // xls-4学生认证成功埋点 | 643 | // xls-4学生认证成功埋点 |
-
Please register or login to post a comment