Commit 52fb28a2c2e72867dbe71dde7ac63754c2b32b11
1 parent
581a5a4f
//只有一种活动,但是又是秒杀之类是互动,就要失效。不能是普通购买
Showing
1 changed file
with
15 additions
and
4 deletions
pages/cart/cart/cart.js
| ... | ... | @@ -672,14 +672,25 @@ Page({ |
| 672 | 672 | }) |
| 673 | 673 | |
| 674 | 674 | //只有一种活动,但是又是秒杀之类是互动,就要失效。不能是普通购买 |
| 675 | - if (prom && prom.length == 1 && [1, 2, 4, 6, 8, 9].indexOf(prom.prom_type) > -1 && !prom.is_integral_normal && !prom.is_pd_normal) { | |
| 675 | + if (prom && prom.length == 1 && [1, 2, 4, 6, 8, 9].indexOf(prom[0].prom_type) > -1 && !item.is_integral_normal && !item.is_pd_normal) { | |
| 676 | 676 | th.disInvalid(item); |
| 677 | 677 | continue; |
| 678 | 678 | } |
| 679 | + | |
| 679 | 680 | //只有秒杀和积分购的时候,不能是普通购买 |
| 680 | - if (prom && prom.length == 2 && [1, 4].indexOf(prom.prom_type) > -1 && [1, 4].indexOf(prom.prom_type) > -1 && !prom.is_integral_normal && !prom.is_pd_normal) { | |
| 681 | - th.disInvalid(item); | |
| 682 | - continue; | |
| 681 | + if (prom && prom.length == 2 && !item.is_integral_normal && !item.is_pd_normal) { | |
| 682 | + var idx=prom.findIndex(function (e){ | |
| 683 | + return e.prom_type==1; | |
| 684 | + }) | |
| 685 | + var idx2=prom.findIndex(function (e){ | |
| 686 | + return e.prom_type==4; | |
| 687 | + }) | |
| 688 | + //--如果是有秒杀和积分的时候-- | |
| 689 | + if(idx>-1 && idx2>-1){ | |
| 690 | + th.disInvalid(item); | |
| 691 | + continue; | |
| 692 | + } | |
| 693 | + | |
| 683 | 694 | } |
| 684 | 695 | |
| 685 | 696 | } | ... | ... |