Commit 51b91a712b354fd7243d1af30843f0b6f4ff7f4a
1 parent
9d74d2f5
多促销的优化
Showing
2 changed files
with
27 additions
and
17 deletions
pages/cart/cart/cart.wxml
@@ -128,28 +128,31 @@ | @@ -128,28 +128,31 @@ | ||
128 | </view> | 128 | </view> |
129 | </view> | 129 | </view> |
130 | 130 | ||
131 | + | ||
131 | <!-- 验证活动是不是多个,要不要显示切换 --> | 132 | <!-- 验证活动是不是多个,要不要显示切换 --> |
132 | <!-- 新增促销多活动的排版 --> | 133 | <!-- 新增促销多活动的排版 --> |
133 | - <view class="bdb16" | ||
134 | - wx:if="{{g_filter.is_more_act(items,item.show_can_cx) && item.show_can_cx[items.goods_id] && item.show_can_cx[items.goods_id].act_arr.length>1}}"> | ||
135 | - <view bindtap="switch_cx_group" | ||
136 | - data-index="{{pidx}}" | ||
137 | - data-gd_key="{{items.goods_id}}" | ||
138 | - class="cx-frame flex" style="position: relative"> | ||
139 | - <view class="cx-sizs fs30">促销</view> | ||
140 | - <view class="flex ai_c f1 pdh20"> | ||
141 | - <view class="xc-coupon-fram" wx:for="{{item.show_can_cx[items.goods_id].act_arr}}" > | ||
142 | - <view wx:if="{{item.prom_type==3}}" class="xc-coupon t-c four-level-word">优惠促销</view> | ||
143 | - <view wx:if="{{item.prom_type==5}}" class="xc-coupon t-c four-level-word">搭配促销</view> | ||
144 | - <view wx:if="{{item.prom_type==7}}" class="xc-coupon t-c four-level-word">组合购</view> | ||
145 | - <view wx:if="{{item.prom_type==10}}" class="xc-coupon t-c four-level-word">阶梯促销</view> | 134 | + <block wx:if="{{g_filter.is_more_act(items,item.show_can_cx) && item.show_can_cx[items.goods_id] && item.show_can_cx[items.goods_id].act_arr.length>1}}"> |
135 | + <view class="bdb16" wx:if="{{util.check_show(items,item.show_can_cx[items.goods_id].sele_prom_type)}}"> | ||
136 | + <view bindtap="switch_cx_group" | ||
137 | + data-index="{{pidx}}" | ||
138 | + data-gd_key="{{items.goods_id}}" | ||
139 | + class="cx-frame flex" style="position: relative"> | ||
140 | + <view class="cx-sizs fs30">促销</view> | ||
141 | + <view class="flex ai_c f1 pdh20"> | ||
142 | + <view class="xc-coupon-fram" wx:for="{{item.show_can_cx[items.goods_id].act_arr}}" > | ||
143 | + <view wx:if="{{item.prom_type==3}}" class="xc-coupon t-c four-level-word">优惠促销</view> | ||
144 | + <view wx:if="{{item.prom_type==5}}" class="xc-coupon t-c four-level-word">搭配促销</view> | ||
145 | + <view wx:if="{{item.prom_type==7}}" class="xc-coupon t-c four-level-word">组合购</view> | ||
146 | + <view wx:if="{{item.prom_type==10}}" class="xc-coupon t-c four-level-word">阶梯促销</view> | ||
147 | + </view> | ||
148 | + </view> | ||
149 | + <view class="cx-obtain-coupon wsize"> | ||
150 | + <text class="bg_jj"></text> | ||
146 | </view> | 151 | </view> |
147 | - </view> | ||
148 | - <view class="cx-obtain-coupon wsize"> | ||
149 | - <text class="bg_jj"></text> | ||
150 | </view> | 152 | </view> |
151 | </view> | 153 | </view> |
152 | - </view> | 154 | + </block> |
155 | + | ||
153 | 156 | ||
154 | </block > | 157 | </block > |
155 | 158 |
pages/cart/cart/g_filter.wxs
@@ -35,6 +35,12 @@ var g_filters = { | @@ -35,6 +35,12 @@ var g_filters = { | ||
35 | if([1,2,4,6,8,9].indexOf(items.prom_type)>-1) return false; | 35 | if([1,2,4,6,8,9].indexOf(items.prom_type)>-1) return false; |
36 | if(!show_can_cx) return false; | 36 | if(!show_can_cx) return false; |
37 | return true; | 37 | return true; |
38 | + }, | ||
39 | + check_show:function(items,sele_prom_type){ | ||
40 | + if([7,10].indexOf(sele_prom_type)>-1){ | ||
41 | + if(!items.is_act_last) return false; | ||
42 | + } | ||
43 | + return true; | ||
38 | } | 44 | } |
39 | } | 45 | } |
40 | module.exports = { | 46 | module.exports = { |
@@ -43,4 +49,5 @@ module.exports = { | @@ -43,4 +49,5 @@ module.exports = { | ||
43 | end_time: g_filters.end_time, | 49 | end_time: g_filters.end_time, |
44 | toFix: g_filters.toFix, | 50 | toFix: g_filters.toFix, |
45 | is_more_act: g_filters.is_more_act, | 51 | is_more_act: g_filters.is_more_act, |
52 | + check_show:g_filters.check_show | ||
46 | } | 53 | } |
47 | \ No newline at end of file | 54 | \ No newline at end of file |