Commit 5bb027576c70873252f25cdf74ef76e1d36af6c8
1 parent
f23e5534
1. 再来一单的优化
2. 分类的样式的修复
Showing
3 changed files
with
19 additions
and
7 deletions
pages/cart/cart/cart.js
... | ... | @@ -830,13 +830,21 @@ Page({ |
830 | 830 | var g_arr = new Array(); //已选的商品列表 |
831 | 831 | var user_id = getApp().globalData.user_id; |
832 | 832 | var th = this; |
833 | - | |
833 | + //用于判断是不是积分购的普通购买 | |
834 | + var normal_arr={}; | |
834 | 835 | var ab = 0; //选中 |
835 | 836 | wx.showLoading(); |
836 | 837 | for (var i = 0; i < this.data.requestData.length; i++) { |
837 | 838 | var i_arr = this.data.requestData[i].goods; |
839 | + | |
840 | + | |
838 | 841 | for (var j = 0; j < i_arr.length; j++) { |
839 | 842 | if (i_arr[j].selected && i_arr[j].is_gift!=1) { |
843 | + | |
844 | + if(i_arr[j].is_pd_normal) { | |
845 | + normal_arr[i_arr[j].goods_id]=1; | |
846 | + } | |
847 | + | |
840 | 848 | //map 的key是不会重复,会覆盖,, |
841 | 849 | var ie = { |
842 | 850 | goods_id: i_arr[j].goods_id, |
... | ... | @@ -981,13 +989,13 @@ Page({ |
981 | 989 | } |
982 | 990 | } |
983 | 991 | |
984 | - if (num > val.redisnum && val.redisnum) { | |
992 | + if (num > val.redisnum && val.redisnum && !normal_arr[val.goods_id]) { | |
985 | 993 | isok = 0; |
986 | 994 | gname = val.goods_name; |
987 | 995 | throw "超出活动库存"; |
988 | 996 | return false; |
989 | 997 | } |
990 | - if (num > val.goods_num - val.buy_num && val.goods_num) { | |
998 | + if (num > val.goods_num - val.buy_num && val.goods_num && !normal_arr[val.goods_id]) { | |
991 | 999 | isok = 0; |
992 | 1000 | gname = val.goods_name; |
993 | 1001 | throw "超出活动库存"; |
... | ... | @@ -1002,7 +1010,7 @@ Page({ |
1002 | 1010 | return false; |
1003 | 1011 | } |
1004 | 1012 | |
1005 | - if (num + buyed.promgoodsbuynum > val.buy_limit && val.buy_limit > 0) { | |
1013 | + if (num + buyed.promgoodsbuynum > val.buy_limit && val.buy_limit > 0 && !normal_arr[val.goods_id]) { | |
1006 | 1014 | isok = 0; |
1007 | 1015 | gname = val.goods_name; |
1008 | 1016 | throw "超出活动限购"; |
... | ... | @@ -1015,7 +1023,7 @@ Page({ |
1015 | 1023 | if (g_arr[i].goods_id == val.goods_id) { |
1016 | 1024 | |
1017 | 1025 | //如果会员是等级会员,商品有等级价,且不是活动商品 |
1018 | - if(card_field && val[card_field]>0 && (val.prom_type==0 || val.prom_type==3 || val.prom_type==4 || val.prom_type==5) ){ | |
1026 | + if(card_field && val[card_field]>0 && (val.prom_type==0 || val.prom_type==3 || val.prom_type==4 || val.prom_type==5 || normal_arr[val.goods_id]) ){ | |
1019 | 1027 | if (g_arr[i].goods_price != val[card_field]){ |
1020 | 1028 | isok = 0; |
1021 | 1029 | gname = val.goods_name; | ... | ... |
pages/cart/cart2_pt/cart2_pt.js
... | ... | @@ -494,6 +494,8 @@ Page({ |
494 | 494 | if(!th.data.bn_goods.is_normal){ |
495 | 495 | item.is_zsorder=th.data.kt_type+1; //开团类型 |
496 | 496 | } |
497 | + | |
498 | + | |
497 | 499 | |
498 | 500 | if(th.data.qh!='') |
499 | 501 | { |
... | ... | @@ -533,7 +535,9 @@ Page({ |
533 | 535 | item.room_ids=gg.room_id; |
534 | 536 | goods.room_id=gg.room_id; |
535 | 537 | } |
536 | - | |
538 | + | |
539 | + if(th.data.bn_goods.is_normal){goods.is_pd_normal=1;} | |
540 | + | |
537 | 541 | item.order_goods.push(goods); |
538 | 542 | pdata.push(item); |
539 | 543 | ... | ... |