1
0
Переглянути джерело

新增业务区分前后台代码

hyq 6 роки тому
батько
коміт
de0a78403b

+ 67 - 35
kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java

@@ -53,13 +53,14 @@ public class ApiCartController extends ApiBaseAction {
      * 获取购物车中的数据
      */
     @GetMapping("getCartMoney")
-    public Object getCartMoney(@LoginUser UserVo loginUser) {
+    public Object getCartMoney(@LoginUser UserVo loginUser, String checkCart) {
         Map<String, Object> resultObj = new HashMap();
         //查询列表数据
         Map param = new HashMap();
         param.put("user_id", loginUser.getId());
         Long storeId = getStoreId();
         param.put("store_id", storeId);
+        param.put("checkCart",checkCart);
         List<CartVo> cartList = cartService.queryList(param);
         //获取购物车统计信息
         Integer goodsCount = 0;
@@ -91,7 +92,7 @@ public class ApiCartController extends ApiBaseAction {
      * 获取购物车中的数据
      */
     @GetMapping("getCart")
-    public Object getCart() {
+    public Object getCart(String checkCart) {
         UserVo loginUser = new UserVo();
         loginUser.setId(getUserId());
         Map<String, Object> resultObj = new HashMap();
@@ -101,8 +102,8 @@ public class ApiCartController extends ApiBaseAction {
         Long storeId = getStoreId();
         param.put("store_id", storeId);
         param.put("merchSn", getMerchSn());
+        param.put("checkCart", checkCart);
         List<CartVo> cartList = cartService.queryList(param);
-
         List<CartVo> validCartList = cartService.queryValidCartList(param);
         //获取购物车统计信息
         Integer goodsCount = 0;
@@ -172,8 +173,14 @@ public class ApiCartController extends ApiBaseAction {
         cartTotal.put("goodsAmount", goodsAmount);
         cartTotal.put("checkedGoodsCount", checkedGoodsCount);
         cartTotal.put("checkedGoodsAmount", checkedGoodsAmount);
-        //
         resultObj.put("cartTotal", cartTotal);
+
+        param.put("checkCart","00");
+        int total00 = cartService.queryTotal(param);
+        param.put("checkCart","11");
+        int total11 = cartService.queryTotal(param);
+        resultObj.put("total00", total00);
+        resultObj.put("total11", total11);
         return resultObj;
     }
 
@@ -216,8 +223,8 @@ public class ApiCartController extends ApiBaseAction {
      * 获取购物车信息,所有对购物车的增删改操作,都要重新返回购物车的信息
      */
     @GetMapping("index")
-    public Object index() {
-        return toResponsSuccess(getCart());
+    public Object index(String checkCart) {
+        return toResponsSuccess(getCart(checkCart));
     }
 
     /**
@@ -229,6 +236,7 @@ public class ApiCartController extends ApiBaseAction {
         Long goodsId = jsonParam.getLong("goodsId");
         Long productId = jsonParam.getLong("productId");
         Integer number = jsonParam.getInteger("number");
+        String checkCart = jsonParam.getString("checkCart");
         //判断商品是否可以购买
         GoodsVo goodsInfo = goodsService.queryObject(goodsId);
         if (null == goodsInfo || goodsInfo.getIs_delete() == 1 || goodsInfo.getIs_on_sale() == 0) {
@@ -291,7 +299,7 @@ public class ApiCartController extends ApiBaseAction {
             cartInfo.setStockNum(productInfo.getStock_num());
             cartService.update(cartInfo);
         }
-        return toResponsSuccess(getCart());
+        return toResponsSuccess(getCart(checkCart));
     }
 
     /**
@@ -301,6 +309,7 @@ public class ApiCartController extends ApiBaseAction {
     public Object addByGoodsId(@LoginUser UserVo loginUser) {
         JSONObject jsonParam = getJsonRequest();
         Long goodsId = jsonParam.getLong("goodsId");
+        String checkCart = jsonParam.getString("checkCart");
         //判断商品是否可以购买
         GoodsVo goodsInfo = goodsService.queryObject(goodsId);
         if (null == goodsInfo || goodsInfo.getIs_delete() == 1 || goodsInfo.getIs_on_sale() == 0) {
@@ -311,7 +320,7 @@ public class ApiCartController extends ApiBaseAction {
         if (0 != MapUtils.getInteger("errno", resultObj)) {
             return toResponsObject(MapUtils.getInteger("errno", resultObj), MapUtils.getString("errmsg", resultObj), "");
         }
-        return toResponsSuccess(getCart());
+        return toResponsSuccess(getCart(checkCart));
     }
 
     /**
@@ -422,14 +431,15 @@ public class ApiCartController extends ApiBaseAction {
         Long productId = jsonParam.getLong("productId");
         Integer number = jsonParam.getInteger("number");
         Integer id = jsonParam.getInteger("id");
+        String checkCart = jsonParam.getString("checkCart");
         boolean isAdd = true;
         //取得规格的信息,判断规格库存
         ProductVo productInfo = productService.queryByStoreId(productId, storeId);
         if (null == productInfo) {
-            return this.toResponsObject(400, "商品已下架", getCart());
+            return this.toResponsObject(400, "商品已下架", getCart(checkCart));
         }
         if(productInfo.getStock_num() == null || number > productInfo.getStock_num() || productInfo.getStock_num() <= 0){
-            return this.toResponsObject(400, "该商品库存不足", getCart());
+            return this.toResponsObject(400, "该商品库存不足", getCart(checkCart));
         }
         String msg = "";
 //        if (productInfo.getStock_num() < number) {
@@ -444,7 +454,7 @@ public class ApiCartController extends ApiBaseAction {
             cartInfo.setNumber(number);
             cartInfo.setStockNum(productInfo.getStock_num());
             cartService.update(cartInfo);
-            return toResponsObject(0, msg, getCart());
+            return toResponsObject(0, msg, getCart(checkCart));
         }
 
         Map cartParam = new HashMap();
@@ -473,7 +483,7 @@ public class ApiCartController extends ApiBaseAction {
             cartInfo.setGoods_specification_ids(productInfo.getGoods_specification_ids());
             cartService.update(cartInfo);
         }
-        return toResponsObject(0, msg, getCart());
+        return toResponsObject(0, msg, getCart(checkCart));
     }
 
     /**
@@ -485,6 +495,7 @@ public class ApiCartController extends ApiBaseAction {
         String productIds = jsonParam.getString("productIds");
         Integer isChecked = jsonParam.getInteger("isChecked");
         String goodsBizType = jsonParam.getString("goodsBizType");
+        String checkCart = jsonParam.getString("checkCart");
         String[] productIdArray = null;
         if(StringUtils.isNullOrEmpty(goodsBizType)) {
             if (StringUtils.isNullOrEmpty(productIds)) {//点击全选时
@@ -500,7 +511,7 @@ public class ApiCartController extends ApiBaseAction {
             }
         }
         cartService.updateCheck(productIdArray, isChecked, loginUser.getId(), getStoreId());
-        return toResponsSuccess(getCart());
+        return toResponsSuccess(getCart(checkCart));
     }
 
     //删除选中的购物车商品,批量删除
@@ -508,11 +519,12 @@ public class ApiCartController extends ApiBaseAction {
     public Object delete(@LoginUser UserVo loginUser) {
         JSONObject jsonObject = getJsonRequest();
         Long cartId = jsonObject.getLong("cartId");
+        String checkCart = jsonObject.getString("checkCart");
         if (null == cartId) {
             return toResponsFail("删除出错");
         }
         cartService.delete(cartId);
-        return toResponsSuccess(getCart());
+        return toResponsSuccess(getCart(checkCart));
     }
 
     //  获取购物车商品的总件件数
@@ -545,7 +557,7 @@ public class ApiCartController extends ApiBaseAction {
      * 订单提交前的检验和填写相关订单信息
      */
     @GetMapping("checkout")
-    public Object checkout(@LoginUser UserVo loginUser, Long userCouponId,String merchSn) {
+    public Object checkout(@LoginUser UserVo loginUser, Long userCouponId, String merchSn, String checkCart) {
         Map<String, Object> resultObj = new HashMap();
         //选择的收货地址
         Map param = new HashMap();
@@ -554,7 +566,7 @@ public class ApiCartController extends ApiBaseAction {
         List<AddressVo> addressEntityList = addressService.queryList(param);
 
         //获取要购买的商品
-        Map<String, Object> cartData = (Map<String, Object>) this.getCartMoney(loginUser);
+        Map<String, Object> cartData = (Map<String, Object>) this.getCartMoney(loginUser,checkCart);
 
         List<CartVo> checkedGoodsList = new ArrayList();
         for (CartVo cartEntity : (List<CartVo>) cartData.get("cartList")) {
@@ -588,23 +600,44 @@ public class ApiCartController extends ApiBaseAction {
         BigDecimal freightPrice11 = new BigDecimal("00");
         //查询运费模板
         for (CartVo vo: checkedGoodsList) {
-            if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_00.getItem())){
-                FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
-                freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice00;
-            }
-            if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem())){
-                FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
-                freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice02;
-            }
-            if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())){
-                FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
-                freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice10;
-            }
-            if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())){
-                FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
-                freightPrice11 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice11;
+            if(org.apache.commons.lang.StringUtils.isEmpty(checkCart)){
+                if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_00.getItem())){
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                    freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice00;
+                }
+                if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem())){
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                    freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice02;
+                }
+                if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())){
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                    freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice10;
+                }
+                if (vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())) {
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                    freightPrice11 = freightEntity != null ? freightEntity.getDefaultFreight() : freightPrice11;
+                }
+            }else{
+                if(Dict.orderBizType.item_11.getItem().equalsIgnoreCase(checkCart)) {
+                    if (vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())) {
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                        freightPrice11 = freightEntity != null ? freightEntity.getDefaultFreight() : freightPrice11;
+                    }
+                }else{
+                    if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_00.getItem())){
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                        freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice00;
+                    }
+                    if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem())){
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                        freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice02;
+                    }
+                    if(vo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())){
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(vo.getGoods_id());
+                        freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice10;
+                    }
+                }
             }
