Explorar el Código

Merge branch 'master' of hyq/kmall-pt into master

黄亚琴 hace 6 años
padre
commit
9b22f08bfd
Se han modificado 39 ficheros con 898 adiciones y 142 borrados
  1. 59 5
      kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java
  2. 28 5
      kmall-api/src/main/java/com/kmall/api/api/ApiCouponController.java
  3. 5 3
      kmall-api/src/main/java/com/kmall/api/api/ApiGoodsController.java
  4. 7 4
      kmall-api/src/main/java/com/kmall/api/api/ApiPayController.java
  5. 28 4
      kmall-api/src/main/java/com/kmall/api/api/ApiUserController.java
  6. 4 0
      kmall-api/src/main/java/com/kmall/api/dao/ApiCartMapper.java
  7. 38 0
      kmall-api/src/main/java/com/kmall/api/dto/SendMsgVo.java
  8. 10 0
      kmall-api/src/main/java/com/kmall/api/entity/CartVo.java
  9. 35 23
      kmall-api/src/main/java/com/kmall/api/entity/SmsLogVo.java
  10. 4 0
      kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java
  11. 3 3
      kmall-api/src/main/java/com/kmall/api/service/ApiUserService.java
  12. 135 0
      kmall-api/src/main/java/com/kmall/api/util/HttpRequestUtil.java
  13. 79 0
      kmall-api/src/main/java/com/kmall/api/util/SendMsgUtil.java
  14. 4 1
      kmall-api/src/main/resources/mybatis/mapper/ApiCartMapper.xml
  15. 11 0
      kmall-api/src/main/resources/mybatis/mapper/ApiGoodsMapper.xml
  16. 11 11
      kmall-api/src/main/resources/mybatis/mapper/ApiUserMapper.xml
  17. 2 0
      kmall-common/src/main/java/com/kmall/common/dao/SysSmsLogDao.java
  18. 2 0
      kmall-common/src/main/java/com/kmall/common/dao/TemplateConfDao.java
  19. 11 0
      kmall-common/src/main/java/com/kmall/common/entity/SysSmsLogEntity.java
  20. 2 0
      kmall-common/src/main/java/com/kmall/common/service/impl/SysSmsLogServiceImpl.java
  21. 4 4
      kmall-common/src/main/java/com/kmall/common/utils/redis/JedisUtil.java
  22. 1 1
      kmall-common/src/main/java/com/kmall/common/utils/wechat/WechatUtil.java
  23. 9 2
      kmall-common/src/main/resources/mybatis/mapper/SysSmsLogDao.xml
  24. 2 1
      wx-mall/app.js
  25. 3 1
      wx-mall/config/api.js
  26. 36 7
      wx-mall/pages/auth/newuser/newuser.js
  27. 3 3
      wx-mall/pages/auth/newuser/newuser.wxml
  28. 133 12
      wx-mall/pages/cart/cart.js
  29. 77 4
      wx-mall/pages/cart/cart.wxml
  30. 15 4
      wx-mall/pages/cart/cart.wxss
  31. 34 9
      wx-mall/pages/catalog/catalog.js
  32. 6 5
      wx-mall/pages/catalog/catalog.wxml
  33. 7 1
      wx-mall/pages/catalog/catalog.wxss
  34. 16 8
      wx-mall/pages/category/category.js
  35. 1 1
      wx-mall/pages/goods/goods.wxml
  36. 54 12
      wx-mall/pages/index/index.js
  37. 8 5
      wx-mall/pages/index/index.wxml
  38. 3 2
      wx-mall/pages/pay/pay.js
  39. 8 1
      wx-mall/pages/shopping/checkout/checkout.js

+ 59 - 5
kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java

@@ -8,6 +8,7 @@ import com.kmall.api.service.*;
 import com.kmall.api.util.ApiBaseAction;
 import com.kmall.common.utils.MapUtils;
 import com.qiniu.util.StringUtils;
