From 570ab1d3731e02856438f3b059509e6dcb7d331d Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Wed, 5 Jul 2023 23:23:40 +0800 Subject: [PATCH] 1、购物车的优化 2、确认订单页面的优化 --- packageE/pages/cart/cart2/cart2.wxml | 57 +++++++++++++++++++++++++++++++++++++++++---------------- packageE/pages/cart/cart2/filter.wxs | 9 ++------- utils/more_cx.js | 4 +++- 3 files changed, 46 insertions(+), 24 deletions(-) diff --git a/packageE/pages/cart/cart2/cart2.wxml b/packageE/pages/cart/cart2/cart2.wxml index c84ced8..d672039 100644 --- a/packageE/pages/cart/cart2/cart2.wxml +++ b/packageE/pages/cart/cart2/cart2.wxml @@ -120,6 +120,7 @@ + - - - - 促销 - - - 优惠促销 - 搭配促销 - 组合购 - 阶梯促销 + + + + + 促销 + + + 优惠促销 + 搭配促销 + 组合购 + 阶梯促销 + + + + - - + + + + + + 促销 + + + 优惠促销 + 搭配促销 + 组合购 + 阶梯促销 + + + + + - + + diff --git a/packageE/pages/cart/cart2/filter.wxs b/packageE/pages/cart/cart2/filter.wxs index df76675..fe1b3c5 100644 --- a/packageE/pages/cart/cart2/filter.wxs +++ b/packageE/pages/cart/cart2/filter.wxs @@ -21,12 +21,12 @@ function check_show(items,sele_prom_type){ return true; } -//prom_type活动类型 + //goods_id 商品的id //index多活动的索引 //is_act_last 是不是最后一个 -function check_is_last(index,goods_id,is_act_last,prom_type){ +function check_is_last(index,goods_id,is_act_last){ var gd_arr=index.split(','); var idx=-1; //-- 判断有没有包含商品 -- @@ -40,11 +40,6 @@ function check_is_last(index,goods_id,is_act_last,prom_type){ if(idx<0){ return false; } - //阶梯促销和组合购有判断活动的最后一个商品 - if([7,10].indexOf(prom_type)>-1){ - if(is_act_last==0) return false; - return true - } //-- 判断是不是活动的最后一个商品 -- if(idx==gd_arr.length-1){ return true; diff --git a/utils/more_cx.js b/utils/more_cx.js index 1279b2d..1cd5a22 100644 --- a/utils/more_cx.js +++ b/utils/more_cx.js @@ -623,7 +623,7 @@ module.exports = { can_calc_cx[p].goods.map(function (gd){ ch_map.push(gd.goods_id); }) - ch_map.sort(); + //ch_map.sort(); //-- 先找一下,有没有参与的商品一模一样的 -- var fd=show_can_cx[ch_map.join()]; if(fd){ @@ -681,6 +681,7 @@ module.exports = { k_item.act_arr[ij].sele=1; ck_prom_type= k_item.act_arr[ij]; k_item.cur_act=ck_prom_type; + k_item.sele_prom_type=ck_prom_type.prom_type; } } } @@ -692,6 +693,7 @@ module.exports = { k_item.act_arr[0].sele=1; //-- 把当前活动进行赋值 -- k_item.cur_act=ck_prom_type; + k_item.sele_prom_type=ck_prom_type.prom_type; } //-- 如果是要控制数量的时候,也就是全选的时候,或者加减号的时候 -- -- libgit2 0.21.4