Commit 01bdaacbd4cd8b803d4baca42162c6aa2406cfa6
1 parent
ab01a6c4
1、会员赠品限赠1次,提交订单有送赠品未支付,取消订单,已赠数会退回,但此时再去购买优惠商品就不再显示赠品了
2、优惠活动减,从购物车提交订单取的是商品金额减去优惠金额去判断是否符合全场包邮, 但是从商品详情进入点击立即购买取的是商品金额去判断是否符合全场包邮,要优化减去优惠金额后再判断 3、公众号搭配促销可以使用优惠券,但是小程序的不行 4、会出现购买搭配促销商品,使用余额提交还会跳转到微信支会界面 5、一个订单里有一个是做优惠促销限制使用优惠券的商品和 一个可以正常使用优惠券的商品,小程序订单界面未能显示优惠券
Showing
1 changed file
with
38 additions
and
22 deletions
pages/cart/cart2/cart2.js
@@ -625,6 +625,7 @@ Page({ | @@ -625,6 +625,7 @@ Page({ | ||
625 | }else{ | 625 | }else{ |
626 | c_arr[i].exp_type = th.data.bn_exp_type; //配送方式 | 626 | c_arr[i].exp_type = th.data.bn_exp_type; //配送方式 |
627 | c_arr[i].wind = th.data.index; //立即购买选择的物流 | 627 | c_arr[i].wind = th.data.index; //立即购买选择的物流 |
628 | + //c_arr[i].=th.data. //立即购买的使用余额 | ||
628 | if(th.data.cartlist) c_arr[i].check_quan_price_list= th.data.cartlist[i].check_quan_price_list; //优惠券优惠什么商品价格 | 629 | if(th.data.cartlist) c_arr[i].check_quan_price_list= th.data.cartlist[i].check_quan_price_list; //优惠券优惠什么商品价格 |
629 | if(th.data.cartlist) c_arr[i].check_quan_ware_list= th.data.cartlist[i].check_quan_ware_list; //优惠券优惠什么商品 | 630 | if(th.data.cartlist) c_arr[i].check_quan_ware_list= th.data.cartlist[i].check_quan_ware_list; //优惠券优惠什么商品 |
630 | } | 631 | } |
@@ -642,6 +643,10 @@ Page({ | @@ -642,6 +643,10 @@ Page({ | ||
642 | } | 643 | } |
643 | var f_o_price=o_price; | 644 | var f_o_price=o_price; |
644 | var prom_g=th.data.prom_goods_map[pickid]; | 645 | var prom_g=th.data.prom_goods_map[pickid]; |
646 | + | ||
647 | + //判断包邮券的钱 | ||
648 | + var q_conditin=0; | ||
649 | + q_conditin=o_price; | ||
645 | //---如果该门店的相关活动,就要算一下减价-- | 650 | //---如果该门店的相关活动,就要算一下减价-- |
646 | if(th.data.prom_goods_map[pickid]){ | 651 | if(th.data.prom_goods_map[pickid]){ |
647 | var ob=th.data.prom_goods_map[pickid]; | 652 | var ob=th.data.prom_goods_map[pickid]; |
@@ -689,11 +694,8 @@ Page({ | @@ -689,11 +694,8 @@ Page({ | ||
689 | item[j].is_past= item_map.is_past; | 694 | item[j].is_past= item_map.is_past; |
690 | } | 695 | } |
691 | } | 696 | } |
692 | - | ||
693 | - var q_conditin=0; | ||
694 | - //判断包邮券的钱 | ||
695 | - q_conditin=o_price; | ||
696 | - if(!item_map.is_xz_yh) q_conditin=o_price-item_map.price; | 697 | + //有活动,且优惠活动并没有限制使用优惠券,且有减价 |
698 | + //if(item_map && !item_map.is_xz_yh && item_map.price) q_conditin=o_price-item_map.price; | ||
697 | //--看有没有减价-- | 699 | //--看有没有减价-- |
698 | if(item_map.prom_price && item_map.price-item_map.prom_price){ | 700 | if(item_map.prom_price && item_map.price-item_map.prom_price){ |
699 | if(cart_item.prom_pt_json){ | 701 | if(cart_item.prom_pt_json){ |
@@ -740,7 +742,7 @@ Page({ | @@ -740,7 +742,7 @@ Page({ | ||
740 | } | 742 | } |
741 | } | 743 | } |
742 | 744 | ||
743 | - cart_item.goods_price = o_price.toFixed(2); //商品总费用 | 745 | + cart_item.goods_price = f_o_price.toFixed(2); //商品总费用,用f_o_price来计算 |
744 | //计算物流费用 | 746 | //计算物流费用 |
745 | cart_item.shipping_price = 0; | 747 | cart_item.shipping_price = 0; |
746 | 748 | ||
@@ -961,18 +963,33 @@ Page({ | @@ -961,18 +963,33 @@ Page({ | ||
961 | cart_item.total_amount= cart_item.total_amount.toFixed(2); | 963 | cart_item.total_amount= cart_item.total_amount.toFixed(2); |
962 | cart_item.order_amount=cart_item.order_amount.toFixed(2); | 964 | cart_item.order_amount=cart_item.order_amount.toFixed(2); |
963 | 965 | ||
964 | - //--------------如果使用余额--------------------- | ||
965 | - if (th.data.js_use_money == 1) { | ||
966 | - if (umoney > cart_item.order_amount) { | ||
967 | - cart_item.user_money = cart_item.order_amount; | ||
968 | - umoney = umoney - cart_item.order_amount; | ||
969 | - }else { | ||
970 | - cart_item.user_money = umoney; | ||
971 | - umoney=0; | ||
972 | - } | 966 | + //搭配购在使用余额 |
967 | + if(th.data.bn_use_money==1 && th.data.is_b_now==1){ | ||
968 | + | ||
969 | + if (umoney > cart_item.order_amount) { | ||
970 | + cart_item.user_money = cart_item.order_amount; | ||
971 | + umoney = umoney - cart_item.order_amount; | ||
972 | + }else { | ||
973 | + cart_item.user_money = umoney; | ||
974 | + umoney=0; | ||
975 | + } | ||
976 | + | ||
973 | }else{ | 977 | }else{ |
974 | - cart_item.user_money=0; | ||
975 | - } | 978 | + //--------------如果使用余额,购物车购买--------------------- |
979 | + if (th.data.js_use_money == 1) { | ||
980 | + if (umoney > cart_item.order_amount) { | ||
981 | + cart_item.user_money = cart_item.order_amount; | ||
982 | + umoney = umoney - cart_item.order_amount; | ||
983 | + }else { | ||
984 | + cart_item.user_money = umoney; | ||
985 | + umoney=0; | ||
986 | + } | ||
987 | + }else{ | ||
988 | + cart_item.user_money=0; | ||
989 | + } | ||
990 | + } | ||
991 | + | ||
992 | + | ||
976 | 993 | ||
977 | cart_item.user_money = parseFloat(cart_item.user_money).toFixed(2); | 994 | cart_item.user_money = parseFloat(cart_item.user_money).toFixed(2); |
978 | 995 | ||
@@ -1052,9 +1069,9 @@ Page({ | @@ -1052,9 +1069,9 @@ Page({ | ||
1052 | 1069 | ||
1053 | var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; | 1070 | var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; |
1054 | //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮---------- | 1071 | //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮---------- |
1055 | - if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past!=1 && good.is_xz_yh!=1){ | 1072 | + if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past!=1 ){ |
1056 | //看是不是有调用过包邮券 | 1073 | //看是不是有调用过包邮券 |
1057 | - if(!th.data.isget_by_quan[th.data.bn_pick]){ | 1074 | + if(!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh!=1){ |
1058 | var condition=allpice-cut_price; | 1075 | var condition=allpice-cut_price; |
1059 | //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额--- | 1076 | //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额--- |
1060 | getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea",{ | 1077 | getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea",{ |
@@ -1603,7 +1620,7 @@ Page({ | @@ -1603,7 +1620,7 @@ Page({ | ||
1603 | 1620 | ||
1604 | if (pdata.length==0) return; | 1621 | if (pdata.length==0) return; |
1605 | var str = JSON.stringify(pdata); | 1622 | var str = JSON.stringify(pdata); |
1606 | - | 1623 | + |
1607 | wx.showLoading({title: "加载中"}); | 1624 | wx.showLoading({title: "加载中"}); |
1608 | wx.request({ | 1625 | wx.request({ |
1609 | url: oo.url + '/api/weshop/order/createWxdOrder', | 1626 | url: oo.url + '/api/weshop/order/createWxdOrder', |
@@ -2245,7 +2262,6 @@ Page({ | @@ -2245,7 +2262,6 @@ Page({ | ||
2245 | } | 2262 | } |
2246 | } | 2263 | } |
2247 | if(!is_find) arr.push(item); | 2264 | if(!is_find) arr.push(item); |
2248 | - | ||
2249 | } | 2265 | } |
2250 | return arr; | 2266 | return arr; |
2251 | }, | 2267 | }, |
@@ -2391,9 +2407,9 @@ Page({ | @@ -2391,9 +2407,9 @@ Page({ | ||
2391 | //如果有限制使用优惠券,就要返回 | 2407 | //如果有限制使用优惠券,就要返回 |
2392 | if(gd.prom_type==3){ | 2408 | if(gd.prom_type==3){ |
2393 | if(th.data.prom_goods_map[pickup_id][gd.prom_id].is_xz_yh) continue; | 2409 | if(th.data.prom_goods_map[pickup_id][gd.prom_id].is_xz_yh) continue; |
2394 | - is_xz_yh=0; | ||
2395 | th.data.prom_goods_map[pickup_id][gd.prom_id].coupon_sele=1; | 2410 | th.data.prom_goods_map[pickup_id][gd.prom_id].coupon_sele=1; |
2396 | } | 2411 | } |
2412 | + is_xz_yh=0; | ||
2397 | var item_price=gd.goods_price*gd.goods_num; | 2413 | var item_price=gd.goods_price*gd.goods_num; |
2398 | ckeck_quan_price+=item_price; | 2414 | ckeck_quan_price+=item_price; |
2399 | //--组装价格list-- | 2415 | //--组装价格list-- |