+import com.sun.org.apache.xpath.internal.operations.Bool;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -100,6 +101,9 @@ public class ApiCartController extends ApiBaseAction {
         BigDecimal goodsAmount = new BigDecimal(0.00);
         Integer checkedGoodsCount = 0;
         BigDecimal checkedGoodsAmount = new BigDecimal(0.00);
+        List<CartVo> cart00List = new ArrayList<>();
+        List<CartVo> cart02List = new ArrayList<>();
+        List<CartVo> cart11List = new ArrayList<>();
         for (CartVo cartItem : cartList) {
             goodsCount += cartItem.getNumber();
             goodsAmount = goodsAmount.add(cartItem.getRetail_price().multiply(new BigDecimal(cartItem.getNumber())));
@@ -108,10 +112,24 @@ public class ApiCartController extends ApiBaseAction {
                 checkedGoodsAmount = checkedGoodsAmount.add(cartItem.getRetail_price().multiply(new BigDecimal(cartItem.getNumber())));
             }
             if(org.apache.commons.lang.StringUtils.isNotEmpty(cartItem.getGoodsBizType())){
-                cartItem.setGoodsBizType(Dict.orderBizType.valueOf("item_"+ cartItem.getGoodsBizType()).getItemName());
+                cartItem.setGoodsBizTypeName(Dict.orderBizType.valueOf("item_"+ cartItem.getGoodsBizType()).getItemName());
             }else{
-                cartItem.setGoodsBizType("");
+                cartItem.setGoodsBizTypeName("");
             }
+
+            if(Dict.orderBizType.item_00.getItem().equalsIgnoreCase(cartItem.getGoodsBizType())){
+                CartVo cartVo00= cartItem;
+                cart00List.add(cartVo00);
+            }
+            if(Dict.orderBizType.item_02.getItem().equalsIgnoreCase(cartItem.getGoodsBizType())){
+                CartVo cartVo02= cartItem;
+                cart02List.add(cartVo02);
+            }
+            if(Dict.orderBizType.item_11.getItem().equalsIgnoreCase(cartItem.getGoodsBizType())){
+                CartVo cartVo11= cartItem;
+                cart11List.add(cartVo11);
+            }
+
         }
         // 获取优惠信息提示 邮费
         CouponVo shippingCoupon = apiCouponService.matchShippingSign(loginUser.getId(), checkedGoodsAmount);
@@ -128,6 +146,10 @@ public class ApiCartController extends ApiBaseAction {
         }
 
         resultObj.put("couponInfoList", couponInfoList);
+
+        resultObj.put("cart00List", cart00List);//{'cartList':{'type': '保税备货','data':{}}}
+        resultObj.put("cart02List", cart02List);
+        resultObj.put("cart11List", cart11List);
         resultObj.put("cartList", cartList);
         //
         Map<String, Object> cartTotal = new HashMap();
@@ -405,10 +427,21 @@ public class ApiCartController extends ApiBaseAction {
         JSONObject jsonParam = getJsonRequest();
         String productIds = jsonParam.getString("productIds");
         Integer isChecked = jsonParam.getInteger("isChecked");
-        if (StringUtils.isNullOrEmpty(productIds)) {
-            return this.toResponsFail("删除出错");
+        String goodsBizType = jsonParam.getString("goodsBizType");
+        String[] productIdArray = null;
+        if(StringUtils.isNullOrEmpty(goodsBizType)) {
+            if (StringUtils.isNullOrEmpty(productIds)) {//点击全选时
+                return this.toResponsFail("删除出错");
+            }
+            productIdArray = productIds.split(",");
+        }else{
+            //根据业务类型查询购物车
+            List<CartVo> cartVoList = cartService.queryCartByGoodsBizType(goodsBizType);
+            productIdArray = new String[cartVoList.size()];
+            for (int i = 0;i< cartVoList.size();i++){
+                productIdArray[i] =cartVoList.get(i).getProduct_id()+"";
+            }
         }
-        String[] productIdArray = productIds.split(",");
         cartService.updateCheck(productIdArray, isChecked, loginUser.getId(), getStoreId());
         return toResponsSuccess(getCart());
     }
@@ -553,4 +586,25 @@ public class ApiCartController extends ApiBaseAction {
         List<UserCouponVo> couponVos = apiUserCouponService.signUserCouponList(loginUser.getId(), checkedGoodsAmount);
         return toResponsSuccess(couponVos);
     }
+
+//    select checked from mall_cart where goods_biz_type ='00'
+
+    @PostMapping("getCheckedDataByType")
+    public Object getCheckedDataByType() {
+
+        JSONObject jsonParam = getJsonRequest();
+        String goodsBizType = jsonParam.getString("goodsBizType");
+        List<CartVo> cartVoList = cartService.queryCartByGoodsBizType(goodsBizType);
+        for (int i=0;i<cartVoList.size();i++){
+            if(cartVoList.get(i).getChecked()==0){//未选中
+                Map map=new HashMap();
+                map.put("isChecked",false);
+                return toResponsSuccess(map);
+            }
+        }
+        Map map=new HashMap();
+        map.put("isChecked",true);
+        return toResponsSuccess(map);
+    }
+
 }

+ 28 - 5
kmall-api/src/main/java/com/kmall/api/api/ApiCouponController.java

@@ -10,6 +10,8 @@ import com.kmall.api.service.ApiCouponService;
 import com.kmall.api.service.ApiUserCouponService;
 import com.kmall.api.service.ApiUserService;
 import com.kmall.api.util.ApiBaseAction;
+import com.kmall.common.entity.SysSmsLogEntity;
+import com.kmall.common.service.SysSmsLogService;
 import com.kmall.common.utils.enums.CouponTypeEnum;
 import com.qiniu.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,6 +38,8 @@ public class ApiCouponController extends ApiBaseAction {
     private ApiCouponService apiCouponService;
     @Autowired
     private ApiUserCouponService apiUserCouponService;
+    @Autowired
+    private SysSmsLogService sysSmsLogService;
 
     /**
      * 是否有可以参加的活动
@@ -137,7 +141,7 @@ public class ApiCouponController extends ApiBaseAction {
     }
 
     /**
-     *   填写手机号码,领券
+     *   手机号绑定
      */
     @PostMapping("newuser")
     public Object newuser(@LoginUser UserVo loginUser) {
@@ -146,10 +150,13 @@ public class ApiCouponController extends ApiBaseAction {
         String phone = jsonParam.getString("phone");
         String smscode = jsonParam.getString("smscode");
         // 校验短信码
-        SmsLogVo smsLogVo = apiUserService.querySmsCodeByUserId(loginUser.getId());
-        if (null != smsLogVo && !smsLogVo.getSms_code().equals(smscode)) {
+        SysSmsLogEntity smsLogVo = sysSmsLogService.querySmsCodeByUserId(loginUser.getId());
+        if (null != smsLogVo && !smsLogVo.getSmsCode().equals(smscode)) {
             return toResponsFail("短信校验失败");
         }
+//        if(org.apache.commons.lang.StringUtils.isNotEmpty(smsLogVo.getReturnMsg())){
+//            return toResponsFail("短信校验失败:"+smsLogVo.getReturnMsg());
+//        }
         // 更新手机号码
         if (!StringUtils.isNullOrEmpty(phone)) {
             if (!phone.equals(loginUser.getMobile())) {
@@ -157,13 +164,13 @@ public class ApiCouponController extends ApiBaseAction {
                 apiUserService.update(loginUser);
             }
         }
-        // 判断是否是新用户
+        /*// 判断是否是新用户
         if (!StringUtils.isNullOrEmpty(loginUser.getMobile())) {
             return toResponsFail("当前优惠券只能新用户领取");
         } else {
             loginUser.setMobile(phone);
             apiUserService.update(loginUser);
-        }
+        }*/
         // 是否领取过了
         Map params = new HashMap();
         params.put("user_id", loginUser.getId());
@@ -183,6 +190,22 @@ public class ApiCouponController extends ApiBaseAction {
             return toResponsFail("领取失败");
         }
     }
+    /**
+     *  校验是否领取
+     */
+    @GetMapping("checkActivit")
+    public Object checkActivit(@LoginUser UserVo loginUser) {
+        // 是否领取过了
+        Map params = new HashMap();
+        params.put("user_id", loginUser.getId());
+        params.put("send_type", 4);
+        List<CouponVo> couponVos = apiCouponService.queryUserCoupons(params);
+        if (null != couponVos && couponVos.size() > 0) {
+            return toResponsObject(2, "已经领取过,不能重复领取", couponVos);
+        }
+
+        return toResponsSuccess(couponVos);
+    }
 
     /**
      *   转发领取红包

+ 5 - 3
kmall-api/src/main/java/com/kmall/api/api/ApiGoodsController.java

@@ -117,7 +117,7 @@ public class ApiGoodsController extends ApiBaseAction {
 
     /**
      * 商品详情页数据
-     */
+     * */
     @GetMapping("detail")
     public Object detail(Long id, Long referrer) {
         Map<String, Object> resultObj = new HashMap();
@@ -273,7 +273,7 @@ public class ApiGoodsController extends ApiBaseAction {
      */
     @GetMapping("list")
     public Object list(@LoginUser UserVo loginUser, Integer categoryId,
-                       Integer brandId, String keyword, Integer isNew, Integer isHot,
+                       Integer brandId, String keyword, Integer isNew, Integer isHot,String goodsBizType,
                        @RequestParam(value = "page", defaultValue = "1") Integer
                                page, @RequestParam(value = "size", defaultValue = "10") Integer size,
                        String sort, String order) {
@@ -286,6 +286,7 @@ public class ApiGoodsController extends ApiBaseAction {
         params.put("limit", size);
         params.put("order", sort);
         params.put("sidx", order);
+        params.put("goodsBizType", goodsBizType);
         params.put("store_id", getStoreId());
         //
         if (null != sort && sort.equals("price")) {
@@ -537,7 +538,7 @@ public class ApiGoodsController extends ApiBaseAction {
     @IgnoreAuth
     @GetMapping("productlist")
     public Object productlist(@LoginUser UserVo loginUser, Integer categoryId,
-                              Integer isNew, Integer discount,
+                              Integer isNew, Integer discount,String goodsBizType,
                               @RequestParam(value = "page", defaultValue = "1") Integer
                                       page, @RequestParam(value = "size", defaultValue = "10") Integer size,
                               String sort, String order) {
@@ -565,6 +566,7 @@ public class ApiGoodsController extends ApiBaseAction {
         } else if (null != discount && discount == 2) {
             params.put("is_group", true);
         }
+        params.put("goodsBizType", goodsBizType);
         params.put("category_parent_id", categoryId);
         //查询列表数据
         Query query = new Query(params);

+ 7 - 4
kmall-api/src/main/java/com/kmall/api/api/ApiPayController.java

@@ -23,10 +23,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
+import java.util.*;
 
 /**
  * 作者: @author Scott <br>
@@ -59,6 +56,12 @@ public class ApiPayController extends ApiBaseAction {
     @GetMapping("pay_prepay")
     public Object payPrepay(@LoginUser UserVo loginUser, Long orderId) {
         //
+//        List<Long> orderIdList=new ArrayList<>();
+//        List<OrderVo> orderList=new ArrayList<>();
+//        for(int i=0;i<orderIds.length;i++){
+//            orderIdList.add(orderIds[i]);
+//            OrderVo orderInfo = orderService.queryObject(orderIds[i]);
+//        }
         OrderVo orderInfo = orderService.queryObject(orderId);
 
         if (null == orderInfo) {

+ 28 - 4
kmall-api/src/main/java/com/kmall/api/api/ApiUserController.java

@@ -1,14 +1,19 @@
 package com.kmall.api.api;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.google.gson.JsonObject;
 import com.kmall.api.annotation.IgnoreAuth;
 import com.kmall.api.annotation.LoginUser;
+import com.kmall.api.dto.SendMsgVo;
+import com.kmall.api.util.SendMsgUtil;
 import com.kmall.common.entity.SysSmsLogEntity;
 import com.kmall.api.entity.UserVo;
 import com.kmall.api.service.ApiUserService;
 import com.kmall.common.service.SysSmsLogService;
 import com.kmall.api.util.ApiBaseAction;
 import com.kmall.common.utils.CharUtil;
+import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -26,6 +31,7 @@ import java.util.Map;
 @RestController
 @RequestMapping("/api/user")
 public class ApiUserController extends ApiBaseAction {
+    protected Logger log = Logger.getLogger(ApiUserController.class);
     @Autowired
     private ApiUserService userService;
     @Autowired
@@ -49,20 +55,38 @@ public class ApiUserController extends ApiBaseAction {
     @PostMapping("smscode")
     public Object smscode(@LoginUser UserVo loginUser) {
         JSONObject jsonParams = getJsonRequest();
-        String sms_code = CharUtil.getRandomNum(4);
+        String sms_code = SendMsgUtil.createRandomVcode();
         String phone = jsonParams.getString("phone");
-        String msgContent = "验证码:" + sms_code + ",您正在进行身份验证。";
+        String msgContent = "您正在进行微信小程序手机号绑定操作,验证码"+sms_code+",请在10分钟内输入。请勿告诉其他人。";
 
+        System.out.println("msgContent:"+msgContent);
         // 一分钟之内不能重复发送短信
         SysSmsLogEntity smsLogVo = smsLogService.querySmsCodeByUserId(loginUser.getId());
         if (null != smsLogVo && (System.currentTimeMillis() - smsLogVo.getStime().getTime()) / 1000 < 1 * 60) {
             return toResponsFail("短信已发送");
         }
 
+//        try{
+//            //发送验证码到手机
+//            String result = SendMsgUtil.sendMsg(phone,msgContent);
+//            SendMsgVo vo = JSON.parseObject(result,SendMsgVo.class);
+//            System.out.println(result);
+////            if(vo.getCode().equalsIgnoreCase("1")){
+////                return toResponsSuccess("短信发送成功");
+////            }else{
+////                return toResponsFail(vo.getMsg());
+////            }
+//            return toResponsSuccess("短信发送成功");
+//        }catch (Exception e){
+//            e.printStackTrace();
+//            return toResponsFail("短信发送失败");
+//        }
+
         SysSmsLogEntity smsLog = new SysSmsLogEntity();
         smsLog.setUserId(loginUser.getId());
         smsLog.setMobile(phone);
         smsLog.setContent(msgContent);
+        smsLog.setSmsCode(sms_code);
         SysSmsLogEntity result = smsLogService.sendSms(smsLog);
 
         if (null == result || result.getSendStatus() != 0) {
@@ -79,9 +103,9 @@ public class ApiUserController extends ApiBaseAction {
      */
     @PostMapping("getCurUser")
     public Object getUserLevel() {
-        UserVo userInfo =new UserVo();
         Long userId = getUserId();
-        String userLevel = userService.getUserLevel(userService.queryObject(userId));
+        UserVo userInfo = userService.queryObject(userId);
+        String userLevel = userService.getUserLevel(userInfo);
         userInfo.setUserLevel(userLevel);
         return toResponsSuccess(userInfo);
     }

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

@@ -5,6 +5,8 @@ import org.apache.ibatis.annotations.Param;
 import com.kmall.common.dao.BaseDao;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
+
 /**
  * @author Scott
  * @email
@@ -18,4 +20,6 @@ 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);
+
+    List<CartVo> queryCartByGoodsBizType(@Param("goodsBizType") String goodsBizType);
 }

+ 38 - 0
kmall-api/src/main/java/com/kmall/api/dto/SendMsgVo.java

@@ -0,0 +1,38 @@
+package com.kmall.api.dto;
+
+/**
+ * @author huangyaqin
+ * @version 1.0
+ * 2018-10-16 14:23
+ */
+public class SendMsgVo {
+    private String code;
+
+    private String msg;
+
+    private String result;
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
+}

+ 10 - 0
kmall-api/src/main/java/com/kmall/api/entity/CartVo.java

@@ -51,6 +51,8 @@ public class CartVo implements Serializable {
     private String sku;
     private String goodsBizType;
 
+    private String goodsBizTypeName;
+
     private String createrSn;
 
     private Date createTime;
@@ -61,6 +63,14 @@ public class CartVo implements Serializable {
 
     private Date tstm;
 
+    public String getGoodsBizTypeName() {
+        return goodsBizTypeName;
+    }
+
+    public void setGoodsBizTypeName(String goodsBizTypeName) {
+        this.goodsBizTypeName = goodsBizTypeName;
+    }
+
     public String getSku() {
         return sku;
     }

+ 35 - 23
kmall-api/src/main/java/com/kmall/api/entity/SmsLogVo.java

@@ -1,10 +1,11 @@
 package com.kmall.api.entity;
 
 import java.io.Serializable;
+import java.util.Date;
 
 
 /**
- * 实体表名 mall_sms_log
+ * 实体表名 sys_sms_log
  *
  * @author Scott
  * @email
@@ -18,15 +19,25 @@ public class SmsLogVo implements Serializable {
     //
     private Long user_id;
     //
-    private String phone;
+    private String mobile;
     //
-    private Long log_date;
+    private Date stime;
     // 发送模板
     private String sms_code;
     // 1成功 0失败
     private Integer send_status;
     //
-    private String sms_text;
+    private String content;
+
+    private String smsCode;
+
+    public String getSmsCode() {
+        return smsCode;
+    }
+
+    public void setSmsCode(String smsCode) {
+        this.smsCode = smsCode;
+    }
 
     public Long getId() {
         return id;
@@ -44,21 +55,6 @@ public class SmsLogVo implements Serializable {
         this.user_id = user_id;
     }
 
-    public String getPhone() {
-        return phone;
-    }
-
-    public void setPhone(String phone) {
-        this.phone = phone;
-    }
-
-    public Long getLog_date() {
-        return log_date;
-    }
-
-    public void setLog_date(Long log_date) {
-        this.log_date = log_date;
-    }
 
     public String getSms_code() {
         return sms_code;
@@ -76,11 +72,27 @@ public class SmsLogVo implements Serializable {
         this.send_status = send_status;
     }
 
-    public String getSms_text() {
-        return sms_text;
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public Date getStime() {
+        return stime;
+    }
+
+    public void setStime(Date stime) {
+        this.stime = stime;
+    }
+
+    public String getContent() {
+        return content;
     }
 
-    public void setSms_text(String sms_text) {
-        this.sms_text = sms_text;
+    public void setContent(String content) {
+        this.content = content;
     }
 }

+ 4 - 0
kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java

@@ -163,4 +163,8 @@ public class ApiCartService {
         save(cartInfo);
         return resultObj;
     }
+
+    public List<CartVo> queryCartByGoodsBizType(String goodsBizType) {
+        return cartDao.queryCartByGoodsBizType(goodsBizType);
+    }
 }

+ 3 - 3
kmall-api/src/main/java/com/kmall/api/service/ApiUserService.java

@@ -86,9 +86,9 @@ public class ApiUserService {
     }
 
 
-    public int saveSmsCodeLog(SmsLogVo smsLogVo) {
-        return userDao.saveSmsCodeLog(smsLogVo);
-    }
+//    public int saveSmsCodeLog(SmsLogVo smsLogVo) {
+//        return userDao.saveSmsCodeLog(smsLogVo);
+//    }
 
     public String getUserLevel(UserVo loginUser) {
         String result = "普通用户";

+ 135 - 0
kmall-api/src/main/java/com/kmall/api/util/HttpRequestUtil.java

@@ -0,0 +1,135 @@
+package com.kmall.api.util;
+
+import java.io.IOException;
+import java.util.Map;
+
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.SimpleHttpConnectionManager;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+
+/**
+ * @author huangyaqin
+ * @version 1.0
+ * 2018-10-16 11:28
+ */
+public class HttpRequestUtil {
+    /**
+     * HttpClient 模拟POST请求
+     * @param url
+     * @param params
+     * @return
+     */
+    public static String postRequest(String url, Map<String, String> params) {
+        //构造HttpClient的实例
+        HttpClient httpClient = new HttpClient();
+
+
+        //创建POST方法的实例
+        PostMethod postMethod = new PostMethod(url);
+
+
+        //设置请求头信息
+        postMethod.setRequestHeader("Connection", "close");
+
+
+        //添加参数
+        for (Map.Entry<String, String> entry : params.entrySet()) {
+            postMethod.addParameter(entry.getKey(), entry.getValue());
+        }
+
+
+        //使用系统提供的默认的恢复策略,设置请求重试处理,用的是默认的重试处理:请求三次
+        httpClient.getParams().setBooleanParameter("http.protocol.expect-continue", false);
+
+
+        //接收处理结果
+        String result = null;
+        try {
+            //执行Http Post请求
+            httpClient.executeMethod(postMethod);
+
+
+            //返回处理结果
+            result = postMethod.getResponseBodyAsString();
+        } catch (HttpException e) {
+            // 发生致命的异常,可能是协议不对或者返回的内容有问题
+            System.out.println("请检查输入的URL!");
+            e.printStackTrace();
+        } catch (IOException e) {
+            // 发生网络异常
+            System.out.println("发生网络异常!");
+            e.printStackTrace();
+        } finally {
+            //释放链接
+            postMethod.releaseConnection();
+
+
+            //关闭HttpClient实例
+            if (httpClient != null) {
+                ((SimpleHttpConnectionManager) httpClient.getHttpConnectionManager()).shutdown();
+                httpClient = null;
+            }
+        }
+        return result;
+    }
+
+
+    /**
+     *  HttpClient 模拟GET请求
+     * 方法说明
+     * @Discription:扩展说明
+     * @param url
+     * @param params
+     * @return String
+     */
+    public static String getRequest(String url, Map<String, String> params) {
+        //构造HttpClient实例
+        HttpClient client = new HttpClient();
+
+
+        //拼接参数
+        String paramStr = "";
+        for (String key : params.keySet()) {
+            paramStr = paramStr + "&" + key + "=" + params.get(key);
+        }
+        paramStr = paramStr.substring(1);
+
+
+        //创建GET方法的实例
+        GetMethod method = new GetMethod(url + "?" + paramStr);
+
+
+        //接收返回结果
+        String result = null;
+        try {
+            //执行HTTP GET方法请求
+            client.executeMethod(method);
+
+
+            //返回处理结果
+            result = method.getResponseBodyAsString();
+        } catch (HttpException e) {
+            // 发生致命的异常,可能是协议不对或者返回的内容有问题
+            System.out.println("请检查输入的URL!");
+            e.printStackTrace();
+        } catch (IOException e) {
+            // 发生网络异常
+            System.out.println("发生网络异常!");
+            e.printStackTrace();
+        } finally {
+            //释放链接
+            method.releaseConnection();
+
+
+            //关闭HttpClient实例
+            if (client != null) {
+                ((SimpleHttpConnectionManager) client.getHttpConnectionManager()).shutdown();
+                client = null;
+            }
+        }
+        return result;
+    }
+}

+ 79 - 0
kmall-api/src/main/java/com/kmall/api/util/SendMsgUtil.java

@@ -0,0 +1,79 @@
+package com.kmall.api.util;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author huangyaqin
+ * @version 1.0
+ * 2018-10-16 11:27
+ */
+public class SendMsgUtil {
+    /**
+     * 发送短信消息
+     * 方法说明
+     * @Discription:扩展说明
+     * @param phones
+     * @param content
+     * @return
+     * @return String
+     */
+    @SuppressWarnings("deprecation")
+    public static String sendMsg(String phones,String content) {
+        try {
+            content = java.net.URLEncoder.encode(content,"utf-8");
+            System.out.println(content);
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        String sendMsgapiKey = "d6d33c8e7ad847cc3f3d7e9f75d0abb1";
+        //短信接口URL提交地址
+        String url = "https://api.dingdongcloud.com/v1/sms/sendyzm";
+
+        Map<String, String> params = new HashMap<String, String>();
+
+        params.put("name", "13530612313");
+        params.put("pwd", "nm81875o");
+//        params.put("dxlbid", "短信类别编号");
+//        params.put("extno", "扩展编号");
+        params.put("apikey", sendMsgapiKey);
+
+        //手机号码,多个号码使用英文逗号进行分割
+        params.put("mobile", phones);
+        //将短信内容进行URLEncoder编码
+        params.put("content", URLEncoder.encode(content));
+        params.put("sendTs", "");
+
+        return HttpRequestUtil.postRequest(url, params);
+    }
+
+    /**
+     * 随机生成6位随机验证码
+     * 方法说明
+     * @Discription:扩展说明
+     * @return
+     * @return String
+     */
+    public static String createRandomVcode(){
+        //验证码
+        String vcode = "";
+        for (int i = 0; i < 6; i++) {
+            vcode = vcode + (int)(Math.random() * 9);
+        }
+        return vcode;
+    }
+    /**
+     * 测试
+     * 方法说明
+     * @Discription:扩展说明
+     * @param args
+     * @return void
+     */
+    public static void main(String[] args) {
+//      System.out.println(SendMsgUtil.createRandomVcode());
+//      System.out.println("&ecb=12".substring(1));
+        System.out.println(sendMsg("18201150549", "【签名】尊敬的用户,您的验证码为" + SendMsgUtil.createRandomVcode() + ",请在10分钟内输入。请勿告诉其他人!"));
+    }
+}

+ 4 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiCartMapper.xml

@@ -37,7 +37,10 @@
 		select
         <include refid="Base_Column_List" /> from mall_cart where id = #{value}
 	</select>
-
+    <select id="queryCartByGoodsBizType" resultMap="cartMap">
+        select
+        <include refid="Base_Column_List" /> from mall_cart where goods_biz_type = #{goodsBizType}
+    </select>
     <select id="queryList" resultMap="cartMap">
         select a.*,
         b.list_pic_url as list_pic_url,

+ 11 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiGoodsMapper.xml

@@ -129,6 +129,9 @@
         <if test="is_delete != null">
             and a.is_delete = #{is_delete}
         </if>
+        <if test="goodsBizType != null">
+            and a.goods_biz_type = #{goodsBizType}
+        </if>
         <if test="categoryIds != null">
             and a.category_id in
             <foreach item="item" collection="categoryIds" open="(" separator="," close=")">
@@ -271,6 +274,11 @@
         <if test="store_id != null and store_id != ''">
             and psr1.store_id = #{store_id}
         </if>
+
+        <if test="goodsBizType != null and goodsBizType != ''">
+            and a.goods_biz_type = #{goodsBizType}
+        </if>
+
         group by a.id, a.name, a.list_pic_url, psr1.market_price, psr1.retail_price, a.goods_brief, b.id
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
@@ -326,5 +334,8 @@
         <if test="store_id != null and store_id != ''">
             and s.store_id = #{store_id}
         </if>
+        <if test="goodsBizType != null and goodsBizType != ''">
+            and a.goods_biz_type = #{goodsBizType}
+        </if>
     </select>
 </mapper>

+ 11 - 11
kmall-api/src/main/resources/mybatis/mapper/ApiUserMapper.xml

@@ -183,25 +183,25 @@
     <resultMap type="com.kmall.api.entity.SmsLogVo" id="smslogMap">
         <result property="id" column="id"/>
         <result property="user_id" column="user_id"/>
-        <result property="phone" column="phone"/>
-        <result property="log_date" column="log_date"/>
+        <result property="mobile" column="mobile"/>
+        <result property="stime" column="stime"/>
         <result property="sms_code" column="sms_code"/>
         <result property="send_status" column="send_status"/>
-        <result property="sms_text" column="sms_text"/>
+        <result property="content" column="content"/>
+        <result property="smsode" column="sms_code"/>
     </resultMap>
 
     <select id="querySmsCodeByUserId" resultMap="smslogMap">
-        select
-        a.id,
+         a.id,
         a.user_id,
-        a.phone,
-        a.log_date,
+        a.mobile,
+        a.stime,
         a.sms_code,
         a.send_status,
-        a.sms_text
-        from mall_sms_log a
-        left join mall_sms_log b on a.user_id = b.user_id and b.log_date > a.log_date
-        where a.user_id = #{id} and b.id is null
+        a.content
+        from sys_sms_log a
+        left join sys_user b on a.user_id = b.user_id
+        where a.user_id = #{id}  ORDER BY stime desc limit 1
     </select>
 
     <insert id="saveSmsCodeLog" parameterType="com.kmall.api.entity.SmsLogVo">

+ 2 - 0
kmall-common/src/main/java/com/kmall/common/dao/SysSmsLogDao.java

@@ -1,6 +1,7 @@
 package com.kmall.common.dao;
 
 import com.kmall.common.entity.SysSmsLogEntity;
+import org.springframework.stereotype.Component;
 
 /**
  * Dao
@@ -8,6 +9,7 @@ import com.kmall.common.entity.SysSmsLogEntity;
  * @author Scott
  * @date 2017-12-16 23:38:05
  */
+@Component
 public interface SysSmsLogDao extends BaseDao<SysSmsLogEntity> {
 
     SysSmsLogEntity querySmsCodeByUserId(Long userId);

+ 2 - 0
kmall-common/src/main/java/com/kmall/common/dao/TemplateConfDao.java

@@ -1,6 +1,7 @@
 package com.kmall.common.dao;
 
 import com.kmall.common.entity.TemplateConfVo;
+import org.springframework.stereotype.Component;
 
 /**
  * 微信模板消息日志Dao
@@ -9,6 +10,7 @@ import com.kmall.common.entity.TemplateConfVo;
  * @email
  * @date 2017-12-02 16:49:29
  */
+@Component
 public interface TemplateConfDao extends BaseDao<TemplateConfVo> {
 
     TemplateConfVo queryByTypeId(Integer templateType);

+ 11 - 0
kmall-common/src/main/java/com/kmall/common/entity/SysSmsLogEntity.java

@@ -76,6 +76,17 @@ public class SysSmsLogEntity implements Serializable {
      */
     private String userName;
 
+
+    private String smsCode;
+
+    public String getSmsCode() {
+        return smsCode;
+    }
+
+    public void setSmsCode(String smsCode) {
+        this.smsCode = smsCode;
+    }
+
     /**
      * 设置:主键
      */

+ 2 - 0
kmall-common/src/main/java/com/kmall/common/service/impl/SysSmsLogServiceImpl.java

@@ -111,6 +111,8 @@ public class SysSmsLogServiceImpl implements SysSmsLogService {
         if (null == smsLog.getStime()) {
             smsLog.setStime(new Date());
         }
+        smsLog.setMobile(smsLog.getMobile());
+        smsLog.setSmsCode(smsLog.getSmsCode());
         //保存发送记录
         save(smsLog);
         return smsLog;

+ 4 - 4
kmall-common/src/main/java/com/kmall/common/utils/redis/JedisUtil.java

@@ -1,7 +1,6 @@
 package com.kmall.common.utils.redis;
 
 import com.google.common.collect.Sets;
-import com.mysql.jdbc.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
@@ -599,7 +598,7 @@ public class JedisUtil {
                 value = new HashMap<String, Object>();
                 Map<byte[], byte[]> map = jedis.hgetAll(getBytesKey(key));
                 for (Map.Entry<byte[], byte[]> e : map.entrySet()) {
-                    value.put(StringUtils.toString(e.getKey()),
+                    value.put(String.valueOf(e.getKey()),
                             toObject(e.getValue()));
                 }
                 logger.debug("getObjectMap {} ", key, value);
@@ -955,7 +954,8 @@ public class JedisUtil {
      */
     public static byte[] getBytesKey(Object object) {
         if (object instanceof String) {
-            return StringUtils.getBytes((String) object);
+            String ob =(String) object;
+            return ob.getBytes();
         } else {
             return ObjectUtils.serialize(object);
         }
@@ -969,7 +969,7 @@ public class JedisUtil {
      */
     public static Object getObjectKey(byte[] key) {
         try {
-            return StringUtils.toString(key);
+            return String.valueOf(key);
         } catch (UnsupportedOperationException uoe) {
             try {
                 return JedisUtil.toObject(key);

+ 1 - 1
kmall-common/src/main/java/com/kmall/common/utils/wechat/WechatUtil.java

@@ -275,7 +275,7 @@ public class WechatUtil {
 
         StringEntity postEntity = new StringEntity(data, "UTF-8");
         httpPost.addHeader("Content-Type", "text/xml");
-        httpPost.addHeader("User-Agent", "wxpay sdk java v1.0 " + ResourceUtil.getConfigByName("\\conf\\wx-mp", "wx.mchId"));
+        httpPost.addHeader("User-Agent", "wxpay sdk java v1.0 " + ResourceUtil.getConfigByName("\\conf\\wx-mp", "wx.dev.mchId"));
         httpPost.setEntity(postEntity);
 
         try {

+ 9 - 2
kmall-common/src/main/resources/mybatis/mapper/SysSmsLogDao.xml

@@ -18,6 +18,7 @@
         <result property="successNum" column="success_num"/>
         <result property="blackNum" column="black_num"/>
         <result property="returnMsg" column="return_msg"/>
+        <result property="smsode" column="sms_code"/>
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.common.entity.SysSmsLogEntity">
@@ -35,7 +36,8 @@
 			`invalid_num`,
 			`success_num`,
 			`black_num`,
-			`return_msg`
+			`return_msg`,
+			sms_code
 		from sys_sms_log
 		where id = #{id}
 	</select>
@@ -56,6 +58,7 @@
         sys_sms_log.success_num,
         sys_sms_log.black_num,
         sys_sms_log.return_msg,
+        sys_sms_log.sms_code,
         sys_user.username user_name
         from sys_sms_log
         LEFT JOIN sys_user ON sys_user.user_id = sys_sms_log.user_id
@@ -99,6 +102,7 @@
 			`invalid_num`,
 			`success_num`,
 			`black_num`,
+			 sms_code,
 			`return_msg`)
 		values(
 			#{id},
@@ -114,6 +118,7 @@
 			#{invalidNum},
 			#{successNum},
 			#{blackNum},
+			#{smsCode},
 			#{returnMsg})
 	</insert>
 
@@ -132,6 +137,7 @@
             <if test="invalidNum != null">`invalid_num` = #{invalidNum},</if>
             <if test="successNum != null">`success_num` = #{successNum},</if>
             <if test="blackNum != null">`black_num` = #{blackNum},</if>
+            <if test="smsCode != null">`sms_code` = #{smsCode},</if>
             <if test="returnMsg != null">`return_msg` = #{returnMsg}</if>
         </set>
         where id = #{id}
@@ -163,7 +169,8 @@
         a.invalid_num,
         a.success_num,
         a.black_num,
-        a.return_msg
+        a.return_msg,
+        a.sms_code
 		from sys_sms_log a
 		left join sys_sms_log b on a.user_id = b.user_id and b.stime > a.stime
 		where a.user_id = #{user_id} and b.id is null

+ 2 - 1
wx-mall/app.js

@@ -24,6 +24,7 @@ App({
       nickName: '点击头像登录',
       avatarUrl: 'https://www.meiping123.com/upload/20171125/1721207662403.png'
     },
-    token: ''
+    token: '',
+    appGoodsBizType: '00'
   }
 })

+ 3 - 1
wx-mall/config/api.js

@@ -102,6 +102,7 @@ module.exports = {
     CouponList: NewApiRootUrl + 'coupon/list',  //个人优惠券列表
     CouponExchange: NewApiRootUrl + 'coupon/exchange',  //个人优惠券列表
     CouponTransActivit: NewApiRootUrl + 'coupon/transActivit',  //转发优惠券
+    checkActivit: NewApiRootUrl + 'coupon/checkActivit',  //校验是否领取优惠券
 
     smscodeSend: NewApiRootUrl + 'user/smscode',  //发送短信
 
@@ -125,6 +126,7 @@ module.exports = {
 
     UcenterIndex: NewApiRootUrl + 'index/ucenterIndex',  //个人中心首页
 
-    GetLogistics: NewApiRootUrl + 'order/getLogistics',  //查询物流信息
+  GetLogistics: NewApiRootUrl + 'order/getLogistics',  //查询物流信息
+  getCheckedDataByType: NewApiRootUrl + 'cart/getCheckedDataByType',  //校验该业务类型的购物车数据
 
 };

+ 36 - 7
wx-mall/pages/auth/newuser/newuser.js

@@ -10,7 +10,8 @@ Page({
     phone: '',
     smscode: '',
     second: '发送验证码',
-    disabled: false
+    disabled: false,
+    disabledUpdate: false
   },
   clearPhone(){
     this.setData({
@@ -52,6 +53,9 @@ Page({
       phone: that.data.phone
     }, 'POST').then(function (res) {
       if (res.errno === 0) {
+        wx.showToast({
+          title: '手机号绑定成功'
+        });
         wx.redirectTo({ url: '/pages/ucenter/coupon/coupon' });
       } else if (res.errno === 1) {
         // util.showErrorToast(res.errmsg);
@@ -75,7 +79,7 @@ Page({
       return false;
     }
     util.request(api.smscodeSend, {
-      mobile: that.data.phone
+      phone: that.data.phone
     }, 'POST').then(function (res) {
       let n = 59;
       var timer = setInterval(function () {
@@ -96,10 +100,19 @@ Page({
         wx.showToast({
           title: '短信发送成功'
         })
-      } else if (res.errno == 1) {
-        wx.showToast({
-          title: '短信已发送'
-        })
+      } else{
+        // util.showErrorToast(res.errmsg);
+        wx.showModal({
+          title: '',
+          content: res.errmsg,
+          showCancel: false
+        });
+        clearInterval(timer);
+        that.setData({
+          second: '发送验证码',
+          disabled: false
+        });
+        return false;
       }
     });
   },
@@ -107,7 +120,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    this.checkActivit();
   },
 
   /**
@@ -157,5 +170,21 @@ Page({
    */
   onShareAppMessage: function () {
 
+  },
+  checkActivit() {
+    let that = this;
+    util.request(api.checkActivit).then(function (res) {
+      if (res.errno === 2) {
+        wx.showModal({
+          title: '',
+          content: res.errmsg,
+          showCancel: false
+        });
+        that.setData({
+          disabled: true,
+          disabledUpdate: true
+        });
+      }
+    });
   }
 })

+ 3 - 3
wx-mall/pages/auth/newuser/newuser.wxml

@@ -2,13 +2,13 @@
   <view class="form-box">
 
     <view class="form-item">
-      <input class="phone" value="{{phone}}" type="number" maxlength="{{11}}" bindinput="bindPhoneInput" placeholder="手机号" auto-focus/>
+      <input class="phone" value="{{phone}}" disabled="{{disabledUpdate}}"  type="number" maxlength="{{11}}" bindinput="bindPhoneInput" placeholder="手机号" auto-focus/>
       <image wx:if="{{ phone.length > 0 }}" id="clear-phone" class="clear" src="/static/images/clear_input.png" catchtap="clearPhone"></image>
     </view>
 
     <view class="form-item-code">
       <view class="form-item code-item">
-        <input class="smscode" value="{{smscode}}" type="number" bindinput="bindSmscodeInput" placeholder="短信码" />
+        <input class="smscode" disabled="{{disabledUpdate}}" value="{{smscode}}" type="number" bindinput="bindSmscodeInput" placeholder="短信码" />
         <image class="clear" id="clear-smscode" wx:if="{{ smscode.length > 0 }}" src="/static/images/clear_input.png" catchtap="clearCode"></image>
       </view>
 
@@ -18,5 +18,5 @@
 
     </view>
   </view>
-  <button type="primary" class="login-btn" bindtap="getCoupon">提交</button>
+  <button type="primary" disabled="{{disabledUpdate}}"  class="login-btn" bindtap="getCoupon">提交</button>
 </view>

+ 133 - 12
wx-mall/pages/cart/cart.js

@@ -6,7 +6,11 @@ var app = getApp();
 
 Page({
   data: {
+    cartGoods00: [],//保税仓数据
+    cartGoods02: [],//保税展示数据
+    cartGoods11: [],//现场速递数据
     cartGoods: [],
+    goodsBizType: '',//货品业务类型
     footprintList: [],
     cartTotal: {
       "goodsCount": 0,
@@ -15,6 +19,9 @@ Page({
       "checkedGoodsAmount": 0.00
     },
     checkedAllStatus: true,
+    checkedTypeStatus00: true,
+    checkedTypeStatus02: true,
+    checkedTypeStatus11: true,
     couponInfoList: [],
     openAttr: false,
     specificationList: {},
@@ -41,24 +48,32 @@ Page({
     // 页面关闭
 
   },
-  getCartList: function () {
+  getCartList: function () {//获取购物车数据
     let that = this;
     util.request(api.CartList).then(function (res) {
       if (res.errno === 0) {
         that.setData({
           cartGoods: res.data.cartList,
+          cartGoods00: res.data.cart00List,
+          cartGoods02: res.data.cart02List,
+          cartGoods11: res.data.cart11List,
           cartTotal: res.data.cartTotal,
           couponInfoList: res.data.couponInfoList
         });
       }
-
+      //数据渲染选中
       that.setData({
         checkedAllStatus: that.isCheckedAll()
       });
+      that.setData({
+        checkedTypeStatus00: that.isCheckedTypeStatus00(),
+        checkedTypeStatus02: that.isCheckedTypeStatus02(),
+        checkedTypeStatus11: that.isCheckedTypeStatus11()
+      });
     });
   },
   isCheckedAll: function () {
-    //判断购物车商品已全选
+    //判断购物车所有商品是否已全选
     return this.data.cartGoods.every(function (element, index, array) {
       if (element.checked == true) {
         return true;
@@ -67,6 +82,36 @@ Page({
       }
     });
   },
+  isCheckedTypeStatus00: function () {
+      //判断该业务类型的购物车商品是否已全选
+      return this.data.cartGoods00.every(function (element, index, array) {
+        if (element.checked == true) {
+          return true;
+        } else {
+          return false;
+        }
+      });     
+  },
+  isCheckedTypeStatus02: function () {
+    //判断该业务类型的购物车商品是否已全选
+    return this.data.cartGoods02.every(function (element, index, array) {
+      if (element.checked == true) {
+        return true;
+      } else {
+        return false;
+      }
+    });
+  },
+  isCheckedTypeStatus11: function () {
+    //判断该业务类型的购物车商品是否已全选
+    return this.data.cartGoods11.every(function (element, index, array) {
+      if (element.checked == true) {
+        return true;
+      } else {
+        return false;
+      }
+    });
+  },
   toIndexPage: function () {
     wx.switchTab({
       url: "/pages/index/index"
@@ -84,12 +129,18 @@ Page({
         console.log(res.data);
         that.setData({
           cartGoods: res.data.cartList,
+          cartGoods00: res.data.cart00List,
+          cartGoods02: res.data.cart02List,
+          cartGoods11: res.data.cart11List,
           cartTotal: res.data.cartTotal,
           couponInfoList: res.data.couponInfoList
         });
       }
       that.setData({
-        checkedAllStatus: that.isCheckedAll()
+        checkedAllStatus: that.isCheckedAll(),
+        checkedTypeStatus00: that.isCheckedTypeStatus00(),
+        checkedTypeStatus02: that.isCheckedTypeStatus02(),
+        checkedTypeStatus11: that.isCheckedTypeStatus11()
       });
     });
 
@@ -117,6 +168,9 @@ Page({
         console.log(res.data);
         that.setData({
           cartGoods: res.data.cartList,
+          cartGoods00: res.data.cart00List,
+          cartGoods02: res.data.cart02List,
+          cartGoods11: res.data.cart11List,
           cartTotal: res.data.cartTotal,
           couponInfoList: res.data.couponInfoList
         });
@@ -125,6 +179,61 @@ Page({
       that.setData({
         checkedAllStatus: that.isCheckedAll()
       });
+      that.setData({
+        checkedTypeStatus00: that.isCheckedAll(),
+        checkedTypeStatus02: that.isCheckedAll(),
+        checkedTypeStatus11: that.isCheckedAll()
+      });
+    });
+  },
+  checkedAllGoodType: function (e) {
+    let that = this;
+    let goodsBizType = e.target.dataset.goodsBizType;
+    let isCheckedTypeStatu;
+    if (goodsBizType == '00') {
+      isCheckedTypeStatu = that.isCheckedTypeStatus00();
+    }
+    if (goodsBizType == '02') {
+      isCheckedTypeStatu = that.isCheckedTypeStatus02();
+    }
+    if (goodsBizType == '11') {
+      isCheckedTypeStatu = that.isCheckedTypeStatus11();
+    }
+    util.request(api.CartChecked, {
+      isChecked: isCheckedTypeStatu ? 0 : 1,
+      goodsBizType: goodsBizType
+    }, 'POST').then(function (res) {
+      if (res.errno === 0) {
+        console.log(res.data);
+        //渲染数据
+        that.setData({
+          cartGoods: res.data.cartList,
+          cartGoods00: res.data.cart00List,
+          cartGoods02: res.data.cart02List,
+          cartGoods11: res.data.cart11List,
+          cartTotal: res.data.cartTotal,
+          couponInfoList: res.data.couponInfoList,
+          goodsBizType: goodsBizType
+        });
+      }
+      if (goodsBizType == '00') {
+          that.setData({
+            checkedTypeStatus00: that.isCheckedTypeStatus00()
+        });
+      }
+      if (goodsBizType == '02') {
+        that.setData({
+          checkedTypeStatus02: that.isCheckedTypeStatus02()
+        });
+      }
+      if (goodsBizType == '11') {
+        that.setData({
+          checkedTypeStatus11: that.isCheckedTypeStatus11()
+        });
+      }
+      that.setData({
+        checkedAllStatus: that.isCheckedAll()
+      });
     });
   },
   updateCart: function (productId, goodsId, number, beforeNumber, id, itemIndex) {
@@ -138,7 +247,7 @@ Page({
     }, 'POST').then(function (res) {
       if (res.errno === 0) {
         console.log(res.data);
-        if (res.errmsg){
+        if (res.errmsg) {
           wx.showModal({
             title: '修改失败',
             showCancel: false,
@@ -148,16 +257,19 @@ Page({
 
         that.setData({
           cartGoods: res.data.cartList,
+          cartGoods00: res.data.cart00List,
+          cartGoods02: res.data.cart02List,
+          cartGoods11: res.data.cart11List,
           cartTotal: res.data.cartTotal,
           couponInfoList: res.data.couponInfoList
         });
       } else {
         // util.showErrorToast(res.errmsg);
-          wx.showModal({
-              title: '提示信息',
-              content: res.errmsg,
-              showCancel: false
-          });
+        wx.showModal({
+          title: '提示信息',
+          content: res.errmsg,
+          showCancel: false
+        });
         let cartItem = that.data.cartGoods[itemIndex];
         cartItem.number = beforeNumber;
         that.setData({
@@ -166,7 +278,10 @@ Page({
       }
 
       that.setData({
-        checkedAllStatus: that.isCheckedAll()
+        checkedAllStatus: that.isCheckedAll(),
+        checkedTypeStatus00: that.isCheckedTypeStatus00(),
+        checkedTypeStatus02: that.isCheckedTypeStatus02(),
+        checkedTypeStatus11: that.isCheckedTypeStatus11()
       });
     });
   },
@@ -231,13 +346,19 @@ Page({
             if (res.errno === 0) {
               that.setData({
                 cartGoods: res.data.cartList,
+                cartGoods00: res.data.cart00List,
+                cartGoods02: res.data.cart02List,
+                cartGoods11: res.data.cart11List,
                 cartTotal: res.data.cartTotal,
                 couponInfoList: res.data.couponInfoList
               });
             }
 
             that.setData({
-              checkedAllStatus: that.isCheckedAll()
+              checkedAllStatus: that.isCheckedAll(),
+              checkedTypeStatus00: that.isCheckedTypeStatus00(),
+              checkedTypeStatus02: that.isCheckedTypeStatus02(),
+              checkedTypeStatus11: that.isCheckedTypeStatus11()
             });
           });
           console.log('用户点击确定')

+ 77 - 4
wx-mall/pages/cart/cart.wxml

@@ -26,9 +26,9 @@
     <view class="list">
       <view class="group-item">
         <view class="goods">
-          <view class="item" wx:for="{{cartGoods}}" wx:key="{{item.id}}">
-            <view class='title_'>
-            <text class="title-name">{{item.goodsBizType}}</text> </view>
+          
+          <view wx:if="{{cartGoods00.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus00 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="00"><text class="title-name">保税仓</text></view>
+          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 00}}" wx:key="{{item.id}}">
             <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
             <view class="cart-goods">
               <navigator url="/pages/goods/goods?id={{item.goods_id}}">
@@ -60,7 +60,80 @@
               </view>
             </view>
           </view>
-        </view>
+
+        <view wx:if="{{cartGoods02.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus02 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="02"><text class="title-name">保税展示</text></view>
+
+          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 02}}" wx:key="{{item.id}}">
+            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
+            <view class="cart-goods">
+              <navigator url="/pages/goods/goods?id={{item.goods_id}}">
+                <image class="img" src="{{item.list_pic_url}}"></image>
+              </navigator>
+              <view class="info">
+                <view class="t">
+                  <navigator url="/pages/goods/goods?id={{item.goods_id}}">
+                    <text class="name">{{item.goods_name}}</text>
+                  </navigator>
+                  <view class="goods-do">
+                    <text class="price">¥{{item.retail_price}}</text>
+                    <text class="org-price line-through">¥{{item.market_price}}</text>
+                  </view>
+                </view>
+                <view class="attr">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}
+                </view>
+                <!-- //数量加减 -->
+                <view class="number-item">
+                  <view class="selnum">
+                    <view class="cut" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" bindtap="cutNumber"></view>
+                    <input value="{{item.number}}" class="number" disabled="true" type="number" />
+                    <view class="add" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" bindtap="addNumber"></view>
+                  </view>
+                </view>
+                <view class="handle">
+                  <image catchtap="deleteCart" data-cart-id="{{item.id}}" data-goods-name="{{item.goods_name}}" class="del" src="/static/images/del-address.png"></image>
+                </view>
+              </view>
+            </view>
+          </view>
+
+   
+          <view wx:if="{{cartGoods11.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus11 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="11"><text class="title-name">现场速递</text></view>
+
+          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 11}}" wx:key="{{item.id}}">
+            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
+            <view class="cart-goods">
+              <navigator url="/pages/goods/goods?id={{item.goods_id}}">
+                <image class="img" src="{{item.list_pic_url}}"></image>
+              </navigator>
+              <view class="info">
+                <view class="t">
+                  <navigator url="/pages/goods/goods?id={{item.goods_id}}">
+                    <text class="name">{{item.goods_name}}</text>
+                  </navigator>
+                  <view class="goods-do">
+                    <text class="price">¥{{item.retail_price}}</text>
+                    <text class="org-price line-through">¥{{item.market_price}}</text>
+                  </view>
+                </view>
+                <view class="attr">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}
+                </view>
+                <!-- //数量加减 -->
+                <view class="number-item">
+                  <view class="selnum">
+                    <view class="cut" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" bindtap="cutNumber"></view>
+                    <input value="{{item.number}}" class="number" disabled="true" type="number" />
+                    <view class="add" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" bindtap="addNumber"></view>
+                  </view>
+                </view>
+                <view class="handle">
+                  <image catchtap="deleteCart" data-cart-id="{{item.id}}" data-goods-name="{{item.goods_name}}" class="del" src="/static/images/del-address.png"></image>
+                </view>
+              </view>
+            </view>
+          </view>
+
+          
+          </view>
       </view>
     </view>
 

+ 15 - 4
wx-mall/pages/cart/cart.wxss

@@ -639,16 +639,27 @@ page {
 
 .title-name {
   width: 100%;
+  height: 30rpx;
   text-align: center;
   font-size: 28rpx;
   color: rgba(87, 86, 86, 0.63);
   background:url(http://image.meiping123.com/upload/20180104/1055343561cd30.png) no-repeat center 205rpx;
   background-size: 100rpx 100rpx;
-  margin-bottom: 10rpx;
-  margin-left: 30rpx;
+  margin-left: 60rpx;
   font-weight: bolder;
 }
-.title_{
-  height: 20rpx;
+
+.checkbox-biz-type {
+  float: left;
+  height: 30rpx;
+  width: 100%;
   margin-top: 10rpx;
+  margin-left: 24rpx;
+  background: url(http://image.meiping123.com/upload/20180104/105653607bcb4b.png) no-repeat;
+  background-size: 30rpx;
+}
+
+.checkbox-biz-type.checked {
+  background: url(http://image.meiping123.com/upload/20180104/1057387862b4e8.png) no-repeat;
+  background-size: 30rpx;
 }

+ 34 - 9
wx-mall/pages/catalog/catalog.js

@@ -1,5 +1,7 @@
 var util = require('../../utils/util.js');
 var api = require('../../config/api.js');
+//获取应用实例
+const app = getApp();
 
 Page({
   data: {
@@ -17,6 +19,7 @@ Page({
     currentSortType: 'default',
     currentSortOrder: 'desc',
     filterDiscount: 0,// 0不限 1特价 2活动
+    goodsBizType: app.globalData.appGoodsBizType,//业务类型
     page: 1,
     size: 50,
     showNavList: false,
@@ -39,13 +42,16 @@ Page({
   onLoad: function (options) {
     let that = this;
     // 页面初始化 options为页面跳转所带来的参数
-    if (options.referrer) {
+    if (options.referrer){
       that.setData({
         referrer: parseInt(options.referrer),
         sourceKey: options.sourceKey,
         openCoupon: true
       });
     }
+    that.setData({
+      goodsBizType: app.globalData.appGoodsBizType
+    });
 
     wx.setNavigationBarTitle({
       title: '分类'
@@ -91,6 +97,9 @@ Page({
     // 页面渲染完成
   },
   onShow: function () {
+    this.setData({
+      goodsBizType: app.globalData.appGoodsBizType
+    });
     // 页面显示
     this.getFootCart();
     this.getCatalog();
@@ -129,12 +138,14 @@ Page({
   },
   getGoodsList() {
     var that = this;
+    console.log(that.data);
     util.request(api.CatalogProductList, {
       page: that.data.page,
       size: that.data.size,
       order: that.data.currentSortOrder,
       sort: that.data.currentSortType,
-      discount: that.data.filterDiscount,
+      // discount: that.data.filterDiscount,
+      goodsBizType: that.data.goodsBizType,
       categoryId: that.data.currentCategory.id
     })
       .then(function (res) {
@@ -216,23 +227,25 @@ Page({
     });
   },
   openSortFilter: function (event) {
+    let that = this; 
     let currentId = event.currentTarget.id;
+    console.log('currentId:'+currentId);
     switch (currentId) {
       case 'defaultActivity':
-        this.setData({
-          'filterDiscount': 0
+        that.setData({
+          'goodsBizType': '00'
         });
         this.getGoodsList();
         break;
       case 'discountActivity':
-        this.setData({
-          'filterDiscount': 1
+        that.setData({
+          'goodsBizType': '02'
         });
         this.getGoodsList();
         break;
       case 'groupActivity':
-        this.setData({
-          'filterDiscount': 2
+        that.setData({
+          'goodsBizType': '10'
         });
         this.getGoodsList();
         break;
@@ -307,5 +320,17 @@ Page({
     wx.navigateTo({
       url: url,
     })
-  },
+  }, 
+  sercherCategory: function (e) {
+    var that = this;
+    let url = '';
+    var id = e.currentTarget.dataset.replyType;
+    // console.log('replyType:' + e.currentTarget.dataset.replyType);
+    // console.log('goodsBizType:' + that.data.goodsBizType);
+    // 跳转页面
+    wx.navigateTo({
+      url: '/pages/category/category?id=' + id + '&&goodsBizType=' + that.data.goodsBizType
+    })
+
+  }
 })

+ 6 - 5
wx-mall/pages/catalog/catalog.wxml

@@ -57,13 +57,13 @@
   </view>
   <view class="activity">
     <view class="activity-box">
-      <view class="item {{filterDiscount == 0 ? 'active' : ''}}" bindtap="openSortFilter" id="defaultActivity">
+      <view class="item {{goodsBizType == '00' ? 'active' : ''}}" bindtap="openSortFilter" id="defaultActivity">
         <text class="txt">保税仓</text>
       </view>
-      <view class="item by-sell {{filterDiscount == 1 ? 'active' : ''}}" bindtap="openSortFilter" id="discountActivity">
+      <view class="item by-sell {{goodsBizType == '02' ? 'active' : ''}}" bindtap="openSortFilter" id="discountActivity">
         <text class="txt">保税展示</text>
       </view>
-      <view class="item by-price {{filterDiscount == 2 ? 'active' : ''}}" bindtap="openSortFilter" id="groupActivity">
+      <view class="item by-price {{goodsBizType == '10' ? 'active' : ''}}" bindtap="openSortFilter" id="groupActivity">
         <text class="txt">现场速递</text>
       </view>
     </view>
@@ -87,7 +87,7 @@
         <text class="line"></text>
       </view>
       <view class="bd">
-        <navigator url="/pages/category/category?id={{item.id}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:for="{{currentCategory.subCategoryList}}" wx:key="{{item.id}}">
+        <navigator bindtap="sercherCategory" data-reply-Type="{{item.id}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:for="{{currentCategory.subCategoryList}}" wx:key="{{item.id}}">
           <image class="icon" wx:if="{{item.wap_banner_url}}" src="{{item.wap_banner_url}}"></image>
           <text class="txt">{{item.name}}</text>
         </navigator>
@@ -106,6 +106,7 @@
         </view>
       </view>
       <view class="cate-item">
+        <view wx:if="{{goodsList.length == 0}}" class="item-text">未找到相关商品</view>
         <view class="item" wx:for="{{goodsList}}" wx:for-index="index" wx:for-item="item" wx:key="{{item.id}}">
           <navigator url="{{filterDiscount != 2 ?'/pages/goods/goods?id='+item.id:'/pages/groupDetail/groupDetail?id='+item.group_id }}">
             <view class="left">
@@ -134,7 +135,7 @@
             </view>
 
           </view>
-    </navigator>
+        </navigator>
 
         </view>
       </view>

+ 7 - 1
wx-mall/pages/catalog/catalog.wxss

@@ -260,7 +260,13 @@ page {
   height: 272rpx;
   width: 100%;
 }
-
+.item-text{
+  margin-top: 10rpx;
+  height: 100rpx;
+  width: 100%;
+  color: #a8a6a6;
+  text-align: center;
+}
 .cate-item .item .left {
   width: 190rpx;
   height: 272rpx;

+ 16 - 8
wx-mall/pages/category/category.js

@@ -8,6 +8,7 @@ Page({
         navList: [],
         goodsList: [],
         id: 0,
+        goodsBizType: '00',
         currentTab: 0,
         navIndex: 0,
         currentCategory: {},
@@ -65,8 +66,8 @@ Page({
     },
     onLoad: function (options) {
         // 页面初始化 options为页面跳转所带来的参数
-        var that = this;
-        if (options.id) {
+      var that = this; 
+      if (options.id) {
             that.setData({
                 id: parseInt(options.id)
             });
@@ -77,6 +78,11 @@ Page({
                 goodsList: [],
             });
         }
+      if (options.goodsBizType) {
+        that.setData({
+          goodsBizType: options.goodsBizType
+        });
+      } 
         wx.getSystemInfo({
             success: function (res) {
                 var clientHeight = res.windowHeight,
@@ -102,9 +108,9 @@ Page({
     },
     getCategoryInfo: function () {
         let that = this;
-        util.request(api.GoodsCategory, {id: this.data.id})
-            .then(function (res) {
-
+      console.log('idd:' + that.data.id);
+      util.request(api.GoodsCategory, { id: that.data.id, goodsBizType: that.data.goodsBizType})
+        .then(function (res) {
                 if (res.errno == 0) {
                     that.setData({
                         navList: res.data.brotherCategory,
@@ -128,7 +134,7 @@ Page({
                     that.setData({
                         currentTab: currentIndex,
                         navIndex: currentIndex
-                    });
+                  });
                     that.getGoodsList();
                 } else {
                     //显示错误信息
@@ -169,7 +175,8 @@ Page({
     getGoodsList: function () {
         var that = this;
 
-        util.request(api.GoodsList, {categoryId: that.data.id, page: that.data.page, size: that.data.size})
+        console.log('goodsBizType13:' + that.data.goodsBizType);
+      util.request(api.GoodsList, { categoryId: that.data.id, goodsBizType: that.data.goodsBizType, page: that.data.page, size: that.data.size})
             .then(function (res) {
                 let goodsList = that.data.goodsList;
                 goodsList = goodsList.concat(res.data.data);
@@ -319,7 +326,8 @@ Page({
             });
         }
         this.setData({
-            id: event.currentTarget.dataset.id
+            id: event.currentTarget.dataset.id,
+            goodsBizType: that.data.goodsBizType
         });
         this.getCategoryInfo();
     },

+ 1 - 1
wx-mall/pages/goods/goods.wxml

@@ -49,7 +49,7 @@
     </view>
     <view class="goods-info">
       <view class="c">
-        <text class="name">{{goods.goodsBizType}} {{goods.name}}</text>
+        <text class="name">{{goods.name}}</text>
         <text class="desc">{{goods.goods_brief}}</text>
         <view class="goods-do">
           <text class="price">¥{{goods.retail_price}}</text>

+ 54 - 12
wx-mall/pages/index/index.js

@@ -3,7 +3,7 @@ const api = require('../../config/api.js');
 const user = require('../../services/user.js');
 
 //获取应用实例
-const app = getApp()
+const app = getApp();
 Page({
   data: {
     groupGoods: [],
@@ -95,6 +95,16 @@ Page({
       url: '../search/search',
     })
   },
+  goCatalog: function (e) {
+    let url = '';
+    // console.log('dataset.goodsBizType:' + e.currentTarget.dataset.goodsBizType);
+    app.globalData.appGoodsBizType = e.currentTarget.dataset.goodsBizType;
+    // console.log('appgoodsBizType1:' + app.globalData.appGoodsBizType);
+    
+    wx.switchTab({
+      url: '/pages/catalog/catalog',
+    });
+  },
   onReachBottom: function () {
 
     if (this.data.bottomLoadDone === true || this.data.bottomLoading === true) {
@@ -247,6 +257,9 @@ Page({
   scanGoodsCode: function (e) {
     var that = this;
     var code;
+    var value;
+    var substrValue;
+    var scanType;
     // 调起客户端扫码界面进行扫码
     wx.scanCode({
       // 是否只能从相机扫码
@@ -254,21 +267,50 @@ Page({
       // 扫码类型, barCode:一维码, qrCode:二维码
       scanType: ['barCode', 'qrCode'],
       success: function (res) {
-        that.code = "结果:" + res.result + ",路径:" + res.path;
+        that.code = "结果:" + res.result + ",路径:" + res.path + ",编码:" + res.rawData;
+        that.value = res.result;
+        that.scanType = res.scanType;
         that.setData({
           goodsCode: that.code
-        })
+        });
+
+        if (that.scanType == 'QR_CODE') {//二维码
+          that.substrValue = that.value.substring(0, 5);
+          that.value = that.value.substring(5, that.value.length);
+          if (that.substrValue != 'emato') {//../goods/goods?id=
+            wx.showModal({
+              title: '',
+              content: '您所扫描的商品无效',
+              showCancel: false,
+              success: function (res) {
+                if (res.confirm) {
+                  console.log('用户点击确定')
+                } else if (res.cancel) {
+                  console.log('用户点击取消')
+                }
+              }
+            });
+          } else {
+            // 跳转页面
+            wx.navigateTo({
+              url: that.value,
+              success: function (e) {
+                console.log('跳转成功');
+              },
+              fail: function (e) {
+                console.log('跳转失败');
+              }
+            })
 
-        // 跳转页面
-        wx.navigateTo({
-          url: '../details/details?id=111',
-          success: function (e) {
-            console.log('跳转成功')
-          },
-          fail: function (e) {
-            console.log('跳转失败')
           }
-        })
+        }else{//其他码
+          //弹框显示结果
+          wx.showModal({
+            title: '扫描结果',
+            content: that.value,
+            showCancel: false
+          });
+        }
       },
 
       fail: function () {

+ 8 - 5
wx-mall/pages/index/index.wxml

@@ -1,6 +1,9 @@
 <!--index.wxml-->
 <view class="container">
 
+<template name="dialog">
+</template>
+
   <view class="modal-wrap" wx:if="{{showPop}}" bindtap="showCouponPop">
     <view class="discount-dialog">
       <!-- <view class="dialog-title">{{couponVo.name}}</view> -->
@@ -32,25 +35,25 @@
     </swiper-item>
   </swiper>
   <view class="m-menu">
-    <navigator class="itemb">
+    <navigator class="itemb" bindtap="goCatalog" data-goods-Biz-Type="00">
       <image src="../../static/images/service-bao.png" background-size="cover"></image>
       <text>保税仓</text>
     </navigator>
-    <navigator class="itemb">
+    <navigator class="itemb" bindtap="goCatalog" data-goods-Biz-Type="02">
       <image src="../../static/images/service-zs.png" background-size="cover"></image>
       <text>保税展示</text>
     </navigator>
-    <navigator class="itemb">
+    <navigator class="itemb" bindtap="goCatalog" data-goods-Biz-Type="10">
       <image src="../../static/images/service-ziti.png" background-size="cover"></image>
       <text>现场速递</text>
     </navigator>
   </view>
-  <view class="m-menu">
+  <!-- <view class="m-menu">
     <navigator class="item" url="{{item.url}}" wx:for="{{channel}}" wx:key="{{item.id}}">
       <image src="{{item.icon_url}}" background-size="cover"></image>
       <text>{{item.name}}</text>
     </navigator>
-  </view>
+  </view> -->
   <!-- <view class="a-section a-brand">
     <view class="h">
       <navigator url="../brand/brand">

+ 3 - 2
wx-mall/pages/pay/pay.js

@@ -4,15 +4,16 @@ var api = require('../../config/api.js');
 
 Page({
   data: {
-    orderId: 0,
+    orderIds: [],
     actualPrice: 0.00
   },
   onLoad: function (options) {
     // 页面初始化 options为页面跳转所带来的参数
     this.setData({
-      orderId: options.orderId,
+      orderIds: options.orderIds,
       actualPrice: options.actualPrice
     })
+    console.log(this.data.orderIds);
   },
   onReady: function () {
 

+ 8 - 1
wx-mall/pages/shopping/checkout/checkout.js

@@ -163,8 +163,15 @@ Page({
       delivery_remark: that.data.delivery_remark
     }, 'POST').then(function (res) {
       if (res.errno === 0) {
+        let actualPrice = that.data.actualPrice;
+        let orderIds = [];
+        for (let i = 0; i < res.data.orderInfo.length; i++){
+          orderIds[i] = res.data.orderInfo[i].id;
+        }
+        console.log(actualPrice);
+        console.log(orderIds);
         wx.redirectTo({
-          url: '/pages/pay/pay?orderId=' + res.data.orderInfo.id + '&actualPrice=' + res.data.orderInfo.actual_price
+          url: '/pages/pay/pay?orderIds=' + orderIds + '&actualPrice=' + actualPrice
         })
 
       } else {