Commit 570ab1d3731e02856438f3b059509e6dcb7d331d

Authored by yvan.ni
1 parent dfc3838e

1、购物车的优化

2、确认订单页面的优化
packageE/pages/cart/cart2/cart2.wxml
@@ -120,6 +120,7 @@ @@ -120,6 +120,7 @@
120 <!-- 新增促销多活动的排版,单商品的时候 --> 120 <!-- 新增促销多活动的排版,单商品的时候 -->
121 <block wx:if="{{(util.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)}}"> 121 <block wx:if="{{(util.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)}}">
122 <view class="bdb16" wx:if="{{util.check_show(items,item.show_can_cx[items.goods_id].cur_act.prom_type)}}"> 122 <view class="bdb16" wx:if="{{util.check_show(items,item.show_can_cx[items.goods_id].cur_act.prom_type)}}">
  123 +
123 <view bindtap="switch_cx_group" 124 <view bindtap="switch_cx_group"
124 data-index="{{pidx}}" 125 data-index="{{pidx}}"
125 data-gd_key="{{items.goods_id}}" 126 data-gd_key="{{items.goods_id}}"
@@ -144,26 +145,50 @@ @@ -144,26 +145,50 @@
144 <!-- 新增促销多活动的排版,多商品的时候 --> 145 <!-- 新增促销多活动的排版,多商品的时候 -->
145 <block wx:if="{{item.show_can_cx}}"> 146 <block wx:if="{{item.show_can_cx}}">
146 <block wx:for="{{item.show_can_cx}}" wx:for-item="pitem"> 147 <block wx:for="{{item.show_can_cx}}" wx:for-item="pitem">
147 - <view class="bdb16" wx:if="{{pitem.is_duo_gd && pitem.act_arr.length>1 && util.check_is_last(index,items.goods_id,items.is_act_last,pitem.cur_act.prom_type) }}" >  
148 -  
149 - <view bindtap="switch_cx_group"  
150 - data-index="{{pidx}}"  
151 - data-gd_key="{{index}}"  
152 - class="cx-frame flex" style="position: relative">  
153 - <view class="cx-sizs fs30">促销</view>  
154 - <view class="flex ai_c f1 pdh20">  
155 - <view class="xc-coupon-fram" wx:for="{{pitem.act_arr}}" >  
156 - <view wx:if="{{item.prom_type==3}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">优惠促销</view>  
157 - <view wx:if="{{item.prom_type==5}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">搭配促销</view>  
158 - <view wx:if="{{item.prom_type==7}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">组合购</view>  
159 - <view wx:if="{{item.prom_type==10}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">阶梯促销</view> 148 +
  149 + <block wx:if="{{ pitem.sele_prom_type==7 || pitem.sele_prom_type==10 }}">
  150 + <view class="bdb16" wx:if="{{items.is_act_last}}" >
  151 + <view bindtap="switch_cx_group"
  152 + data-index="{{pidx}}"
  153 + data-gd_key="{{index}}"
  154 + class="cx-frame flex" style="position: relative">
  155 + <view class="cx-sizs fs30">促销</view>
  156 + <view class="flex ai_c f1 pdh20">
  157 + <view class="xc-coupon-fram" wx:for="{{pitem.act_arr}}" >
  158 + <view wx:if="{{item.prom_type==3}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">优惠促销</view>
  159 + <view wx:if="{{item.prom_type==5}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">搭配促销</view>
  160 + <view wx:if="{{item.prom_type==7}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">组合购</view>
  161 + <view wx:if="{{item.prom_type==10}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">阶梯促销</view>
  162 + </view>
  163 + </view>
  164 + <view class="cx-obtain-coupon wsize">
  165 + <text class="bg_jj"></text>
160 </view> 166 </view>
161 </view> 167 </view>
162 - <view class="cx-obtain-coupon wsize">  
163 - <text class="bg_jj"></text> 168 + </view>
  169 + </block>
  170 + <block wx:else>
  171 + <view class="bdb16" wx:if="{{pitem.is_duo_gd && pitem.act_arr.length>1 && util.check_is_last(index,items.goods_id,items.is_act_last) }}" >
  172 + <view bindtap="switch_cx_group"
  173 + data-index="{{pidx}}"
  174 + data-gd_key="{{index}}"
  175 + class="cx-frame flex" style="position: relative">
  176 + <view class="cx-sizs fs30">促销</view>
  177 + <view class="flex ai_c f1 pdh20">
  178 + <view class="xc-coupon-fram" wx:for="{{pitem.act_arr}}" >
  179 + <view wx:if="{{item.prom_type==3}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">优惠促销</view>
  180 + <view wx:if="{{item.prom_type==5}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">搭配促销</view>
  181 + <view wx:if="{{item.prom_type==7}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">组合购</view>
  182 + <view wx:if="{{item.prom_type==10}}" class="xc-coupon t-c four-level-word {{!item.sele?'gray':'' }} ">阶梯促销</view>
  183 + </view>
  184 + </view>
  185 + <view class="cx-obtain-coupon wsize">
  186 + <text class="bg_jj"></text>
  187 + </view>
