Commit 9ef2e7b5214860f89c53ebb2e9558091a985a59c
1 parent
420105c7
购物车凑单显示的优化
Showing
2 changed files
with
19 additions
and
11 deletions
pages/cart/cart/cart.wxml
@@ -193,16 +193,7 @@ | @@ -193,16 +193,7 @@ | ||
193 | <view class="flex jc_sb fs28" wx:for="{{item.make_up_arr}}" style="margin-bottom: 20rpx" > | 193 | <view class="flex jc_sb fs28" wx:for="{{item.make_up_arr}}" style="margin-bottom: 20rpx" > |
194 | <view class="ellipsis-1" style="width: 80%">再买<text class="co-red">{{item.diff}}<text wx:if="{{item.diff_type==0}}">元</text> | 194 | <view class="ellipsis-1" style="width: 80%">再买<text class="co-red">{{item.diff}}<text wx:if="{{item.diff_type==0}}">元</text> |
195 | <text wx:if="{{item.diff_type==1}}">件</text> | 195 | <text wx:if="{{item.diff_type==1}}">件</text> |
196 | - </text>, | ||
197 | - <text wx:if="{{item.content.is_money==1}}">免{{item.content.money}}元|</text> | ||
198 | - <text wx:if="{{item.content.is_sale==1}}">打{{item.content.sale}}折|</text> | ||
199 | - <text wx:if="{{item.content.is_past==1}}">包邮|</text> | ||
200 | - <text wx:if="{{item.content.is_coupon==1}}">送优惠券|</text> | ||
201 | - <text wx:if="{{item.content.is_int==1}}">送积分|</text> | ||
202 | - <text wx:if="{{item.content.is_gift==1}}">送赠品|</text> | ||
203 | - <text wx:if="{{item.content.is_libao==1}}">送礼包|</text> | ||
204 | - <text wx:if="{{item.content.is_zxlibao==1}}">送专享礼包|</text> | ||
205 | - <text wx:if="{{item.content.is_monthgiftbag==1}}">送每月礼包|</text> | 196 | + </text>,{{g_filter.map_str(item.content)}} |
206 | <text></text> | 197 | <text></text> |
207 | </view> | 198 | </view> |
208 | <view class="co-red" data-prom_id="{{item.prom_id}}" bindtap="go_cou_dang">去凑单></view> | 199 | <view class="co-red" data-prom_id="{{item.prom_id}}" bindtap="go_cou_dang">去凑单></view> |
pages/cart/cart/g_filter.wxs
@@ -35,6 +35,22 @@ var g_filters = { | @@ -35,6 +35,22 @@ 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 | + | ||
40 | + //判断一下文件末尾的|号,促销显示送的内容 | ||
41 | + map_str:function (content){ | ||
42 | + var string=''; | ||
43 | + if(content.is_money==1) string+='免'+content.money+'元|'; | ||
44 | + if(content.is_sale==1) string+="打"+item.content.sale+"折|"; | ||
45 | + if(content.is_past==1) string+= "包邮|"; | ||
46 | + if(content.is_coupon==1) string+="送优惠券|"; | ||
47 | + if(content.is_int==1) string+="送积分|"; | ||
48 | + if(content.is_gift==1) string+="送赠品|"; | ||
49 | + if(content.is_libao==1) string+="送礼包|"; | ||
50 | + if(content.is_zxlibao==1) string+="送专享礼包|"; | ||
51 | + if(content.is_monthgiftbag==1) string+="送每月礼包|"; | ||
52 | + string=string.substring(0,string.length-1); | ||
53 | + return string | ||
38 | } | 54 | } |
39 | 55 | ||
40 | } | 56 | } |
@@ -44,5 +60,6 @@ module.exports = { | @@ -44,5 +60,6 @@ module.exports = { | ||
44 | end_time: g_filters.end_time, | 60 | end_time: g_filters.end_time, |
45 | toFix: g_filters.toFix, | 61 | toFix: g_filters.toFix, |
46 | is_more_act: g_filters.is_more_act, | 62 | is_more_act: g_filters.is_more_act, |
47 | - check_show:g_filters.check_show | 63 | + check_show:g_filters.check_show, |
64 | + map_str:g_filters.map_str | ||
48 | } | 65 | } |
49 | \ No newline at end of file | 66 | \ No newline at end of file |