Commit 19eaa3f1cfa0c6173c86383de7e477b60047f754
1 parent
f36f36af
参与活动的优化
Showing
2 changed files
with
24 additions
and
12 deletions
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -1384,8 +1384,12 @@ Page({ |
1384 | 1384 | } |
1385 | 1385 | |
1386 | 1386 | }else{ |
1387 | + | |
1388 | + let obj=arr[k].show_can_cx[key_o]; | |
1387 | 1389 | //不是优惠促销的不参与 不是订单促销参与(订单促销不是实收价的时候) |
1388 | - if( !(arr[k].show_can_cx.no_cj_prom && arr[k].show_can_cx.cur_act.prom_type==3) && !th.data.can_use_ord_prom[arr[k].pick_id]){ | |
1390 | + let ck1=obj.no_cj_prom && obj.cur_act.prom_type==3; | |
1391 | + let ck2=th.data.can_use_ord_prom[arr[k].pickup_id]; | |
1392 | + if( !ck1 && !ck2){ | |
1389 | 1393 | item1.prom_id = arr[k].show_can_cx[key_o].cur_act.prom_id; |
1390 | 1394 | item1.prom_type = arr[k].show_can_cx[key_o].cur_act.prom_type; |
1391 | 1395 | } | ... | ... |
packageE/pages/cart/cart2/cart2.wxml
... | ... | @@ -171,12 +171,17 @@ |
171 | 171 | </block> |
172 | 172 | </block> |
173 | 173 | |
174 | - <view class="set-mes" wx:if="{{items.prom_type==3 || (items.prom_type==0 && item.show_can_cx[items.goods_id].no_cj_prom) }}"> | |
175 | - <view class="use-item" data-pidx="{{pidx}}" data-can_cx_idx="{{items.goods_id}}" bindtap='no_cj_prom'> | |
176 | - <icon color="{{!item.show_can_cx[items.goods_id].no_cj_prom?'red':'gray'}}" size="16" type="success"></icon> | |
177 | - <view class="yu_er">参与优惠活动</view> | |
174 | + <!-- 如果不是点击使用订单促销的话 --> | |
175 | + <block wx:if="{{!can_use_ord_prom[item.pickup_id]}}"> | |
176 | + <view class="set-mes" wx:if="{{items.prom_type==3 || (items.prom_type==0 && item.show_can_cx[items.goods_id].no_cj_prom) }}"> | |
177 | + <view class="use-item" data-pidx="{{pidx}}" data-can_cx_idx="{{items.goods_id}}" bindtap='no_cj_prom'> | |
178 | + <icon color="{{!item.show_can_cx[items.goods_id].no_cj_prom?'red':'gray'}}" size="16" type="success"></icon> | |
179 | + <view class="yu_er">参与优惠活动</view> | |
180 | + </view> | |
178 | 181 | </view> |
179 | - </view> | |
182 | + </block> | |
183 | + | |
184 | + | |
180 | 185 | |
181 | 186 | </block> |
182 | 187 | |
... | ... | @@ -231,12 +236,15 @@ |
231 | 236 | </view> |
232 | 237 | </block> |
233 | 238 | |
234 | - <view class="set-mes" wx:if="{{pitem.is_duo_gd && pitem.sele_prom_type==3 && util.check_is_last(index,items.goods_id) }}"> | |
235 | - <view class="use-item" data-pidx="{{pidx}}" data-can_cx_idx="{{index}}" bindtap='no_cj_prom'> | |
236 | - <icon color="{{!pitem.no_cj_prom?'red':'gray'}}" size="16" type="success"></icon> | |
237 | - <view class="yu_er">参与优惠活动</view> | |
239 | + | |
240 | + <block wx:if="{{!can_use_ord_prom[item.pickup_id]}}"> | |
241 | + <view class="set-mes" wx:if="{{pitem.is_duo_gd && pitem.sele_prom_type==3 && util.check_is_last(index,items.goods_id) }}"> | |
242 | + <view class="use-item" data-pidx="{{pidx}}" data-can_cx_idx="{{index}}" bindtap='no_cj_prom'> | |
243 | + <icon color="{{!pitem.no_cj_prom?'red':'gray'}}" size="16" type="success"></icon> | |
244 | + <view class="yu_er">参与优惠活动</view> | |
245 | + </view> | |
238 | 246 | </view> |
239 | - </view> | |
247 | + </block> | |
240 | 248 | |
241 | 249 | </block> |
242 | 250 | </block> |
... | ... | @@ -1102,7 +1110,7 @@ |
1102 | 1110 | </view> |
1103 | 1111 | <view class="count"> |
1104 | 1112 | <view bindtap="{{items.goods_num <= 1 ? '':'subNum'}}" class="sub fs28 {{items.goods_num <= 1 ? 'active':''}}" data-pitems="{{pidx}}" data-item="{{idx}}">一</view> |
1105 | - <input class="goodadd" bindblur="valueToNum" data-item="{{idx}}" bindinput="refresh_input" data-item="{{idx}}" type="number" value="{{items.goods_num}}"></input> | |
1113 | + <input class="goodadd" bindblur="valueToNum" data-item="{{idx}}" bindinput="refresh_input" type="number" value="{{items.goods_num}}"></input> | |
1106 | 1114 | <view class="add" bindtap="addNum" data-item="{{idx}}">+</view> |
1107 | 1115 | </view> |
1108 | 1116 | </view> | ... | ... |