164 </view> 188 </view>
165 </view> 189 </view>
166 - </view> 190 + </block>
  191 +
167 </block> 192 </block>
168 </block> 193 </block>
169 194
packageE/pages/cart/cart2/filter.wxs
@@ -21,12 +21,12 @@ function check_show(items,sele_prom_type){ @@ -21,12 +21,12 @@ function check_show(items,sele_prom_type){
21 return true; 21 return true;
22 } 22 }
23 23
24 -//prom_type活动类型 24 +
25 //goods_id 商品的id 25 //goods_id 商品的id
26 //index多活动的索引 26 //index多活动的索引
27 //is_act_last 是不是最后一个 27 //is_act_last 是不是最后一个
28 28
29 -function check_is_last(index,goods_id,is_act_last,prom_type){ 29 +function check_is_last(index,goods_id,is_act_last){
30 var gd_arr=index.split(','); 30 var gd_arr=index.split(',');
31 var idx=-1; 31 var idx=-1;
32 //-- 判断有没有包含商品 -- 32 //-- 判断有没有包含商品 --
@@ -40,11 +40,6 @@ function check_is_last(index,goods_id,is_act_last,prom_type){ @@ -40,11 +40,6 @@ function check_is_last(index,goods_id,is_act_last,prom_type){
40 if(idx<0){ 40 if(idx<0){
41 return false; 41 return false;
42 } 42 }
43 - //阶梯促销和组合购有判断活动的最后一个商品  
44 - if([7,10].indexOf(prom_type)>-1){  
45 - if(is_act_last==0) return false;  
46 - return true  
47 - }  
48 //-- 判断是不是活动的最后一个商品 -- 43 //-- 判断是不是活动的最后一个商品 --
49 if(idx==gd_arr.length-1){ 44 if(idx==gd_arr.length-1){
50 return true; 45 return true;
utils/more_cx.js
@@ -623,7 +623,7 @@ module.exports = { @@ -623,7 +623,7 @@ module.exports = {
623 can_calc_cx[p].goods.map(function (gd){ 623 can_calc_cx[p].goods.map(function (gd){
624 ch_map.push(gd.goods_id); 624 ch_map.push(gd.goods_id);
625 }) 625 })
626 - ch_map.sort(); 626 + //ch_map.sort();
627 //-- 先找一下,有没有参与的商品一模一样的 -- 627 //-- 先找一下,有没有参与的商品一模一样的 --
628 var fd=show_can_cx[ch_map.join()]; 628 var fd=show_can_cx[ch_map.join()];
629 if(fd){ 629 if(fd){
@@ -681,6 +681,7 @@ module.exports = { @@ -681,6 +681,7 @@ module.exports = {
681 k_item.act_arr[ij].sele=1; 681 k_item.act_arr[ij].sele=1;
682 ck_prom_type= k_item.act_arr[ij]; 682 ck_prom_type= k_item.act_arr[ij];
683 k_item.cur_act=ck_prom_type; 683 k_item.cur_act=ck_prom_type;
  684 + k_item.sele_prom_type=ck_prom_type.prom_type;
684 } 685 }
685 } 686 }
686 } 687 }
@@ -692,6 +693,7 @@ module.exports = { @@ -692,6 +693,7 @@ module.exports = {
692 k_item.act_arr[0].sele=1; 693 k_item.act_arr[0].sele=1;
693 //-- 把当前活动进行赋值 -- 694 //-- 把当前活动进行赋值 --
694 k_item.cur_act=ck_prom_type; 695 k_item.cur_act=ck_prom_type;
  696 + k_item.sele_prom_type=ck_prom_type.prom_type;
695 } 697 }
696 698
697 //-- 如果是要控制数量的时候,也就是全选的时候,或者加减号的时候 -- 699 //-- 如果是要控制数量的时候,也就是全选的时候,或者加减号的时候 --