-
         }
         // 计算优惠券 todo 暂时不计算全场金额满减
         BigDecimal fullCutCouponDec = Constant.ZERO;
@@ -620,7 +653,6 @@ public class ApiCartController extends ApiBaseAction {
         //订单的总价
         BigDecimal orderTotalPrice = goodsTotalPrice.add(freightPrice00).add(freightPrice02).add(freightPrice10).add(freightPrice11);
 
-        //
         BigDecimal actualPrice = orderTotalPrice.subtract(fullCutCouponDec).subtract(couponPrice);  //减去其它支付的金额后,要实际支付的金额
 
         resultObj.put("freightPrice00", freightPrice00);
@@ -702,7 +734,7 @@ public class ApiCartController extends ApiBaseAction {
      * @return
      */
     @GetMapping("deleteValidCart")
-    public Object deleteValidCart() {
+    public Object deleteValidCart(String checkCart) {
         try{
             Map param = new HashMap();
             param.put("user_id", getUserId());
@@ -712,7 +744,7 @@ public class ApiCartController extends ApiBaseAction {
             for (CartVo cart: list) {
                 cartService.delete(cart.getId());
             }
-            return toResponsSuccess(getCart());
+            return toResponsSuccess(getCart(checkCart));
         }catch (Exception e){
             return toResponsFail("清空失败");
         }

+ 2 - 1
kmall-api/src/main/java/com/kmall/api/api/ApiFootprintController.java

@@ -106,7 +106,7 @@ public class ApiFootprintController extends ApiBaseAction {
      * 猜你喜欢
      */
     @GetMapping("glist")
-    public Object glist(@LoginUser UserVo loginUser,String storeId) {
+    public Object glist(@LoginUser UserVo loginUser,String storeId,String checkCart) {
         Map resultObj = new HashMap();
 
         //查询列表数据
@@ -117,6 +117,7 @@ public class ApiFootprintController extends ApiBaseAction {
         params.put("order", "desc");
         params.put("bizType", true);
         params.put("store_id", storeId);
+        params.put("checkCart", checkCart);
         List<FootprintVo> footprintVos = footprintService.queryList(params);
         List<FootprintVo> list = new ArrayList();
         if (null != footprintVos) {

+ 16 - 14
kmall-api/src/main/java/com/kmall/api/api/ApiPayController.java

@@ -169,20 +169,22 @@ public class ApiPayController extends ApiBaseAction {
                 } else if (result_code.equalsIgnoreCase(WechatUtil.WXTradeState.SUCCESS.getCode())) {
                     // 添加信息
                     for (OrderVo orderInfo: orderVoList) {
-                        CusPayDataOpenVo cusPayDataOpen = cusPayDataOpenService.queryObjectByOrderNo(orderInfo.getOrder_sn());
-                        if (cusPayDataOpen == null) {
-                            cusPayDataOpen = new CusPayDataOpenVo();
-                            cusPayDataOpen.setMerchOrderSn(merchOrderSn);
-                            cusPayDataOpen.setOrderNo(orderInfo.getOrder_sn());
-                            cusPayDataOpen.setInitalRequest(xml);
-                            cusPayDataOpen.setCreateTime(new Date());
-                            cusPayDataOpen.setModTime(new Date());
-                            cusPayDataOpenService.save(cusPayDataOpen);
-                        } else {
-                            cusPayDataOpen.setMerchOrderSn(merchOrderSn);
-                            cusPayDataOpen.setInitalRequest(xml);
-                            cusPayDataOpen.setModTime(new Date());
-                            cusPayDataOpenService.update(cusPayDataOpen);
+                        if(!orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())) {
+                            CusPayDataOpenVo cusPayDataOpen = cusPayDataOpenService.queryObjectByOrderNo(orderInfo.getOrder_sn());
+                            if (cusPayDataOpen == null) {
+                                cusPayDataOpen = new CusPayDataOpenVo();
+                                cusPayDataOpen.setMerchOrderSn(merchOrderSn);
+                                cusPayDataOpen.setOrderNo(orderInfo.getOrder_sn());
+                                cusPayDataOpen.setInitalRequest(xml);
+                                cusPayDataOpen.setCreateTime(new Date());
+                                cusPayDataOpen.setModTime(new Date());
+                                cusPayDataOpenService.save(cusPayDataOpen);
+                            } else {
+                                cusPayDataOpen.setMerchOrderSn(merchOrderSn);
+                                cusPayDataOpen.setInitalRequest(xml);
+                                cusPayDataOpen.setModTime(new Date());
+                                cusPayDataOpenService.update(cusPayDataOpen);
+                            }
                         }
                     }
 

+ 16 - 14
kmall-api/src/main/java/com/kmall/api/api/pingan/ApiPayPinganController.java

@@ -238,20 +238,22 @@ public class ApiPayPinganController extends ApiBaseAction {
                             orderInfo.setOrder_status(Integer.parseInt(Dict.orderStatus.item_100.getItem()));
                             orderInfo.setPayFlag(Dict.payFlag.item_pingan.getItem());
 
-                            CusPayDataOpenVo cusPayDataOpen = cusPayDataOpenService.queryObjectByOrderNo(orderInfo.getOrder_sn());
-                            if (cusPayDataOpen == null) {
-                                cusPayDataOpen = new CusPayDataOpenVo();
-                                cusPayDataOpen.setMerchOrderSn(merchOrderSn);
-                                cusPayDataOpen.setOrderNo(orderInfo.getOrder_sn());
-                                cusPayDataOpen.setInitalRequest(rspStr);
-                                cusPayDataOpen.setCreateTime(new Date());
-                                cusPayDataOpen.setModTime(new Date());
-                                cusPayDataOpenService.save(cusPayDataOpen);
-                            } else {
-                                cusPayDataOpen.setMerchOrderSn(merchOrderSn);
-                                cusPayDataOpen.setInitalRequest(rspStr);
-                                cusPayDataOpen.setModTime(new Date());
-                                cusPayDataOpenService.update(cusPayDataOpen);
+                            if(!orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())) {
+                                CusPayDataOpenVo cusPayDataOpen = cusPayDataOpenService.queryObjectByOrderNo(orderInfo.getOrder_sn());
+                                if (cusPayDataOpen == null) {
+                                    cusPayDataOpen = new CusPayDataOpenVo();
+                                    cusPayDataOpen.setMerchOrderSn(merchOrderSn);
+                                    cusPayDataOpen.setOrderNo(orderInfo.getOrder_sn());
+                                    cusPayDataOpen.setInitalRequest(rspStr);
+                                    cusPayDataOpen.setCreateTime(new Date());
+                                    cusPayDataOpen.setModTime(new Date());
+                                    cusPayDataOpenService.save(cusPayDataOpen);
+                                } else {
+                                    cusPayDataOpen.setMerchOrderSn(merchOrderSn);
+                                    cusPayDataOpen.setInitalRequest(rspStr);
+                                    cusPayDataOpen.setModTime(new Date());
+                                    cusPayDataOpenService.update(cusPayDataOpen);
+                                }
                             }
                         }
                         orderService.updateBatch(orderVoList);

+ 1 - 1
kmall-api/src/main/java/com/kmall/api/dao/ApiCartMapper.java

@@ -20,7 +20,7 @@ public interface ApiCartMapper extends BaseDao<CartVo> {
 
     void deleteByProductIds(@Param("productIds") String[] productIds, @Param("store_id") Long store_id);
 
-    void deleteByCart(@Param("user_id") Long user_id, @Param("store_id") Long store_id, @Param("checked") Integer checked);
+    void deleteByCart(@Param("user_id") Long user_id, @Param("store_id") Long store_id, @Param("checked") Integer checked,@Param("checkCart")String checkCart);
 
     List<CartVo> queryCartByGoodsBizType(@Param("goodsBizType") String goodsBizType);
 

+ 48 - 20
kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java

@@ -159,6 +159,7 @@ public class ApiOrderService {
         String postscript02 = jsonParam.getString("postscript02");
         String postscript10 = jsonParam.getString("postscript10");
         String postscript11 = jsonParam.getString("postscript11");//留言备注
+        String checkCart = jsonParam.getString("checkCart");//业务区分,11为普通商品,00为保税商品
         UserVo user = apiUserMapper.queryObjectByIdNoAndName(idNo, userName);
         UserVo userVo = new UserVo();
         userVo.setId(loginUser.getId());
@@ -187,6 +188,7 @@ public class ApiOrderService {
         param.put("user_id", loginUser.getId());
         param.put("store_id", storeId);
         param.put("checked", 1);
+        param.put("checkCart", checkCart);
         List<CartVo> checkedGoodsList = apiCartMapper.queryList(param);
         if (null == checkedGoodsList) {
             resultObj.put("errno", 400);
@@ -224,25 +226,51 @@ public class ApiOrderService {
         //订单按业务类型进行分单
         for (CartVo goodsItem : checkedGoodsList) {
             //订单业务类型:00:保税备货, 02:保税展示补货,10:保税展示跨境,11:普通商品
-            if(Dict.orderBizType.item_00.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
-                freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice00;//查询商品运费信息
-                isBizType00 =true;
-            }
-            if(Dict.orderBizType.item_02.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
-                freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice02;//查询商品运费信息
-                isBizType02 =true;
-            }
-            if(Dict.orderBizType.item_10.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
-                freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice10;//查询商品运费信息
-                isBizType10 =true;
-            }
-            if(Dict.orderBizType.item_11.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
-                FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
-                freightPrice11 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice11;//查询商品运费信息
-                isBizType11 =true;
+            if(org.apache.commons.lang.StringUtils.isEmpty(checkCart)){
+                if(Dict.orderBizType.item_11.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                    freightPrice11 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice11;//查询商品运费信息
+                    isBizType11 =true;
+                }
+                if(Dict.orderBizType.item_00.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                    freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice00;//查询商品运费信息
+                    isBizType00 =true;
+                }
+                if(Dict.orderBizType.item_02.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                    freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice02;//查询商品运费信息
+                    isBizType02 =true;
+                }
+                if(Dict.orderBizType.item_10.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
+                    FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                    freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice10;//查询商品运费信息
+                    isBizType10 =true;
+                }
+            }else{
+                if(checkCart.equalsIgnoreCase(Dict.orderBizType.item_11.getItem())){
+                    if(Dict.orderBizType.item_11.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                        freightPrice11 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice11;//查询商品运费信息
+                        isBizType11 =true;
+                    }
+                }else{
+                    if(Dict.orderBizType.item_00.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                        freightPrice00 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice00;//查询商品运费信息
+                        isBizType00 =true;
+                    }
+                    if(Dict.orderBizType.item_02.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                        freightPrice02 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice02;//查询商品运费信息
+                        isBizType02 =true;
+                    }
+                    if(Dict.orderBizType.item_10.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
+                        FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(goodsItem.getGoods_id());
+                        freightPrice10 = freightEntity!=null ? freightEntity.getDefaultFreight() : freightPrice10;//查询商品运费信息
+                        isBizType10 =true;
+                    }
+                }
             }
         }
 
@@ -318,7 +346,7 @@ public class ApiOrderService {
             orderProcessRecordMapper.saveBatch(processRecordEntityList);//新增订单流转信息
 
             //清空已购买的商品
-            apiCartMapper.deleteByCart(loginUser.getId(), storeId, 1);
+            apiCartMapper.deleteByCart(loginUser.getId(), storeId, 1, checkCart);
 
             if (apiOrderMapper.queryCountByMerchOrderSn(merchOrderSn) > 1) {//不止一笔订单则为拆单订单
                 OrderVo orderVo = new OrderVo();

+ 13 - 11
kmall-api/src/main/java/com/kmall/api/service/ApiPayService.java

@@ -141,17 +141,19 @@ public class ApiPayService {
                         processRecordEntityList.add(entity);
                     }
 
-                    CusPayDataOpenVo cusPayDataOpen = cusPayDataOpenMapper.queryObjectByOrderNo(orderInfo.getOrder_sn());
-                    if (cusPayDataOpen != null) {
-                        cusPayDataOpen.setInitalResponse(reponseStr);
-                        cusPayDataOpen.setPayTransactionId(transaction_id);
-                        cusPayDataOpen.setTotalAmount(new BigDecimal(total_fee).divide(Constant.ONE_HUNDRED));
-                        cusPayDataOpen.setVerDept(Dict.verDept.item_3.getItem());
-                        cusPayDataOpen.setPayType(Dict.payType.item_1.getItem());
-                        cusPayDataOpen.setCurrency(Constant.CURRENCY_142);
-                        cusPayDataOpen.setTradingTime(time_end);
-                        cusPayDataOpen.setModTime(new Date());
-                        cusPayDataOpenMapper.update(cusPayDataOpen);
+                    if(!orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())) {
+                        CusPayDataOpenVo cusPayDataOpen = cusPayDataOpenMapper.queryObjectByOrderNo(orderInfo.getOrder_sn());
+                        if (cusPayDataOpen != null) {
+                            cusPayDataOpen.setInitalResponse(reponseStr);
+                            cusPayDataOpen.setPayTransactionId(transaction_id);
+                            cusPayDataOpen.setTotalAmount(new BigDecimal(total_fee).divide(Constant.ONE_HUNDRED));
+                            cusPayDataOpen.setVerDept(Dict.verDept.item_3.getItem());
+                            cusPayDataOpen.setPayType(Dict.payType.item_1.getItem());
+                            cusPayDataOpen.setCurrency(Constant.CURRENCY_142);
+                            cusPayDataOpen.setTradingTime(time_end);
+                            cusPayDataOpen.setModTime(new Date());
+                            cusPayDataOpenMapper.update(cusPayDataOpen);
+                        }
                     }
 
                     orderInfo.setPayTransactionId(transaction_id);

+ 35 - 3
kmall-api/src/main/resources/mybatis/mapper/ApiCartMapper.xml

@@ -57,6 +57,12 @@
         left join mall_product_store_rela psr on psr.product_id = c.id and psr.store_id = #{store_id}
         where 1 = 1  and b.is_delete = 0 and b.is_on_sale = 1
         and psr.stock_num > 0
+        <if test="checkCart != null and checkCart == '00'">
+            and b.goods_biz_type != '11'
+        </if>
+        <if test="checkCart != null and checkCart == '11'">
+            and b.goods_biz_type = '11'
+        </if>
         <if test="user_id != null">
             AND a.user_id = #{user_id}
         </if>
@@ -96,6 +102,12 @@
         left join mall_product_store_rela psr on psr.product_id = c.id and psr.store_id = #{store_id}
         where 1 = 1
         and (psr.stock_num = 0 or b.is_on_sale = 0)
+        <if test="checkCart != null and checkCart == '00'">
+            and b.goods_biz_type != '11'
+        </if>
+        <if test="checkCart != null and checkCart == '11'">
+            and b.goods_biz_type = '11'
+        </if>
         <if test="merchSn != null">
             and a.merch_sn = #{merchSn}
         </if>
@@ -128,17 +140,31 @@
     </select>
 
     <select id="queryTotal" resultType="int">
-        select count(*) from mall_cart a
-        where 1 = 1
+        select count(*)
+        from mall_cart a
+        left join mall_goods b on a.goods_id = b.id
+        left join mall_product c on c.goods_id = a.goods_id and c.id = a.product_id
+        left join mall_product_store_rela psr on psr.product_id = c.id and psr.store_id = #{store_id}
+        where 1 = 1  and b.is_delete = 0 and b.is_on_sale = 1
+        and psr.stock_num > 0
+        <if test="checkCart != null and checkCart == '00'">
+            and b.goods_biz_type != '11'
+        </if>
+        <if test="checkCart != null and checkCart == '11'">
+            and b.goods_biz_type = '11'
+        </if>
         <if test="user_id != null">
             AND a.user_id = #{user_id}
         </if>
         <if test="goods_id != null">
             AND a.goods_id = #{goods_id}
         </if>
-        <if test="product_id != product_id">
+        <if test="product_id != null">
             AND a.product_id = #{product_id}
         </if>
+        <if test="store_id != null">
+            AND a.store_id = #{store_id}
+        </if>
         <if test="checked != null">
             AND a.checked = #{checked}
         </if>
@@ -389,5 +415,11 @@
     <delete id="deleteByCart">
         delete from mall_cart
         where  user_id = #{user_id} and store_id = #{store_id} and  checked = #{checked}
+        <if test="checkCart != null and checkCart == '00'">
+            and goods_biz_type != '11'
+        </if>
+        <if test="checkCart != null and checkCart == '11'">
+            and goods_biz_type = '11'
+        </if>
     </delete>
 </mapper>

+ 6 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiFootprintMapper.xml

@@ -42,7 +42,12 @@
                 and max.id is null
             </if>
             <if test="bizType == true">
-                and g.goods_biz_type in ('00','11')
+                <if test="checkCart != null and checkCart == '00'">
+                    and g.goods_biz_type = '00'
+                </if>
+                <if test="checkCart != null and checkCart == '11'">
+                    and g.goods_biz_type = '11'
+                </if>
             </if>
             <if test="store_id != null and store_id != ''">
                 and psr.store_id = #{store_id}

+ 6 - 1
wx-mall/app.json

@@ -95,5 +95,10 @@
     "request": 10000,
     "downloadFile": 10000
   },
-  "debug": true
+  "debug": true,
+  "permission":{
+    "scope.userLocation":{
+      "desc": "您的位置信息将用于小程序位置接口的效果展示"
+    }
+  }
 }

+ 117 - 72
wx-mall/pages/cart/cart.js

@@ -6,14 +6,14 @@ var app = getApp();
 
 Page({
   data: {
-    cartGoods00: [],//保税仓数据
-    cartGoods02: [],//保税展示数据
-    cartGoods10: [],//现场速递数据
-    cartGoods11: [],//普通商品
+    cartGoods00: [], //保税仓数据
+    cartGoods02: [], //保税展示数据
+    cartGoods10: [], //现场速递数据
+    cartGoods11: [], //普通商品
     cartGoods: [],
     validCartList: [],
-    goodsBizTypeList: ['保税仓','保税展示','现场速递','普通商品'],
-    goodsBizType: '',//货品业务类型
+    goodsBizTypeList: ['保税仓', '保税展示', '现场速递', '普通商品'],
+    goodsBizType: '', //货品业务类型
     footprintList: [],
     cartTotal: {
       "goodsCount": 0,
@@ -36,15 +36,18 @@ Page({
     retailPrice: '',
     stockNum: 0,
     cartNumber: 0,
+    checkCart: '00',
+    total00: 0,
+    total11: 0
   },
-  onLoad: function (options) {
+  onLoad: function(options) {
     // 页面初始化 options为页面跳转所带来的参数
   },
-  onReady: function () {
+  onReady: function() {
     // 页面渲染完成
 
   },
-  onShow: function () {
+  onShow: function() {
     // 页面显示
     if (wx.getStorageSync('userInfo') || wx.getStorageSync('token')) {
       this.getCartList();
@@ -55,11 +58,38 @@ Page({
       })
     }
   },
-  onHide: function () {
+  openSortFilter: function(event) {
+    let that = this;
+    let currentId = event.currentTarget.id;
+    switch (currentId) {
+      case 'defaultActivity':
+        that.setData({
+          'checkCart': '00'
+        });
+        this.getCartList();
+        this.getFootprintList();
+        break;
+      case 'ordActivity':
+        that.setData({
+          'checkCart': '11'
+        });
+        this.getCartList();
+        this.getFootprintList();
+        break;
+      default:
+        //综合排序
+        that.setData({
+          'checkCart': '00'
+        });
+        this.getCartList();
+        this.getFootprintList();
+    }
+  },
+  onHide: function() {
     // 页面隐藏
 
   },
-  onUnload: function () {
+  onUnload: function() {
     // 页面关闭
 
   },
@@ -73,7 +103,9 @@ Page({
       cartGoods11: res.data.cart11List,
       validCartList: res.data.validCartList,
       cartTotal: res.data.cartTotal,
-      couponInfoList: res.data.couponInfoList
+      couponInfoList: res.data.couponInfoList,
+      total00: res.data.total00,
+      total11: res.data.total11
     });
   },
   setCheckedData() {
@@ -96,12 +128,14 @@ Page({
       checkedTypeStatus11: that.isCheckedAll()
     });
   },
-  getCartList: function () {//获取购物车数据
+  getCartList: function() { //获取购物车数据
     let that = this;
     wx.showLoading({
       title: '加载中...',
     });
-    util.request(api.CartList).then(function (res) {
+    util.request(api.CartList, {
+      checkCart: that.data.checkCart
+    }).then(function(res) {
       if (res.errno === 0) {
         that.setCommonData(res);
       }
@@ -110,9 +144,9 @@ Page({
       that.setCheckedData();
     });
   },
-  isCheckedAll: function () {
+  isCheckedAll: function() {
     //判断购物车所有商品是否已全选
-    return this.data.cartGoods.every(function (element, index, array) {
+    return this.data.cartGoods.every(function(element, index, array) {
       if (element.checked == true) {
         return true;
       } else {
@@ -120,19 +154,19 @@ Page({
       }
     });
   },
-  isCheckedTypeStatus00: function () {
-      //判断该业务类型的购物车商品是否已全选
-      return this.data.cartGoods00.every(function (element, index, array) {
-        if (element.checked == true) {
-          return true;
-        } else {
-          return false;
-        }
-      });     
+  isCheckedTypeStatus00: function() {
+    //判断该业务类型的购物车商品是否已全选
+    return this.data.cartGoods00.every(function(element, index, array) {
+      if (element.checked == true) {
+        return true;
+      } else {
+        return false;
+      }
+    });
   },
-  isCheckedTypeStatus02: function () {
+  isCheckedTypeStatus02: function() {
     //判断该业务类型的购物车商品是否已全选
-    return this.data.cartGoods02.every(function (element, index, array) {
+    return this.data.cartGoods02.every(function(element, index, array) {
       if (element.checked == true) {
         return true;
       } else {
@@ -140,9 +174,9 @@ Page({
       }
     });
   },
-  isCheckedTypeStatus10: function () {
+  isCheckedTypeStatus10: function() {
     //判断该业务类型的购物车商品是否已全选
-    return this.data.cartGoods10.every(function (element, index, array) {
+    return this.data.cartGoods10.every(function(element, index, array) {
       if (element.checked == true) {
         return true;
       } else {
@@ -150,9 +184,9 @@ Page({
       }
     });
   },
-  isCheckedTypeStatus11: function () {
+  isCheckedTypeStatus11: function() {
     //判断该业务类型的购物车商品是否已全选
-    return this.data.cartGoods11.every(function (element, index, array) {
+    return this.data.cartGoods11.every(function(element, index, array) {
       if (element.checked == true) {
         return true;
       } else {
@@ -160,19 +194,20 @@ Page({
       }
     });
   },
-  toIndexPage: function () {
+  toIndexPage: function() {
     wx.switchTab({
       url: "/pages/index/index"
     });
   },
-  checkedItem: function (event) {
+  checkedItem: function(event) {
     let itemIndex = event.target.dataset.itemIndex;
     let that = this;
 
     util.request(api.CartChecked, {
       productIds: that.data.cartGoods[itemIndex].product_id,
-      isChecked: that.data.cartGoods[itemIndex].checked ? 0 : 1
-    }, 'POST').then(function (res) {
+      isChecked: that.data.cartGoods[itemIndex].checked ? 0 : 1,
+      checkCart: that.data.checkCart
+    }, 'POST').then(function(res) {
       if (res.errno === 0) {
         that.setCommonData(res);
       }
@@ -180,9 +215,9 @@ Page({
     });
 
   },
-  getCheckedGoodsCount: function () {
+  getCheckedGoodsCount: function() {
     let checkedGoodsCount = 0;
-    this.data.cartGoods.forEach(function (v) {
+    this.data.cartGoods.forEach(function(v) {
       if (v.checked === true) {
         checkedGoodsCount += v.number;
       }
@@ -190,22 +225,22 @@ Page({
     console.log(checkedGoodsCount);
     return checkedGoodsCount;
   },
-  checkedAll: function () {
+  checkedAll: function() {
     let that = this;
-    var productIds = this.data.cartGoods.map(function (v) {
+    var productIds = this.data.cartGoods.map(function(v) {
       return v.product_id;
     });
     util.request(api.CartChecked, {
       productIds: productIds.join(','),
       isChecked: that.isCheckedAll() ? 0 : 1
-    }, 'POST').then(function (res) {
+    }, 'POST').then(function(res) {
       if (res.errno === 0) {
         that.setCommonData(res);
       }
       that.setCheckedAllData();
     });
   },
-  checkedAllGoodType: function (e) {
+  checkedAllGoodType: function(e) {
     let that = this;
     let goodsBizType = e.target.dataset.goodsBizType;
     let isCheckedTypeStatu;
@@ -224,14 +259,14 @@ Page({
     util.request(api.CartChecked, {
       isChecked: isCheckedTypeStatu ? 0 : 1,
       goodsBizType: goodsBizType
-    }, 'POST').then(function (res) {
+    }, 'POST').then(function(res) {
       if (res.errno === 0) {
         that.setCommonData(res);
       }
 
       if (goodsBizType == '00') {
-          that.setData({
-            checkedTypeStatus00: that.isCheckedTypeStatus00()
+        that.setData({
+          checkedTypeStatus00: that.isCheckedTypeStatus00()
         });
       }
       if (goodsBizType == '02') {
@@ -254,15 +289,16 @@ Page({
       });
     });
   },
-  updateCart: function (productId, goodsId, number, beforeNumber, id, itemIndex) {
+  updateCart: function(productId, goodsId, number, beforeNumber, id, itemIndex) {
     let that = this;
 
     util.request(api.CartUpdate, {
       productId: productId,
       goodsId: goodsId,
       number: number,
-      id: id
-    }, 'POST').then(function (res) {
+      id: id,
+      checkCart: that.data.checkCart
+    }, 'POST').then(function(res) {
       if (res.errno === 0) {
         // console.log(res.data);
         that.setCommonData(res);
@@ -283,7 +319,7 @@ Page({
       that.setCheckedData();
     });
   },
-  cutNumber: function (event) {
+  cutNumber: function(event) {
     let itemIndex = event.target.dataset.itemIndex;
     let cartItem = this.data.cartGoods[itemIndex];
     let beforeNumber = cartItem.number;
@@ -294,7 +330,7 @@ Page({
     });
     this.updateCart(cartItem.product_id, cartItem.goods_id, number, beforeNumber, cartItem.id, itemIndex);
   },
-  addNumber: function (event) {
+  addNumber: function(event) {
     let itemIndex = event.target.dataset.itemIndex;
     let cartItem = this.data.cartGoods[itemIndex];
     let beforeNumber = cartItem.number;
@@ -305,12 +341,12 @@ Page({
     });
     this.updateCart(cartItem.product_id, cartItem.goods_id, number, beforeNumber, cartItem.id, itemIndex);
   },
-  checkoutOrder: function () {
+  checkoutOrder: function() {
     //获取已选择的商品
     let that = this;
     util.request(api.getCurUser, {
       userInfo: app.globalData.userInfo
-    }, 'POST').then(function (res) {
+    }, 'POST').then(function(res) {
       if (res.errno === 0) {
         // console.log('that.data.mobile:' + res.data.mobile);
         if (res.data.mobile == '' || res.data.mobile == null) {
@@ -319,7 +355,7 @@ Page({
             confirmColor: '#b4282d',
             showCancel: false,
             content: '您的手机号码未绑定,请先绑定手机号再进行购买',
-            success: function (res) {
+            success: function(res) {
               if (res.confirm) {
                 wx.navigateTo({
                   url: '../../pages/auth/newuser/newuser'
@@ -328,7 +364,7 @@ Page({
             }
           });
         } else {
-          var checkedGoods = that.data.cartGoods.filter(function (element, index, array) {
+          var checkedGoods = that.data.cartGoods.filter(function(element, index, array) {
             if (element.checked == true) {
               return true;
             } else {
@@ -340,13 +376,13 @@ Page({
             return false;
           }
           wx.navigateTo({
-            url: '../shopping/checkout/checkout'
+            url: '../shopping/checkout/checkout?checkCart=' + that.data.checkCart
           })
         }
       }
     });
   },
-  deleteCart: function (event) {
+  deleteCart: function(event) {
     //获取已选择的商品
     let that = this;
 
@@ -356,11 +392,12 @@ Page({
     wx.showModal({
       title: '',
       content: '确定要删除' + goodsName + '?',
-      success: function (res) {
+      success: function(res) {
         if (res.confirm) {
           util.request(api.CartDelete, {
-            cartId: cartId
-          }, 'POST').then(function (res) {
+            cartId: cartId,
+            checkCart: that.data.checkCart
+          }, 'POST').then(function(res) {
             if (res.errno === 0) {
               that.setCommonData(res);
             }
@@ -373,7 +410,10 @@ Page({
   },
   getFootprintList() {
     let that = this;
-    util.request(api.GuessFootprintList, { storeId: wx.getStorageSync('storeId') },).then(function (res) {
+    util.request(api.GuessFootprintList, {
+      storeId: wx.getStorageSync('storeId'),
+      checkCart: that.data.checkCart
+    }, ).then(function(res) {
       if (res.errno === 0) {
         that.setData({
           footprintList: res.data.list
@@ -381,12 +421,12 @@ Page({
       }
     });
   },
-  switchAttrPop: function () {
+  switchAttrPop: function() {
     this.setData({
       openAttr: !this.data.openAttr
     })
   },
-  clickSkuValue: function (event) {
+  clickSkuValue: function(event) {
     let that = this;
     let specValueId = event.currentTarget.dataset.valueId;
     let index = event.currentTarget.dataset.index;
@@ -409,25 +449,27 @@ Page({
     //重新计算spec改变后的信息
     goodsUtil.changeSpecInfo(that);
   },
-  cutNumber2: function () {
+  cutNumber2: function() {
     this.setData({
       number: (this.data.number - 1 > 1) ? this.data.number - 1 : 1
     });
   },
-  addNumber2: function () {
+  addNumber2: function() {
     this.setData({
       number: this.data.number + 1
     });
   },
 
   //购物车增加
-  addCart: function (e) {
+  addCart: function(e) {
     let that = this;
     that.setData({
-      number:1
+      number: 1
     });
     var goodsId = e.currentTarget.dataset.goodsId;
-    util.request(api.GoodsSku, { goodsId: goodsId }).then(function (res) {
+    util.request(api.GoodsSku, {
+      goodsId: goodsId
+    }).then(function(res) {
       if (res.errno === 0 && null != res.data) {
         that.setData({
           goodsVo: res.data.goodsVo,
@@ -453,7 +495,7 @@ Page({
     });
   },
   //购物车增加
-  addToCart: function () {
+  addToCart: function() {
     let that = this;
     var goodsId = that.data.goodsVo.id;
     //提示选择完整规格
@@ -479,8 +521,9 @@ Page({
     util.request(api.CartAdd, {
       goodsId: goodsId,
       productId: checkedProduct[0].id,
-      number: this.data.number
-    }, 'POST').then(function (res) {
+      number: this.data.number,
+      checkCart: that.data.checkCart
+    }, 'POST').then(function(res) {
       if (res.errno === 0 && null != res.data) {
         wx.showToast({
           title: '添加成功',
@@ -501,14 +544,16 @@ Page({
       }
     });
   },
-  deleteValidCart: function () {//获取购物车数据
+  deleteValidCart: function() { //获取购物车数据
     let that = this;
     wx.showModal({
       title: '',
       content: '确定要清空所有失效商品?',
-      success: function (res) {
+      success: function(res) {
         if (res.confirm) {
-          util.request(api.deleteValidCart).then(function (res) {
+          util.request(api.deleteValidCart, {
+            checkCart: that.data.checkCart
+          }).then(function(res) {
             if (res.errno === 0) {
               that.setCommonData(res);
             } else {

+ 16 - 3
wx-mall/pages/cart/cart.wxml

@@ -1,11 +1,24 @@
 <view class="container">
-  <view class="service-policy">
+  <view class="activity">
+    <view class="activity-box" bindtap="switchAttrPop">
+      <view class="item {{checkCart == '00' ? 'active' : ''}}" bindtap="openSortFilter" id="defaultActivity">
+        <view class="unpay-num" wx:if="{{total00>0}}">{{total00}}</view>
+        <text class="txt">保税直营</text>
+      </view>
+      <view class="item by-price {{checkCart == '11' ? 'active' : ''}}" bindtap="openSortFilter" id="ordActivity">
+        <view class="unpay-num2" wx:if="{{total11>0}}">{{total11}}</view>
+        <text class="txt">一般贸易</text>
+      </view>
+    </view>
+  </view>
+
+  <view class="service-policy" bindtap="switchAttrPop">
     <!-- <view class="item">30分钟速达</view>
     <view class="item">每日优选生鲜</view>
     <view class="item">满88元免配送费</view> -->
     <view class="item">新用户可领取5元优惠券</view>
   </view> 
-  <view class="no-cart" wx:if="{{cartGoods.length <= 0}}">
+  <view class="no-cart" wx:if="{{cartGoods.length <= 0}}" bindtap="switchAttrPop">
     <view class="c">
       <view class="title-box">
         购物车空空如也~
@@ -24,7 +37,7 @@
         </navigator>
       </view>
     </view> -->
-    <view class="list">
+    <view class="list" bindtap="switchAttrPop">
       <view class="group-item">
         <view class="goods">
           <view wx:if="{{cartGoods00.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus00 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="00">

+ 66 - 0
wx-mall/pages/cart/cart.wxss

@@ -102,6 +102,7 @@ page {
   height: auto;
   overflow: hidden;
   margin-left: 14rpx;
+  margin-top:20rpx;
 }
 
 .cart-view .list {
@@ -722,3 +723,68 @@ page {
   line-height: 65rpx;
   color: #ccc;
 }
+
+/* activity */
+
+.activity {
+  position: fixed;
+  background: #fff;
+  width: 100%;
+  height: 78rpx;
+  z-index: 999999;
+}
+
+.activity-box {
+  background: #fff;
+  width: 100%;
+  height: 78rpx;
+  overflow: hidden;
+  padding: 0 30rpx;
+  display: flex;
+}
+
+.activity-box .item {
+  height: 78rpx;
+  line-height: 78rpx;
+  text-align: center;
+  flex: 1;
+  color: #333;
+  font-size: 26rpx;
+}
+
+.activity-box .item .txt {
+  display: block;
+  width: 100%;
+  height: 100%;
+  color: #333;
+}
+
+.activity-box .item.active .txt {
+  color: #b4282d;
+}
+.unpay-num {
+  position: absolute;
+  width: 30rpx;
+  height: 30rpx;
+  line-height: 30rpx;
+  text-align: center;
+  top: 0rpx;
+  left: 280rpx;
+  background-color: #b4282d;
+  color: #fff;
+  border-radius: 50%;
+  font-size: 20rpx;
+}
+.unpay-num2 {
+  position: absolute;
+  width: 30rpx;
+  height: 30rpx;
+  line-height: 30rpx;
+  text-align: center;
+  top: 0rpx;
+  left: 620rpx;
+  background-color: #b4282d;
+  color: #fff;
+  border-radius: 50%;
+  font-size: 20rpx;
+}

+ 10 - 3
wx-mall/pages/shopping/checkout/checkout.js

@@ -41,7 +41,8 @@ Page({
     idNo: '',
     userName: '',
     idNoM: '',
-    idNoDisabled: false
+    idNoDisabled: false,
+    checkCart: ''
   },
   bindMultiPickerColumnChange: function (e) {
     let that = this;
@@ -97,7 +98,8 @@ Page({
   },
   getCheckoutInfo: function () {
     let that = this;
-    util.request(api.CartCheckout, { userCouponId: that.data.userCouponId, merchSn: wx.getStorageSync('merchSn') }).then(function (res) {
+    util.request(api.CartCheckout, { userCouponId: that.data.userCouponId, merchSn: wx.getStorageSync('merchSn'),
+      checkCart: that.data.checkCart }).then(function (res) {
       if (res.errno === 0) {
         console.log(res.data);
         that.setData({
@@ -293,7 +295,8 @@ Page({
       delivery_remark: that.data.delivery_remark,
       idNo: that.data.idNo,
       userName: that.data.userName,
-      merchSn: wx.getStorageSync("merchSn")
+      merchSn: wx.getStorageSync("merchSn"),
+      checkCart: that.data.checkCart
     }, 'POST').then(function (res) {
       if (res.errno === 0) {
         let actualPrice = that.data.actualPrice;
@@ -338,6 +341,10 @@ Page({
   },
   onLoad: function (options) {
     // 页面初始化 options为页面跳转所带来的参数
+    // console.log(options.checkCart);
+    this.setData({
+      checkCart: options.checkCart
+    });
   },
   onReady: function () {
     // 页面渲染完成