Commit fc8fd8a50a1ce217878cea477bc7d4f3017c53d5
1 parent
b7299f21
多促销的优化
Showing
3 changed files
with
15 additions
and
6 deletions
packageE/pages/cart/cart2/cart2.js
@@ -754,9 +754,13 @@ Page({ | @@ -754,9 +754,13 @@ Page({ | ||
754 | if(carr.length==1){ | 754 | if(carr.length==1){ |
755 | var item1=carr[0]; | 755 | var item1=carr[0]; |
756 | await th.buy_pro_group(item1,1); | 756 | await th.buy_pro_group(item1,1); |
757 | - if(item1.prom_type==0 && item1.more_cx){ | ||
758 | - //-- 对活动进行排序 -- | ||
759 | - th.cx_prom_group(item1.more_cx); | 757 | + |
758 | + if(item1.more_cx){ | ||
759 | + //-- 对活动进行排序 -- | ||
760 | + th.cx_prom_group(item1.more_cx); | ||
761 | + } | ||
762 | + | ||
763 | + if(item1.prom_type==0){ | ||
760 | item1.prom_type=item1.more_cx[0].prom_type; | 764 | item1.prom_type=item1.more_cx[0].prom_type; |
761 | item1.prom_type=item1.more_cx[0].prom_id; | 765 | item1.prom_type=item1.more_cx[0].prom_id; |
762 | } | 766 | } |
pages/cart/cart/cart.js
@@ -2193,6 +2193,8 @@ Page({ | @@ -2193,6 +2193,8 @@ Page({ | ||
2193 | } | 2193 | } |
2194 | } | 2194 | } |
2195 | }); | 2195 | }); |
2196 | + | ||
2197 | + | ||
2196 | } | 2198 | } |
2197 | //-- 切换活动的按钮要把他返回 -- | 2199 | //-- 切换活动的按钮要把他返回 -- |
2198 | this.data.change_act=0; | 2200 | this.data.change_act=0; |
@@ -3049,6 +3051,8 @@ Page({ | @@ -3049,6 +3051,8 @@ Page({ | ||
3049 | goods_id: i_arr[j].goods_id, | 3051 | goods_id: i_arr[j].goods_id, |
3050 | id: i_arr[j].id, | 3052 | id: i_arr[j].id, |
3051 | goods_price: i_arr[j].goods_price, | 3053 | goods_price: i_arr[j].goods_price, |
3054 | + prom_id:i_arr[j].prom_id, | ||
3055 | + prom_type:i_arr[j].prom_type, | ||
3052 | }; | 3056 | }; |
3053 | //判断是不是线下取价 | 3057 | //判断是不是线下取价 |
3054 | if (i_arr[j].is_offline) { | 3058 | if (i_arr[j].is_offline) { |
@@ -4458,6 +4462,7 @@ Page({ | @@ -4458,6 +4462,7 @@ Page({ | ||
4458 | 4462 | ||
4459 | } | 4463 | } |
4460 | func(show_can_cx); | 4464 | func(show_can_cx); |
4465 | + return false; | ||
4461 | } | 4466 | } |
4462 | 4467 | ||
4463 | var th=this; | 4468 | var th=this; |
pages/cart/cart/cart.wxml
@@ -130,7 +130,7 @@ | @@ -130,7 +130,7 @@ | ||
130 | 130 | ||
131 | <!-- 验证活动是不是多个,要不要显示切换 --> | 131 | <!-- 验证活动是不是多个,要不要显示切换 --> |
132 | <!-- 新增促销多活动的排版 --> | 132 | <!-- 新增促销多活动的排版 --> |
133 | - <view class="bdt16" | 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}}"> | 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" | 135 | <view bindtap="switch_cx_group" |
136 | data-index="{{pidx}}" | 136 | data-index="{{pidx}}" |
@@ -158,14 +158,14 @@ | @@ -158,14 +158,14 @@ | ||
158 | <!-- 新增促销多活动的排版 --> | 158 | <!-- 新增促销多活动的排版 --> |
159 | <block wx:if="{{item.show_can_cx}}"> | 159 | <block wx:if="{{item.show_can_cx}}"> |
160 | <block wx:for="{{item.show_can_cx}}" wx:for-item="pitem"> | 160 | <block wx:for="{{item.show_can_cx}}" wx:for-item="pitem"> |
161 | - <view class="bdt16" wx:if="{{pitem.is_duo_gd}}" > | 161 | + <view class="bdb16" wx:if="{{pitem.is_duo_gd}}" > |
162 | <view bindtap="switch_cx_group" | 162 | <view bindtap="switch_cx_group" |
163 | data-index="{{pidx}}" | 163 | data-index="{{pidx}}" |
164 | data-gd_key="{{index}}" | 164 | data-gd_key="{{index}}" |
165 | class="cx-frame flex" style="position: relative"> | 165 | class="cx-frame flex" style="position: relative"> |
166 | <view class="cx-sizs fs30">促销</view> | 166 | <view class="cx-sizs fs30">促销</view> |
167 | <view class="flex ai_c f1 pdh20"> | 167 | <view class="flex ai_c f1 pdh20"> |
168 | - <view class="xc-coupon-fram" wx:for="{{item.show_can_cx[items.goods_id].act_arr}}" > | 168 | + <view class="xc-coupon-fram" wx:for="{{item.show_can_cx[index].act_arr}}" > |
169 | <view wx:if="{{item.prom_type==3}}" class="xc-coupon t-c four-level-word">优惠促销</view> | 169 | <view wx:if="{{item.prom_type==3}}" class="xc-coupon t-c four-level-word">优惠促销</view> |
170 | <view wx:if="{{item.prom_type==5}}" class="xc-coupon t-c four-level-word">搭配促销</view> | 170 | <view wx:if="{{item.prom_type==5}}" class="xc-coupon t-c four-level-word">搭配促销</view> |
171 | <view wx:if="{{item.prom_type==7}}" class="xc-coupon t-c four-level-word">组合购</view> | 171 | <view wx:if="{{item.prom_type==7}}" class="xc-coupon t-c four-level-word">组合购</view> |