diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index 282a3a0..9a6120f 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -2065,7 +2065,12 @@ Page({ } } - //调用函数计算每件商品的单价 + for (var i in c_arr) { + var cart_item = c_arr[i]; + cart_item.prom_pt_json=[]; + } + + //调用函数计算每件商品的单价 await th.calc_per(c_arr); //调用函数计算每件组合购商品的单价, @@ -2152,6 +2157,8 @@ Page({ var whsle_goods_price = 0; + var no_zh_all_quan_num=0; //不是组合购商品的使用的优惠券综合 + //--------循环计算总价----------- for (var jc = 0; jc < item.length; jc++) { @@ -2175,7 +2182,9 @@ Page({ if (is_no_zh) { o_price_no_zh += item[jc].goods_price * item[jc].goods_num; + if(item[jc].quan_num && item[jc].quan_num>0) no_zh_all_quan_num += item[jc].quan_num; } + o_price += item[jc].goods_price * item[jc].goods_num; //--- 秒杀, 团购的时候,判断有没有订单优惠和包邮模板的叠加 --- @@ -2246,9 +2255,17 @@ Page({ var quan_no_goods_arr = null; var ord_prom = null; + + var ord_prom_condition=0; + if(o_price_no_zh){ + ord_prom_condition=o_price_no_zh-whsle_goods_price-no_zh_all_quan_num; + }else{ + ord_prom_condition=o_price - quan_price - whsle_goods_price - no_order_yh; + } + //---判断是不是有订单优惠--- await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", { - data: { store_id: os.stoid, orderAmount: parseFloat(o_price - quan_price - whsle_goods_price - no_order_yh).toFixed(2), user_id: getApp().globalData.user_id } + data: { store_id: os.stoid, orderAmount: parseFloat(ord_prom_condition).toFixed(2), user_id: getApp().globalData.user_id } }).then(res => { if (res.data.code == 0) { ord_prom = res.data.data; @@ -2301,6 +2318,11 @@ Page({ } + + + + + //-- 如果没有订单优惠,或者订单优惠中有勾选包邮模板 -- if (!ord_prom || ord_prom.is_post_temp) { var user_addr = th.data.user_addr; @@ -2476,11 +2498,11 @@ Page({ //看一下是不是不用组合购的订单优惠的叠加 if (is_has_zh) { - o_condition = o_price_no_zh - quan_price; + o_condition = o_price_no_zh - no_zh_all_quan_num; } //看一下是不是不用组合购的订单优惠的叠加 if (is_has_ladder) { - o_condition = o_price_no_zh - quan_price; + o_condition = o_price_no_zh - no_zh_all_quan_num; } if (whsle_goods_price > 0) { @@ -2492,6 +2514,7 @@ Page({ if (no_order_yh) { o_condition = o_condition - no_order_yh; t_o_condition = t_o_condition - no_order_yh; + o_price_no_zh = o_price_no_zh - no_order_yh; } var order_m = 0; @@ -5994,6 +6017,7 @@ Page({ var bn_coll= this.selectComponent('#bn_coll'); bn_coll.clear_sele(); this.setData({ collocation_goods: [] }); + this.data.old_cartlist=null; //让主商品的活动变成5,搭配购 if(this.data.bn_goods==5) this.setData({ 'bn_goods.prom_type': 0, 'bn_goods.prom_id': 0 }); diff --git a/packageE/pages/user/punchInhistory/punchInhistory.wxss b/packageE/pages/user/punchInhistory/punchInhistory.wxss index 3da3215..8030a6b 100644 --- a/packageE/pages/user/punchInhistory/punchInhistory.wxss +++ b/packageE/pages/user/punchInhistory/punchInhistory.wxss @@ -267,7 +267,7 @@ page{ .tiny_box2 { display: flex; flex-direction: column; - width: 40%; + width: 100%; } .tiny_box3 { display: flex; diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 2b106f6..c0a57ad 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -2033,7 +2033,7 @@ Page({ //----先看会员在购物车中是否加入了该商品,立即购买的----- getApp().request.get("/api/weshop/cart/page", { data: { - store_id: e.data.stoid, + store_id: os.stoid, user_id: oo.user_id, state: 1 }, @@ -2070,7 +2070,7 @@ Page({ //----先看会员在购物车中是否加入了该商品,立即购买的----- getApp().request.get("/api/weshop/cart/page", { data: { - store_id: e.data.stoid, + store_id: os.stoid, user_id: oo.user_id, state: 1 }, @@ -2105,7 +2105,7 @@ Page({ //----先看会员在购物车中是否加入了该商品,立即购买的----- getApp().request.get("/api/weshop/cart/page", { data: { - store_id: e.data.stoid, + store_id: os.stoid, user_id: oo.user_id, state: 1 }, @@ -2155,7 +2155,7 @@ Page({ //----先看会员在购物车中是否加入了该商品,立即购买的----- getApp().request.get("/api/weshop/cart/page", { data: { - store_id: e.data.stoid, + store_id: os.stoid, user_id: oo.user_id, state: 1 }, @@ -5093,7 +5093,7 @@ Page({ //----先看会员在购物车中是否加入了该商品,立即购买的----- getApp().request.get("/api/weshop/cart/page", { data: { - store_id: e.store_id, + store_id: os.stoid, user_id: oo.user_id, state: 1 }, @@ -5102,7 +5102,7 @@ Page({ if (res.data.code == 0 && res.data.data.total > 0) { for (let j in res.data.data.pageData) { let item_j = res.data.data.pageData[j]; - var url = '/api/weshop/cart/del/' + e.data.stoid + '/' + item_j.id; + var url = '/api/weshop/cart/del/' + os.stoid + '/' + item_j.id; getApp().request.delete(url, {}); } } @@ -7484,11 +7484,12 @@ Page({ var is_ok=1; - if (r_data.ladderLists) { var act_id = r_data.ladderLists[0].form_id; //-- 判断会员能不能参与阶梯促销 -- await getApp().request.promiseGet("/api/weshop/prom/ladderForm/getNew/" + os.stoid + "/" + user_id + "/" + act_id, {}).then(res => { + + if (res.data.code == 0 && res.data.data) { var prom_content = ""; //暂定优惠促销还不能重叠 @@ -7520,6 +7521,13 @@ Page({ return false; } + obj = { + act_id: 0, + prom_type:0 + } + back(obj); + + } } })