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

修改支持部分商品的活动逻辑

hyq 5 роки тому
батько
коміт
4cc35f3367
41 змінених файлів з 1212 додано та 509 видалено
  1. 10 1
      kmall-admin/src/main/webapp/js/statis/mkstoretopicstat.js
  2. 1 1
      kmall-api/src/main/java/com/kmall/api/api/ApiStoreCampMinusController.java
  3. 11 0
      kmall-api/src/main/java/com/kmall/api/dto/CampMinusDto.java
  4. 19 0
      kmall-api/src/main/java/com/kmall/api/dto/UserCouponDto.java
  5. 53 0
      kmall-api/src/main/java/com/kmall/api/entity/CartVo.java
  6. 30 0
      kmall-api/src/main/java/com/kmall/api/entity/OrderGoodsVo.java
  7. 20 0
      kmall-api/src/main/java/com/kmall/api/entity/OrderVo.java
  8. 11 0
      kmall-api/src/main/java/com/kmall/api/entity/UserCouponVo.java
  9. 4 3
      kmall-api/src/main/java/com/kmall/api/entity/mk/MkStoreCampMinusVo.java
  10. 123 19
      kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java
  11. 64 7
      kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java
  12. 1 0
      kmall-api/src/main/java/com/kmall/api/service/ApiUserCouponService.java
  13. 37 26
      kmall-api/src/main/java/com/kmall/api/service/mk/ApiMkStoreCampMinusService.java
  14. 21 0
      kmall-api/src/main/java/com/kmall/api/service/mk/ApiMkStoreTicketDiscountService.java
  15. 8 0
      kmall-api/src/main/resources/mybatis/mapper/ApiCartMapper.xml
  16. 9 3
      kmall-api/src/main/resources/mybatis/mapper/ApiOrderGoodsMapper.xml
  17. 3 1
      kmall-api/src/main/resources/mybatis/mapper/ApiOrderMapper.xml
  18. 9 3
      kmall-api/src/main/resources/mybatis/mapper/mk/ApiMkStoreCampMinusMapper.xml
  19. 2 1
      wx-mall/app.json
  20. 5 5
      wx-mall/app.wxss
  21. 13 13
      wx-mall/pages/cart/cart.wxml
  22. 8 4
      wx-mall/pages/catalog/catalog.js
  23. 6 6
      wx-mall/pages/catalog/catalog.wxml
  24. 11 8
      wx-mall/pages/catalog/catalog.wxss
  25. 219 102
      wx-mall/pages/goods/goods.js
  26. 39 6
      wx-mall/pages/goods/goods.wxml
  27. 23 2
      wx-mall/pages/goods/goods.wxss
  28. 12 11
      wx-mall/pages/hotGoods/hotGoods.wxml
  29. 60 54
      wx-mall/pages/index/index.js
  30. 33 27
      wx-mall/pages/index/index.wxml
  31. 9 2
      wx-mall/pages/index/index.wxss
  32. 4 0
      wx-mall/pages/pay/pay.js
  33. 76 53
      wx-mall/pages/shopping/checkout/checkout.js
  34. 29 20
      wx-mall/pages/shopping/checkout/checkout.wxml
  35. 14 1
      wx-mall/pages/shopping/checkout/checkout.wxss
  36. 20 21
      wx-mall/pages/ucenter/order/order.wxml
  37. 63 52
      wx-mall/pages/ucenter/order/order.wxss
  38. 54 38
      wx-mall/pages/ucenter/orderDetail/orderDetail.wxml
  39. 66 18
      wx-mall/pages/ucenter/orderDetail/orderDetail.wxss
  40. 1 1
      wx-mall/project.config.json
  41. 11 0
      wx-mall/utils/util.js

+ 10 - 1
kmall-admin/src/main/webapp/js/statis/mkstoretopicstat.js

@@ -198,7 +198,16 @@ $(function () {
                     colModel : [
                         {label: '商品',name : "goodsName",index : "goodsName",  width : 130, align : "center"},
                         {label: '数量',name : "number",index : "number",width : 70, align : "center"},
-                        {label: '商品价格', name: 'retailPrice', index: 'retail_price', width: 80, align: 'center'}
+                        {label: '商品价格', name: 'retailPrice', index: 'retail_price', width: 80, align: 'center'},
+                        {label: '优惠使用', name: 'storeTopicId', index: 'store_topic_id', width: 80, align: 'center',
+                            formatter: function (value, col, row) {
+                                if (value == null || value == '') {
+                                    return '<span style="color: #cccccc">未使用</span>';
+                                }else{
+                                    return '<span style="color: red">'+value+'</span>';
+                                }
+                                return value;
+                            }},
                     ],
                     sortname : 'num',
                     sortorder : "asc",

+ 1 - 1
kmall-api/src/main/java/com/kmall/api/api/ApiStoreCampMinusController.java

@@ -77,7 +77,7 @@ public class ApiStoreCampMinusController extends ApiBaseAction {
     public Object getStoreCampMinusByGoodsIdList(@LoginUser UserVo loginUser, Integer storeId, Integer goodsId,
                                            @RequestParam(value = "page", defaultValue = "1") Integer page,
                                            @RequestParam(value = "size", defaultValue = "10") Integer size) {
-        List<MkStoreCampMinusVo> campMinusVoList = apiMkStoreCampMinusService.queryStoreCampMinusByGoodsId(storeId, getUserId(), goodsId);
+        List<MkStoreCampMinusVo> campMinusVoList = apiMkStoreCampMinusService.queryStoreCampMinusByGoodsId(storeId, null, goodsId);
         List<MkStoreCampMinusVo> resultCampMinusList = new ArrayList<>();
         if(size <= campMinusVoList.size()) {
             for (int i = 0; i < size; i++) {

+ 11 - 0
kmall-api/src/main/java/com/kmall/api/dto/CampMinusDto.java

@@ -1,6 +1,7 @@
 package com.kmall.api.dto;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 /**
  * @author huangyq
@@ -20,6 +21,16 @@ public class CampMinusDto {
 
     private Integer storeTopicId;
 
+    private List<Integer> goodsIds;
+
+    public List<Integer> getGoodsIds() {
+        return goodsIds;
+    }
+
+    public void setGoodsIds(List<Integer> goodsIds) {
+        this.goodsIds = goodsIds;
+    }
+
     public String getCampMinusType() {
         return campMinusType;
     }

+ 19 - 0
kmall-api/src/main/java/com/kmall/api/dto/UserCouponDto.java

@@ -17,6 +17,25 @@ public class UserCouponDto {
     private BigDecimal goodsTotalPrice;
     private List<CartVo> cartGoodsList;
 
+    private Integer campId;
+    private Integer tickDiscId;
+
+    public Integer getTickDiscId() {
+        return tickDiscId;
+    }
+
+    public void setTickDiscId(Integer tickDiscId) {
+        this.tickDiscId = tickDiscId;
+    }
+
+    public Integer getCampId() {
+        return campId;
+    }
+
+    public void setCampId(Integer campId) {
+        this.campId = campId;
+    }
+
     public Long getStoreId() {
         return storeId;
     }

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

@@ -3,6 +3,7 @@ package com.kmall.api.entity;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 
 /**
@@ -81,6 +82,58 @@ public class CartVo implements Serializable {
      */
     private String isSupplierGoods;
 
+    //指定商品参与、全部商品参与的满减活动
+    private String campName;
+
+    //指定商品不参与的满减活动
+    private String campNameByNotGoods;
+
+    private List<String> campNameList;
+
+    private String isCamp;
+
+    private String isDiscount;
+
+    public String getIsDiscount() {
+        return isDiscount;
+    }
+
+    public void setIsDiscount(String isDiscount) {
+        this.isDiscount = isDiscount;
+    }
+
+    public String getIsCamp() {
+        return isCamp;
+    }
+
+    public void setIsCamp(String isCamp) {
+        this.isCamp = isCamp;
+    }
+
+    public List<String> getCampNameList() {
+        return campNameList;
+    }
+
+    public void setCampNameList(List<String> campNameList) {
+        this.campNameList = campNameList;
+    }
+
+    public String getCampName() {
+        return campName;
+    }
+
+    public void setCampName(String campName) {
+        this.campName = campName;
+    }
+
+    public String getCampNameByNotGoods() {
+        return campNameByNotGoods;
+    }
+
+    public void setCampNameByNotGoods(String campNameByNotGoods) {
+        this.campNameByNotGoods = campNameByNotGoods;
+    }
+
     public String getSupplierThirdMerchCode() {
         return supplierThirdMerchCode;
     }

+ 30 - 0
kmall-api/src/main/java/com/kmall/api/entity/OrderGoodsVo.java

@@ -62,6 +62,36 @@ public class OrderGoodsVo implements Serializable {
 
     private String merchSn;
 
+    private Integer storeTopicId;
+
+    private Integer campTopicId;
+
+    private Integer distcountTopicId;
+
+    public Integer getCampTopicId() {
+        return campTopicId;
+    }
+
+    public void setCampTopicId(Integer campTopicId) {
+        this.campTopicId = campTopicId;
+    }
+
+    public Integer getDistcountTopicId() {
+        return distcountTopicId;
+    }
+
+    public void setDistcountTopicId(Integer distcountTopicId) {
+        this.distcountTopicId = distcountTopicId;
+    }
+
+    public Integer getStoreTopicId() {
+        return storeTopicId;
+    }
+
+    public void setStoreTopicId(Integer storeTopicId) {
+        this.storeTopicId = storeTopicId;
+    }
+
     public String getMerchSn() {
         return merchSn;
     }

+ 20 - 0
kmall-api/src/main/java/com/kmall/api/entity/OrderVo.java

@@ -205,6 +205,26 @@ public class OrderVo implements Serializable {
 
     private String campName;
 
+    private String applyType;
+
+    private String discountApplyType;
+
+    public String getDiscountApplyType() {
+        return discountApplyType;
+    }
+
+    public void setDiscountApplyType(String discountApplyType) {
+        this.discountApplyType = discountApplyType;
+    }
+
+    public String getApplyType() {
+        return applyType;
+    }
+
+    public void setApplyType(String applyType) {
+        this.applyType = applyType;
+    }
+
     public Integer getCampMinusId() {
         return campMinusId;
     }

+ 11 - 0
kmall-api/src/main/java/com/kmall/api/entity/UserCouponVo.java

@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 
 /**
@@ -79,6 +80,16 @@ public class UserCouponVo implements Serializable {
     @JsonFormat(pattern = "yyyy.MM.dd")
     private Date validTime;
 
+    private List<Integer> goodsList;
+
+    public List<Integer> getGoodsList() {
+        return goodsList;
+    }
+
+    public void setGoodsList(List<Integer> goodsList) {
+        this.goodsList = goodsList;
+    }
+
     public Date getValidTime() {
         return validTime;
     }

+ 4 - 3
kmall-api/src/main/java/com/kmall/api/entity/mk/MkStoreCampMinusVo.java

@@ -5,6 +5,7 @@ import com.kmall.common.constant.Dict;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 门店满减活动实体
@@ -114,7 +115,7 @@ public class MkStoreCampMinusVo implements Serializable {
 
     private Integer goodsId;
 
-    private Integer[] goodsIds;
+    private List<Integer> goodsIds;
 
     public Integer getGoodsId() {
         return goodsId;
@@ -124,11 +125,11 @@ public class MkStoreCampMinusVo implements Serializable {
         this.goodsId = goodsId;
     }
 
-    public Integer[] getGoodsIds() {
+    public List<Integer> getGoodsIds() {
         return goodsIds;
     }
 
-    public void setGoodsIds(Integer[] goodsIds) {
+    public void setGoodsIds(List<Integer> goodsIds) {
         this.goodsIds = goodsIds;
     }
 

+ 123 - 19
kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java

@@ -13,6 +13,7 @@ import com.kmall.common.constant.Dict;
 import com.kmall.common.utils.Constant;
 import com.kmall.common.utils.MapUtils;
 import com.kmall.common.utils.RRException;
+import com.kmall.common.utils.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -312,14 +313,27 @@ public class ApiCartService {
      * @param actualPrice
      * @return
      */
-    public BigDecimal mathActualPrice(UserCouponVo checkedCoupon, BigDecimal actualPrice){
+    public BigDecimal mathActualPrice(UserCouponVo checkedCoupon, BigDecimal actualPrice,List<CartVo> checkedGoodsList){
+        BigDecimal actualPrice2 = Constant.ZERO;
+        BigDecimal actualPrice3 = Constant.ZERO;
         if(checkedCoupon != null){
             if (checkedCoupon.getTickDiscType().equalsIgnoreCase(Dict.tickDiscType.item_00.getItem())) {
                 actualPrice = actualPrice.subtract(checkedCoupon.getTypeMoney());
             }
             if (checkedCoupon.getTickDiscType().equalsIgnoreCase(Dict.tickDiscType.item_01.getItem())) {
+                for(int i = 0; i < checkedGoodsList.size(); i++){
+                    CartVo cartVo = checkedGoodsList.get(i);
+                    List<Integer> goodsIds = checkedCoupon.getGoodsList();
+                    for(int j=0;j<goodsIds.size();j++){
+                        if(cartVo.getGoods_id().compareTo(Long.valueOf(goodsIds.get(j)))==0){
+                            actualPrice2 = actualPrice2.add(cartVo.getRetail_price().multiply(BigDecimal.valueOf(cartVo.getNumber())));
+                        }else{
+                            actualPrice3 = actualPrice3.add(cartVo.getRetail_price().multiply(BigDecimal.valueOf(cartVo.getNumber())));
+                        }
+                    }
+                }
                 //实付金额*(优惠券折扣*0.1) = 折扣后的实付金额
-                actualPrice = actualPrice.multiply(checkedCoupon.getTypeMoney().multiply(new BigDecimal(0.1))).setScale(2, BigDecimal.ROUND_HALF_UP);//满多少打几折
+                actualPrice = actualPrice3.add(actualPrice2.multiply(checkedCoupon.getTypeMoney().multiply(new BigDecimal(0.1))).setScale(2, BigDecimal.ROUND_HALF_UP));//满多少打几折
             }
         }
         return actualPrice;
@@ -331,14 +345,27 @@ public class ApiCartService {
      * @param actualPrice
      * @return
      */
-    public BigDecimal mathActualPriceByCamp(CampMinusDto checkedCampMinus, BigDecimal actualPrice){
+    public BigDecimal mathActualPriceByCamp(CampMinusDto checkedCampMinus, BigDecimal actualPrice,List<CartVo> checkedGoodsList){
+        BigDecimal actualPrice2 = Constant.ZERO;
+        BigDecimal actualPrice3 = Constant.ZERO;
         if(checkedCampMinus != null){
             if (checkedCampMinus.getCampMinusType().equalsIgnoreCase(Dict.campMinusType.item_00.getItem()) || checkedCampMinus.getCampMinusType().equalsIgnoreCase(Dict.campMinusType.item_01.getItem())) {
                 actualPrice = actualPrice.subtract(checkedCampMinus.getMoney());
             }
             if (checkedCampMinus.getCampMinusType().equalsIgnoreCase(Dict.campMinusType.item_10.getItem()) || checkedCampMinus.getCampMinusType().equalsIgnoreCase(Dict.campMinusType.item_11.getItem())) {
+                for(int i = 0; i < checkedGoodsList.size(); i++){
+                    CartVo cartVo = checkedGoodsList.get(i);
+                    List<Integer> goodsIds = checkedCampMinus.getGoodsIds();
+                    for(int j=0;j<goodsIds.size();j++){
+                        if(cartVo.getGoods_id().compareTo(Long.valueOf(goodsIds.get(j)))==0){
+                            actualPrice2 = actualPrice2.add(cartVo.getRetail_price().multiply(BigDecimal.valueOf(cartVo.getNumber())));
+                        }else{
+                            actualPrice3 = actualPrice3.add(cartVo.getRetail_price().multiply(BigDecimal.valueOf(cartVo.getNumber())));
+                        }
+                    }
+                }
                 //实付金额*(满减满折折扣*0.1) = 折扣后的实付金额
-                actualPrice = actualPrice.multiply(checkedCampMinus.getMoney().multiply(new BigDecimal(0.1))).setScale(2, BigDecimal.ROUND_HALF_UP);//满多少打几折
+                actualPrice = actualPrice3.add(actualPrice2.multiply(checkedCampMinus.getMoney().multiply(new BigDecimal(0.1))).setScale(2, BigDecimal.ROUND_HALF_UP));//满多少打几折
             }
         }
         return actualPrice;
@@ -467,6 +494,12 @@ public class ApiCartService {
             userCouponDto00.setGoodsTotalPrice(goodsTotalPrice00);
             userCouponDto00.setCartGoodsList(cartGoodsList);
             userCouponDto00.setBizType(Dict.orderBizType.item_00.getItem());
+            if(campId00 != null && campId00 != 0){
+                userCouponDto00.setCampId(campId00);
+            }
+            if(tickDiscId00 != null && tickDiscId00 != 0){
+                userCouponDto00.setTickDiscId(Integer.parseInt(String.valueOf(tickDiscId00)));
+            }
             couponList00 = apiUserCouponService.matchUserCouponList(userCouponDto00);
             campList00 = apiMkStoreCampMinusService.matchUserCampMinusList(userCouponDto00);
         }
@@ -477,6 +510,12 @@ public class ApiCartService {
             userCouponDto02.setGoodsTotalPrice(goodsTotalPrice02);
             userCouponDto02.setCartGoodsList(cartGoodsList);
             userCouponDto02.setBizType(Dict.orderBizType.item_02.getItem());
+            if(campId02 != null && campId02 != 0){
+                userCouponDto02.setCampId(campId02);
+            }
+            if(tickDiscId02 != null && tickDiscId02 != 0){
+                userCouponDto02.setTickDiscId(Integer.parseInt(String.valueOf(tickDiscId02)));
+            }
             couponList02 = apiUserCouponService.matchUserCouponList(userCouponDto02);
             campList02 = apiMkStoreCampMinusService.matchUserCampMinusList(userCouponDto02);
         }
@@ -487,6 +526,12 @@ public class ApiCartService {
             userCouponDto10.setGoodsTotalPrice(goodsTotalPrice10);
             userCouponDto10.setCartGoodsList(cartGoodsList);
             userCouponDto10.setBizType(Dict.orderBizType.item_10.getItem());
+            if(campId10 != null && campId10 != 0){
+                userCouponDto10.setCampId(campId10);
+            }
+            if(tickDiscId10 != null && tickDiscId10 != 0){
+                userCouponDto10.setTickDiscId(Integer.parseInt(String.valueOf(tickDiscId10)));
+            }
             couponList10 = apiUserCouponService.matchUserCouponList(userCouponDto10);
             campList10 = apiMkStoreCampMinusService.matchUserCampMinusList(userCouponDto10);
         }
@@ -497,6 +542,12 @@ public class ApiCartService {
             userCouponDto11.setGoodsTotalPrice(goodsTotalPrice11);
             userCouponDto11.setCartGoodsList(cartGoodsList);
             userCouponDto11.setBizType(Dict.orderBizType.item_11.getItem());
+            if(campId11 != null && campId11 != 0){
+                userCouponDto11.setCampId(campId11);
+            }
+            if(tickDiscId11 != null && tickDiscId11 != 0){
+                userCouponDto11.setTickDiscId(Integer.parseInt(String.valueOf(tickDiscId11)));
+            }
             couponList11 = apiUserCouponService.matchUserCouponList(userCouponDto11);
             campList11 = apiMkStoreCampMinusService.matchUserCampMinusList(userCouponDto11);
         }
@@ -516,15 +567,15 @@ public class ApiCartService {
         BigDecimal actualPrice10 = goodsTotalPrice10;
         BigDecimal actualPrice11 = goodsTotalPrice11;
 
-        Map campMinusMap00 = checkedCampMinus(campList00, campMinusDto00, actualPrice00, campId00, isLoadStatus);
-        Map campMinusMap02 = checkedCampMinus(campList02, campMinusDto02, actualPrice02, campId02, isLoadStatus);
-        Map campMinusMap10 = checkedCampMinus(campList10, campMinusDto10, actualPrice10, campId10, isLoadStatus);
-        Map campMinusMap11 = checkedCampMinus(campList11, campMinusDto11, actualPrice11, campId11, isLoadStatus);
+        Map campMinusMap00 = checkedCampMinus(campList00, checkedGoodsList, actualPrice00, campId00, isLoadStatus);
+        Map campMinusMap02 = checkedCampMinus(campList02, checkedGoodsList, actualPrice02, campId02, isLoadStatus);
+        Map campMinusMap10 = checkedCampMinus(campList10, checkedGoodsList, actualPrice10, campId10, isLoadStatus);
+        Map campMinusMap11 = checkedCampMinus(campList11, checkedGoodsList, actualPrice11, campId11, isLoadStatus);
 
-        Map couponMap00 = checkedCoupon(couponList00, checkedCoupon00, tickDiscId00, campMinusMap00, isLoadStatus);
-        Map couponMap02 = checkedCoupon(couponList02, checkedCoupon02, tickDiscId02, campMinusMap02, isLoadStatus);
-        Map couponMap10 = checkedCoupon(couponList10, checkedCoupon10, tickDiscId10, campMinusMap10, isLoadStatus);
-        Map couponMap11 = checkedCoupon(couponList11, checkedCoupon11, tickDiscId11, campMinusMap11, isLoadStatus);
+        Map couponMap00 = checkedCoupon(couponList00, checkedGoodsList, tickDiscId00, campMinusMap00, isLoadStatus);
+        Map couponMap02 = checkedCoupon(couponList02, checkedGoodsList, tickDiscId02, campMinusMap02, isLoadStatus);
+        Map couponMap10 = checkedCoupon(couponList10, checkedGoodsList, tickDiscId10, campMinusMap10, isLoadStatus);
+        Map couponMap11 = checkedCoupon(couponList11, checkedGoodsList, tickDiscId11, campMinusMap11, isLoadStatus);
 
         campMinusDto00 = getCampMinusByMap(campMinusMap00);
         campMinusDto02 = getCampMinusByMap(campMinusMap02);
@@ -549,6 +600,57 @@ public class ApiCartService {
 
         BigDecimal actualPrice = actualPrice00.add(actualPrice02).add(actualPrice10).add(actualPrice11);  //实付金额:商品销售价*数量-优惠金额+运费的总和
 
+        for(CartVo cartVo: checkedGoodsList){
+            List<Integer> goodsList = null;
+            List<Integer> goodsDiscountList = null;
+            if(cartVo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_00.getItem())){
+                if(campMinusDto00 != null) {
+                    goodsList = campMinusDto00.getGoodsIds();
+                }
+                if(checkedCoupon00 != null) {
+                    goodsDiscountList = checkedCoupon00.getGoodsList();
+                }
+            }
+            if(cartVo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem())){
+                if(campMinusDto02 != null) {
+                    goodsList = campMinusDto02.getGoodsIds();
+                }
+                if(checkedCoupon02 != null) {
+                    goodsDiscountList = checkedCoupon02.getGoodsList();
+                }
+            }
+            if(cartVo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())){
+                if(campMinusDto10 != null) {
+                    goodsList = campMinusDto10.getGoodsIds();
+                }
+                if(checkedCoupon10 != null) {
+                    goodsDiscountList = checkedCoupon10.getGoodsList();
+                }
+            }
+            if(cartVo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())){
+                if(campMinusDto11 != null) {
+                    goodsList = campMinusDto11.getGoodsIds();
+                }
+                if(checkedCoupon11 != null) {
+                    goodsDiscountList = checkedCoupon11.getGoodsList();
+                }
+            }
+            if(goodsList != null) {
+                for (Integer goodsId : goodsList) {
+                    if (cartVo.getGoods_id().compareTo(Long.valueOf(goodsId)) == 0) {
+                        cartVo.setIsCamp("true");
+                    }
+                }
+            }
+            if(goodsDiscountList != null) {
+                for (Integer goodsId : goodsDiscountList) {
+                    if (cartVo.getGoods_id().compareTo(Long.valueOf(goodsId)) == 0) {
+                        cartVo.setIsDiscount("true");
+                    }
+                }
+            }
+        }
+
         resultObj.put("freightPrice00", freightPrice00);
         resultObj.put("freightPrice02", freightPrice02);
         resultObj.put("freightPrice10", freightPrice10);
@@ -602,19 +704,20 @@ public class ApiCartService {
     /**
      * 选择满减满折
      * @param campList
-     * @param campMinusDto
+     * @param checkedGoodsList
      * @param actualPrice
      * @param campId
      * @param isLoadStatus 0则为进入页面加载优惠信息,默认选择最高层级促销活动,1为选择促销活动后加载优惠信息,2为选择优惠券时触发,优惠券不能与促销活动同时使用
      */
-    private Map checkedCampMinus(List<CampMinusDto> campList, CampMinusDto campMinusDto, BigDecimal actualPrice, Integer campId, Integer isLoadStatus){
+    private Map checkedCampMinus(List<CampMinusDto> campList, List<CartVo> checkedGoodsList, BigDecimal actualPrice, Integer campId, Integer isLoadStatus){
         Map campMap = new HashMap();
+        CampMinusDto campMinusDto = null;
         if(campList != null && campList.size() > 0 && isLoadStatus != null){
             if(isLoadStatus == 0){ //0则为进入页面加载优惠信息,默认选择最高层级促销活动
                 campMinusDto = campList.get(0);
                 if(campMinusDto.getCampMinusId().compareTo(0) > 0){
                     //商品销售价*数量-优惠金额
-                    actualPrice = mathActualPriceByCamp(campMinusDto, actualPrice);
+                    actualPrice = mathActualPriceByCamp(campMinusDto, actualPrice, checkedGoodsList);
                     campMap.put("actualPrice", actualPrice);
                     campMap.put("isCamp", true);//满减活动是否满足该次订单
                 }else{
@@ -633,7 +736,7 @@ public class ApiCartService {
                             if (campId.compareTo(dto.getCampMinusId()) == 0) {
                                 campMinusDto = dto;
                                 //商品销售价*数量-优惠金额
-                                actualPrice = mathActualPriceByCamp(campMinusDto, actualPrice);
+                                actualPrice = mathActualPriceByCamp(campMinusDto, actualPrice, checkedGoodsList);
                                 campMap.put("actualPrice", actualPrice);
                                 campMap.put("isCamp", true);
                                 campMap.put("campMinusDto", campMinusDto);
@@ -658,15 +761,16 @@ public class ApiCartService {
     /**
      * 选择优惠券
      * @param couponList
-     * @param checkedCoupon
+     * @param checkedGoodsList
      * @param tickDiscId
      * @param campMinusMap
      * @param isLoadStatus 0则为进入页面加载优惠信息,默认选择最高层级促销活动,1为选择促销活动后加载优惠信息,2为选择优惠券时触发,优惠券不能与促销活动同时使用
      */
-    private Map checkedCoupon(List<UserCouponVo> couponList, UserCouponVo checkedCoupon, Long tickDiscId, Map campMinusMap, Integer isLoadStatus){
+    private Map checkedCoupon(List<UserCouponVo> couponList, List<CartVo> checkedGoodsList, Long tickDiscId, Map campMinusMap, Integer isLoadStatus){
         BigDecimal actualPrice = MapUtils.getBigDecimal("actualPrice", campMinusMap);
         Boolean isCamp = (Boolean)campMinusMap.get("isCamp");
         Map couponMap = new HashMap();
+        UserCouponVo checkedCoupon = null;
         //满减活动不与优惠券同时使用,当isCamp为false时可使用优惠券
         if(isCamp == false) {
             if (null != couponList && couponList.size() > 0) {
@@ -685,7 +789,7 @@ public class ApiCartService {
                             if (null != tickDiscId && tickDiscId.equals(userCouponVo.getId())) {
                                 checkedCoupon = userCouponVo;
                                 //商品销售价*数量-优惠金额
-                                actualPrice = mathActualPrice(checkedCoupon, actualPrice);
+                                actualPrice = mathActualPrice(checkedCoupon, actualPrice, checkedGoodsList);
                                 couponMap.put("actualPrice", actualPrice);
                                 couponMap.put("checkedCoupon", checkedCoupon);
                             }

+ 64 - 7
kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java

@@ -417,7 +417,7 @@ public class ApiOrderService {
                             logger.error("订单提交失败:商品不存在");
                             throw new RRException("订单提交失败:商品不存在");
                         }
-                        OrderGoodsVo orderGoodsVo = setOrderGoodsVo(orderInfo, goodsItem, goodsVo);
+                        OrderGoodsVo orderGoodsVo = setOrderGoodsVo(orderInfo, cartResultObj, goodsItem, goodsVo);
                         apiOrderGoodsMapper.save(orderGoodsVo);
                         //购物车id为空,则提交订单是从商品详情页立即购买过来的
                         if(goodsItem.getId() == null){
@@ -436,12 +436,15 @@ public class ApiOrderService {
                         }
                     }
                 }
-                //记录优惠券活动营销统计下单量数据
-                apiMkStoreTopicStatService.saveTicketTopicStatBySubmitData(orderInfo.getCoupon_id());
-
-                //记录促销满减活动营销统计下单量数据
-                apiMkStoreTopicStatService.saveCampTopicStatBySubmitData(orderInfo.getActivity_id(), orderInfo.getCampMinusId());
+                if(orderInfo.getCoupon_id() != 0 && orderInfo.getCoupon_id()!= null) {
+                    //记录优惠券活动营销统计下单量数据
+                    apiMkStoreTopicStatService.saveTicketTopicStatBySubmitData(orderInfo.getCoupon_id());
+                }
 
+                if(orderInfo.getCampMinusId() != 0 && orderInfo.getCampMinusId()!= null) {
+                    //记录促销满减活动营销统计下单量数据
+                    apiMkStoreTopicStatService.saveCampTopicStatBySubmitData(orderInfo.getActivity_id(), orderInfo.getCampMinusId());
+                }
                 OrderProcessRecordEntity entity = new OrderProcessRecordEntity();
                 entity.setOrderSn(orderInfo.getOrder_sn());
                 entity.setUserId(Integer.valueOf(loginUser.getId()+""));
@@ -900,7 +903,7 @@ public class ApiOrderService {
         return orderInfo;
     }
 
-    public OrderGoodsVo setOrderGoodsVo(OrderVo orderInfo,CartVo goodsItem,GoodsVo goodsVo){
+    public OrderGoodsVo setOrderGoodsVo(OrderVo orderInfo,Map<String, Object> cartResultObj,CartVo goodsItem,GoodsVo goodsVo){
         OrderGoodsVo orderGoodsVo = new OrderGoodsVo();
         orderGoodsVo.setOrder_id(orderInfo.getId());
         orderGoodsVo.setGoods_id(goodsItem.getGoods_id());
@@ -916,7 +919,61 @@ public class ApiOrderService {
         orderGoodsVo.setOrderBizType(goodsItem.getGoodsBizType());
         orderGoodsVo.setCreateTime(new Date());
         orderGoodsVo.setModTime(new Date());
+        CampMinusDto campMinusDto = new CampMinusDto();
+        UserCouponVo userCouponVo = new UserCouponVo();
+        CampMinusDto campMinusDto00 = (CampMinusDto)cartResultObj.get("campMinusDto00");
+        CampMinusDto campMinusDto02 = (CampMinusDto)cartResultObj.get("campMinusDto02");
+        CampMinusDto campMinusDto10 = (CampMinusDto)cartResultObj.get("campMinusDto10");
+        CampMinusDto campMinusDto11 = (CampMinusDto)cartResultObj.get("campMinusDto11");
+        UserCouponVo checkedCoupon00 = (UserCouponVo)cartResultObj.get("checkedCoupon00");
+        UserCouponVo checkedCoupon02 = (UserCouponVo)cartResultObj.get("checkedCoupon02");
+        UserCouponVo checkedCoupon10 = (UserCouponVo)cartResultObj.get("checkedCoupon10");
+        UserCouponVo checkedCoupon11 = (UserCouponVo)cartResultObj.get("checkedCoupon11");
+        if(goodsVo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_00.getItem())){
+            if(campMinusDto00 != null){
+                campMinusDto = campMinusDto00;
+                userCouponVo = checkedCoupon00;
+            }
+        }
+        if(goodsVo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem())){
+            if(campMinusDto02 != null){
+                campMinusDto = campMinusDto02;
+                userCouponVo = checkedCoupon02;
+            }
+        }
+        if(goodsVo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())){
+            if(campMinusDto10 != null){
+                campMinusDto = campMinusDto10;
+                userCouponVo = checkedCoupon10;
+            }
+        }
+        if(goodsVo.getGoodsBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())){
+            if(campMinusDto11 != null){
+                campMinusDto = campMinusDto11;
+                userCouponVo = checkedCoupon11;
+            }
+        }
 
+        if(campMinusDto != null){
+            List<Integer> goodsList = campMinusDto.getGoodsIds();
+            if(goodsList != null) {
+                for (Integer goodsId : goodsList) {
+                    if (goodsId == Integer.parseInt(String.valueOf(goodsVo.getId()))) {
+                        orderGoodsVo.setStoreTopicId(Integer.parseInt(String.valueOf(orderInfo.getActivity_id())));
+                    }
+                }
+            }
+        }
+        if(userCouponVo != null){
+            List<Integer> goodsList = userCouponVo.getGoodsList();
+            if(goodsList != null) {
+                for (Integer goodsId : goodsList) {
+                    if (goodsId == Integer.parseInt(String.valueOf(goodsVo.getId()))) {
+                        orderGoodsVo.setStoreTopicId(Integer.parseInt(String.valueOf(orderInfo.getActivity_id())));
+                    }
+                }
+            }
+        }
         orderGoodsVo.setGoodsRate(goodsVo.getGoodsRate());
 
         BigDecimal number = new BigDecimal(Long.valueOf(goodsItem.getNumber()));

+ 1 - 0
kmall-api/src/main/java/com/kmall/api/service/ApiUserCouponService.java

@@ -209,6 +209,7 @@ public class ApiUserCouponService {
         userCouponVo.setId(Long.valueOf(discountVo.getTickDiscId()));
         userCouponVo.setSelectTicket(false);
         userCouponVo.setGoodsBizType(discountVo.getGoodsBizType());
+        userCouponVo.setGoodsList(discountVo.getGoodsList());
         return userCouponVo;
     }
 

+ 37 - 26
kmall-api/src/main/java/com/kmall/api/service/mk/ApiMkStoreCampMinusService.java

@@ -77,11 +77,11 @@ public class ApiMkStoreCampMinusService {
     /**
      * 查询详情页商品所支持的优惠券
      * @param storeId
-     * @param userId
+     * @param campId
      * @param goodsId
      * @return
      */
-    public List<MkStoreCampMinusVo> queryStoreCampMinusByGoodsId(Integer storeId, long userId, Integer goodsId){
+    public List<MkStoreCampMinusVo> queryStoreCampMinusByGoodsId(Integer storeId, Integer campId, Integer goodsId){
         GoodsVo goodsVo = apiGoodsMapper.queryObjectByStoreId(Long.valueOf(goodsId),Long.valueOf(storeId));
         if(goodsVo == null){
             logger.error("商品信息不能为空");
@@ -92,17 +92,38 @@ public class ApiMkStoreCampMinusService {
         discountMap.put("storeId", storeId);
         discountMap.put("goodsBizType", goodsVo.getGoodsBizType());
         discountMap.put("isPast", "0");//进行中
+        if(campId != null){
+            discountMap.put("campId", campId);
+        }
         //详情页根据门店id、用户id、业务类型获取当前门店所有的未过期的满减满折信息
         List<MkStoreCampMinusVo> mkStoreTicketDiscountList = mkStoreCampMinusMapper.getCampMinusByStoreIdList(discountMap);
         List<MkStoreCampMinusVo> campMinusVos = new ArrayList<>();
+        StringBuffer goodsIdStr = new StringBuffer();
         for (MkStoreCampMinusVo campMinusVo : mkStoreTicketDiscountList) {
             //查询商品是否满足该满减满折
             Integer total = queryCampMinusGoodsTotal(storeId, goodsId, campMinusVo);
             campMinusVo.setGoodsId(goodsId);
             if(total > 0){
+                goodsIdStr.append(goodsId+",");
                 campMinusVos.add(campMinusVo);
             }
         }
+        if(goodsIdStr != null && !goodsIdStr.toString().equalsIgnoreCase("")) {
+            String[] gid = goodsIdStr.toString().split(",");
+            Integer[] goodsIds =  new Integer[gid.length];
+            for(int i=0;i < gid.length;i++){
+                goodsIds[i] = Integer.parseInt(gid[i]);
+            }
+            List goodsList = new ArrayList();
+            for (Integer goods : goodsIds) {
+                if (!goodsList.contains(goods)) {
+                    goodsList.add(goods);
+                }
+            }
+            for (MkStoreCampMinusVo vo : campMinusVos) {
+                vo.setGoodsIds(goodsList);
+            }
+        }
         return campMinusVos;
     }
     /**
@@ -370,10 +391,13 @@ public class ApiMkStoreCampMinusService {
      */
     private Integer getPieceByGoodsId(List<CartVo> cartGoodsList, MkStoreCampMinusVo minusVo){
         Integer total = 0;
+        List<Integer> goodsList = minusVo.getGoodsIds();
         for (CartVo vo: cartGoodsList) {
-            if(minusVo.getGoodsId().compareTo(vo.getGoods_id().intValue()) == 0
-                    && minusVo.getStoreId().compareTo(vo.getStore_id().intValue()) == 0 && minusVo.getGoodsBizType().equalsIgnoreCase(vo.getGoodsBizType())){
-                total = total + vo.getNumber();
+            for(Integer goodsId:goodsList){
+                if (goodsId.compareTo(vo.getGoods_id().intValue()) == 0
+                        && minusVo.getStoreId().compareTo(vo.getStore_id().intValue()) == 0 && minusVo.getGoodsBizType().equalsIgnoreCase(vo.getGoodsBizType())) {
+                    total = total + vo.getNumber();
+                }
             }
         }
         return total;
@@ -387,11 +411,10 @@ public class ApiMkStoreCampMinusService {
      */
     private BigDecimal getTotalByGoodsId(List<CartVo> cartGoodsList, MkStoreCampMinusVo minusVo){
         BigDecimal total = new BigDecimal(0);
-        Integer goodsId[] = minusVo.getGoodsIds();
-        for(int i = 0; i<goodsId.length;i++) {
+        List<Integer> goodsId = minusVo.getGoodsIds();
+        for(int i = 0; i<goodsId.size();i++) {
             for (CartVo vo:cartGoodsList) {
-//            CartVo vo = cartGoodsList.get(i);
-                if (goodsId[i].compareTo(vo.getGoods_id().intValue()) == 0 && minusVo.getStoreId().compareTo(vo.getStore_id().intValue()) == 0 && minusVo.getGoodsBizType().equalsIgnoreCase(vo.getGoodsBizType())) {
+                if (goodsId.get(i).compareTo(vo.getGoods_id().intValue()) == 0 && minusVo.getStoreId().compareTo(vo.getStore_id().intValue()) == 0 && minusVo.getGoodsBizType().equalsIgnoreCase(vo.getGoodsBizType())) {
                     total = total.add(vo.getRetail_price().multiply(BigDecimal.valueOf(vo.getNumber())));
                 }
             }
@@ -420,6 +443,7 @@ public class ApiMkStoreCampMinusService {
         campMinusDto.setMoney(money);
         campMinusDto.setCampMinusId(minusVo.getCampMinusId());
         campMinusDto.setGoodsBizType(minusVo.getGoodsBizType());
+        campMinusDto.setGoodsIds(minusVo.getGoodsIds());
         return campMinusDto;
     }
     /**
@@ -432,27 +456,14 @@ public class ApiMkStoreCampMinusService {
         long userId= userCouponDto.getUserId();
         List<CartVo> cartList = userCouponDto.getCartGoodsList();
         String bizType = userCouponDto.getBizType();
+        Integer campId = userCouponDto.getCampId();
         List<MkStoreCampMinusVo> mkStoreCampMinusList = new ArrayList<>();
-        Integer count = 0;
-        List<CartVo> cartBizList = new ArrayList<>();
-        for(CartVo cartVo: cartList){
+        for(int i=0;i<cartList.size();i++){
+            CartVo cartVo = cartList.get(i);
             if(bizType.equalsIgnoreCase(cartVo.getGoodsBizType())) {
-                count++;
-                cartBizList.add(cartVo);
+                mkStoreCampMinusList.addAll(queryStoreCampMinusByGoodsId(storeId, campId, Integer.parseInt(String.valueOf(cartVo.getGoods_id()))));
             }
         }
-        Integer[] goodsIds = new Integer[count];
-        for(int i=0;i<cartBizList.size();i++){
-            CartVo cartVo = cartBizList.get(i);
-            if(bizType.equalsIgnoreCase(cartVo.getGoodsBizType())) {
-                Integer goodsId = Integer.parseInt(String.valueOf(cartVo.getGoods_id()));
-                mkStoreCampMinusList.addAll(queryStoreCampMinusByGoodsId(storeId, userId, goodsId));
-                goodsIds[i] = goodsId;
-            }
-        }
-        for(MkStoreCampMinusVo vo : mkStoreCampMinusList){
-            vo.setGoodsIds(goodsIds);
-        }
         Map map = new HashMap();
         map.put("mkStoreCampMinusList", mkStoreCampMinusList);
         return map;

+ 21 - 0
kmall-api/src/main/java/com/kmall/api/service/mk/ApiMkStoreTicketDiscountService.java

@@ -129,6 +129,7 @@ public class ApiMkStoreTicketDiscountService {
         List<CartVo> cartList = userCouponDto.getCartGoodsList();
         String bizType = userCouponDto.getBizType();
         List<MkStoreTicketDiscountVo> discountVoList = new ArrayList<>();
+        StringBuffer goodsIdStr = new StringBuffer();
         for(CartVo cartVo: cartList){
             if(bizType.equalsIgnoreCase(cartVo.getGoodsBizType())) {
                 Integer goodsId = Integer.parseInt(String.valueOf(cartVo.getGoods_id()));
@@ -143,6 +144,9 @@ public class ApiMkStoreTicketDiscountService {
                 discountMap.put("userId", userId);
                 discountMap.put("goodsBizType", goodsVo.getGoodsBizType());
                 discountMap.put("isPast", "0");//未过期
+                if(userCouponDto.getTickDiscId() != null){
+                    discountMap.put("tickDiscId", userCouponDto.getTickDiscId());
+                }
                 List<MkStoreTicketDiscountVo> mkStoreTicketDiscountList = new ArrayList<>();
                 if (StringUtils.isNotEmpty(isUsed)) {
                     discountMap.put("isUsed", isUsed);
@@ -156,11 +160,28 @@ public class ApiMkStoreTicketDiscountService {
                     Integer total = queryDiscountGoodsTotal(storeId, goodsId, discountEntity);
                     discountEntity.setGoodsId(goodsId);
                     if (total > 0) {
+                        goodsIdStr.append(goodsId+",");
                         discountVoList.add(discountEntity);
                     }
                 }
             }
         }
+        if(goodsIdStr != null && !goodsIdStr.toString().equalsIgnoreCase("")) {
+            String[] gid = goodsIdStr.toString().split(",");
+            Integer[] goodsIds =  new Integer[gid.length];
+            for(int i=0;i < gid.length;i++){
+                goodsIds[i] = Integer.parseInt(gid[i]);
+            }
+            List goodsList = new ArrayList();
+            for (Integer goods : goodsIds) {
+                if (!goodsList.contains(goods)) {
+                    goodsList.add(goods);
+                }
+            }
+            for (MkStoreTicketDiscountVo vo : discountVoList) {
+                vo.setGoodsList(goodsList);
+            }
+        }
         Map map = new HashMap();
         map.put("discountVoList", discountVoList);
         return map;

+ 8 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiCartMapper.xml

@@ -51,6 +51,8 @@
 
     <select id="queryList" resultMap="cartMap">
         SELECT
+        m.camp_name 'campName',
+        ( SELECT camp_name FROM mk_store_camp_minus WHERE camp_minus_id IN ( SELECT camp_minus_id FROM mk_store_camp_minus_goods WHERE apply_type = 02 AND store_rela_id != psr.id ) ) 'campNameByNotGoods',
         mb.third_party_merch_code,
         mb.is_stock_share isStockShare,
         mb.is_supplier_goods 'isSupplierGoods',
@@ -74,6 +76,9 @@
         LEFT JOIN mall_store s ON s.id = psr.store_id
         LEFT JOIN third_merchant_biz mb ON s.third_party_merch_code = mb.third_party_merch_code
         LEFT JOIN third_merchant_biz mb2 ON b.third_party_merch_code = mb2.third_party_merch_code
+        LEFT JOIN mk_store_camp_minus_goods g ON g.store_rela_id = psr.id
+        AND apply_type != '02'
+        LEFT JOIN mk_store_camp_minus m ON m.camp_minus_id = g.camp_minus_id
         where 1 = 1  and b.is_delete = 0 and b.is_on_sale = 1 and psr.stock_num > 0
         <!--<if test="checkCart == null">
             <if test="isStockShare == 1 and goodsBizType == 00">
@@ -209,6 +214,9 @@
         LEFT JOIN mall_store s ON s.id = psr.store_id
         LEFT JOIN third_merchant_biz mb ON s.third_party_merch_code = mb.third_party_merch_code
         LEFT JOIN third_merchant_biz mb2 ON b.third_party_merch_code = mb2.third_party_merch_code
+        LEFT JOIN mk_store_camp_minus_goods g ON g.store_rela_id = psr.id
+        AND apply_type != '02'
+        LEFT JOIN mk_store_camp_minus m ON m.camp_minus_id = g.camp_minus_id
         where 1 = 1  and b.is_delete = 0 and b.is_on_sale = 1
         <if test="checkCart == null">
             <if test="isStockShare == 1 and goodsBizType == 00">

+ 9 - 3
kmall-api/src/main/resources/mybatis/mapper/ApiOrderGoodsMapper.xml

@@ -28,14 +28,17 @@
         <result property="goodsRate" column="goods_rate"/>
         <result property="settlePrice" column="settle_price"/>
         <result property="merchSn" column="merch_sn"/>
+        <result property="storeTopicId" column="store_topic_id"/>
     </resultMap>
 
     <select id="queryObject" resultMap="orderGoodsMap">
-		select * from mall_order_goods where id = #{value}
+		select g.* from mall_order_goods gwhere g.id = #{value}
 	</select>
 
     <select id="queryList" resultMap="orderGoodsMap">
-        select g.*,o.merch_sn from mall_order_goods g left join mall_order o on o.id = g.order_id
+        select g.*,o.merch_sn,m.store_topic_id 'campTopicId',t.store_topic_id 'distcountTopicId' from mall_order_goods g left join mall_order o on o.id = g.order_id
+        left join mk_store_camp_minus m on g.store_topic_id = m.store_topic_id
+        left join mk_store_ticket_discount t on g.store_topic_id = t.store_topic_id
         <where>
             <if test="order_id != null and order_id != ''">
                 and order_id = #{order_id}
@@ -74,6 +77,7 @@
 			`goods_specification_ids`,
 			`list_pic_url`,
             is_dist_sell_scan,
+            store_topic_id,
             <if test="goodsRate != null" >
                 goods_rate,
             </if>
@@ -102,7 +106,7 @@
 		)
 		values
 		(
-		#{order_id},
+		    #{order_id},
 			#{goods_id},
 			#{goods_name},
 			#{goods_sn},
@@ -115,6 +119,7 @@
 			#{goods_specification_ids},
 			#{list_pic_url},
             0,
+            #{storeTopicId},
         <if test="goodsRate != null" >
             #{goodsRate},
         </if>
@@ -163,6 +168,7 @@
 
             <if test="goodsRate != null">`goods_rate` = #{goodsRate},</if>
             <if test="settlePrice != null">`settle_price` = #{settlePrice},</if>
+            <if test="storeTopicId != null">`store_topic_id` = #{storeTopicId},</if>
 
             <if test="sku != null" >
                 sku = #{sku,jdbcType=VARCHAR},

+ 3 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiOrderMapper.xml

@@ -82,9 +82,11 @@
     </resultMap>
 
     <select id="queryObject" resultMap="orderMap">
-		select a.*,b.latitude,b.longitude
+		select a.*,b.latitude,b.longitude,m.apply_type 'applyType',t.apply_type 'discountApplyType'
 		from mall_order a
 		left join mall_address b on a.address_id = b.id
+		left join mk_store_camp_minus m on a.activity_id = m.store_topic_id
+		left join mk_store_ticket_discount t on a.activity_id = t.store_topic_id
 		where a.id = #{value}
 	</select>
 

+ 9 - 3
kmall-api/src/main/resources/mybatis/mapper/mk/ApiMkStoreCampMinusMapper.xml

@@ -81,9 +81,12 @@
 		`tstm`,
 		`goods_biz_type`
 		from mk_store_camp_minus
-		WHERE 1=1
-		<if test="name != null and name.trim() != ''">
-			AND name LIKE concat('%',#{name},'%')
+		WHERE 1=1 and is_past = 0 AND is_valid = 0
+		<if test="storeId != null and storeId != ''">
+			AND store_id = #{storeId}
+		</if>
+		<if test="applyType != null and applyType != ''">
+			AND apply_type = #{applyType}
 		</if>
 		<choose>
 			<when test="sidx != null and sidx.trim() != ''">
@@ -135,6 +138,9 @@
 		<if test="storeId != '' and storeId != null">
 			AND m.store_id = #{storeId}
 		</if>
+		<if test="campId != '' and campId != null">
+			AND m.camp_minus_id = #{campId}
+		</if>
 		<if test="goodsBizType != '' and goodsBizType != null">
 			AND m.goods_biz_type = #{goodsBizType}
 		</if>

+ 2 - 1
wx-mall/app.json

@@ -54,7 +54,8 @@
     "pages/ucenter/ticketDiscountGoods/ticketDiscountGoods",
     "pages/ucenter/couponDetail/couponDetail",
     "pages/ucenter/couponTickInfo/couponTickInfo",
-    "pages/ucenter/campMinus/campMinus"
+    "pages/ucenter/campMinus/campMinus",
+    "pages/categoryBrand/categoryBrand"
     
   ],
   "window": {

+ 5 - 5
wx-mall/app.wxss

@@ -77,10 +77,10 @@ view, text {
 }
 
 .list-cell {
-  padding: 10px 15px;
+  padding: 7px 15px;
   position: relative;
   display: flex;
-  align-items: center;
+  /* align-items: center; */
 }
 
 .list-cell:first-of-type::before {
@@ -202,13 +202,13 @@ view, text {
 
 .cart-panel {
   display: flex;
-  height: 80rpx;
+  height: 70rpx;
   width: 700rpx;
-  line-height: 80rpx;
+  line-height: 70rpx;
   border-radius: 40rpx;
   background-color: #4d4d4e;
   position: fixed;
-  bottom: 8rpx;
+  bottom: 1rpx;
   z-index: 499;
   left: 50%;
   margin-left: -350rpx;

+ 13 - 13
wx-mall/pages/cart/cart.wxml

@@ -46,7 +46,7 @@
       <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">
-            <image src="../../../static/images/service-bao.png" class="search-icon-shop"></image>
+            <image src="../../static/images/service-bao.png" class="search-icon-shop"></image>
             <text class="title-name ">保税仓</text>
           </view>
           <view class="item" wx:for="{{cartGoods00}}" wx:if="{{item.goodsBizType == 00}}" wx:key="{{item.id}}">
@@ -56,17 +56,17 @@
                 <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}}&&storeId={{item.store_id}}">
+                <navigator url="/pages/goods/goods?id={{item.goods_id}}&&storeId={{item.store_id}}">
+                  <view class="t">
                     <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 class="goods-do">
+                      <text class="price">¥{{item.retail_price}}</text>
+                      <text class="org-price line-through">¥{{item.market_price}}</text>
+                    </view>
                   </view>
-                </view>
-                <view class="attr">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}
-                </view>
+                  <view class="attr">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}
+                  </view>
+                </navigator>
                 <!-- //数量加减 -->
                 <view class="number-item">
                   <view class="selnum">
@@ -87,7 +87,7 @@
           </view>
 
           <view wx:if="{{cartGoods02.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus02 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="02">
-            <image src="../../../static/images/service-zs.png" class="search-icon-shop"></image>
+            <image src="../../static/images/service-zs.png" class="search-icon-shop"></image>
             <text class="title-name">保税展示</text>
           </view>
 
@@ -129,7 +129,7 @@
 
 
           <view wx:if="{{cartGoods10.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus10 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="10">
-            <image src="../../../static/images/service-ziti.png" class="search-icon-shop"></image>
+            <image src="../../static/images/service-ziti.png" class="search-icon-shop"></image>
             <text class="title-name">现场速递</text>
           </view>
 
@@ -171,7 +171,7 @@
 
 
           <view wx:if="{{cartGoods11.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus11 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="11">
-            <image src="../../../static/images/service-ptsp.png" class="search-icon-shop"></image>
+            <image src="../../static/images/service-ptsp.png" class="search-icon-shop"></image>
             <text class="title-name">普通商品</text>
           </view>
 

+ 8 - 4
wx-mall/pages/catalog/catalog.js

@@ -89,11 +89,15 @@ Page({
         } else {
           that.setData({
             navList: res.data.categoryList,
-            currentCategory: res.data.currentCategory,
-            brandList: res.data.brandList
+            currentCategory: res.data.currentCategory
           });
+          if (res.data.brandList) {
+            that.setData({
+              brandList: res.data.brandList
+            });
+          }
           console.log(res.data.currentCategory);
-          console.log(res.data.currentCategory.id);
+          // console.log(res.data.currentCategory.id);
         }
       }
       if (that.data.goodsList.length == 0 || wx.getStorageSync('storeId') != wx.getStorageSync('mapCatalogStoreId')
@@ -230,7 +234,7 @@ Page({
     //   title: '加载中...',
     // });
     var that = this;
-    if (that.data.currentCategory.id > 0){
+    if (that.data.currentCategory != null && that.data.currentCategory.id > 0){
       util.request(api.CatalogProductList, {
         page: that.data.page,
         size: that.data.size,

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

@@ -80,10 +80,10 @@
       </view> -->
     </scroll-view>
     <scroll-view class="cate" scroll-y="true" bindscrolltolower='onLoaderMoreMovies'>
-      <navigator url="url" class="banner">
-        <image class="image" wx:if="{{currentCategory.wap_banner_url}}" src="{{currentCategory.wap_banner_url}}"></image>
+      <view class="banner">
+        <image lazy-load="true" class="image" wx:if="{{currentCategory.wap_banner_url}}" src="{{currentCategory.wap_banner_url}}?x-oss-process=image/resize,h_500"></image>
         <view class="txt">{{currentCategory.front_name?currentCategory.front_name:""}}</view>
-      </navigator>
+      </view>
       <view class="hd" wx:if="{{currentCategory}}">
         <text class="line"></text>
         <text class="txt">{{currentCategory.name?currentCategory.name:""}}分类</text>
@@ -91,7 +91,7 @@
       </view>
       <view class="bd">
         <navigator bindtap="sercherCategory" data-reply-Type="{{item.id}}" data-current-Index="{{index}}" 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>
+          <image lazy-load="true" class="icon" wx:if="{{item.wap_banner_url}}" src="{{item.wap_banner_url}}"></image>
           <text class="txt">{{item.name?item.name:""}}</text>
         </navigator>
       </view>
@@ -103,7 +103,7 @@
       </view>
       <view class="bd">
         <navigator bindtap="sercherCategoryByBrand" data-reply-Type="{{item.id}}" data-current-Index="{{index}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:for="{{brandList}}" wx:key="{{item.id}}">
-          <image class="icon" wx:if="{{item.app_list_pic_url}}" src="{{item.app_list_pic_url}}"></image>
+          <image lazy-load="true" class="icon" wx:if="{{item.app_list_pic_url}}" src="{{item.app_list_pic_url}}"></image>
           <text class="txt">{{item.name?item.name:""}}</text>
         </navigator>
       </view>
@@ -127,7 +127,7 @@
         <view class="item" wx:for="{{goodsList}}" wx:for-index="index" wx:for-item="item" wx:key="{{item.id}}">
           <navigator url="/pages/goods/goods?id={{item.id}}&&storeId={{item.storeId}}">
             <view class="left">
-              <image class="img" wx:if="{{item.list_pic_url}}" src="{{item.list_pic_url}}"></image>
+              <image lazy-load="true" class="img" wx:if="{{item.list_pic_url}}" src="{{item.list_pic_url}}"></image>
             </view>
           </navigator>
           <!-- 文字开始 -->

+ 11 - 8
wx-mall/pages/catalog/catalog.wxss

@@ -71,6 +71,7 @@ page {
   color: #ab2b2b;
   font-size: 30rpx;
   border-left: 6rpx solid #ab2b2b;
+  font-weight: bold;
 }
 
 .catalog .cate {
@@ -109,7 +110,8 @@ page {
 }
 
 .catalog .hd {
-  height: 108rpx;
+  height: 68rpx;
+  /* line-height: 58rpx; */
   width: 100%;
   display: flex;
   justify-content: center;
@@ -142,7 +144,7 @@ page {
   float: left;
   /* height: 246rpx; */
   /* width: 170rpx; */
-  margin-right: 54rpx;
+  /* margin-right: 4rpx; */
 }
 
 .catalog .bd .item.last {
@@ -151,7 +153,7 @@ page {
 
 .catalog .bd .item .icon {
   height: 90rpx;
-  width: 100rpx;
+  width: 90rpx;
 }
 
 .catalog .bd .item .txt {
@@ -159,7 +161,7 @@ page {
   text-align: center;
   font-size: 22rpx;
   color: #333;
-  height: 72rpx;
+  height: 40rpx;
   width: 144rpx;
 }
 
@@ -393,21 +395,21 @@ page {
   position: relative;
   background: #fff;
   width: 100%;
-  height: 78rpx;
+  height: 38rpx;
 }
 
 .activity-box {
   background: #fff;
   width: 100%;
-  height: 78rpx;
+  height: 48rpx;
   overflow: hidden;
   padding: 0 30rpx;
   display: flex;
 }
 
 .activity-box .item {
-  height: 78rpx;
-  line-height: 78rpx;
+  height: 48rpx;
+  line-height: 48rpx;
   text-align: center;
   flex: 1;
   color: #333;
@@ -423,6 +425,7 @@ page {
 
 .activity-box .item.active .txt {
   color: #b4282d;
+  font-weight: bold;
 }
 
 .attr-close{

+ 219 - 102
wx-mall/pages/goods/goods.js

@@ -24,6 +24,7 @@ Page({
     number: 1,
     checkedSpecText: '请选择规格数量',
     openAttr: false,
+    openAttrByOrder: false,
     noCollectImage: "/static/images/icon_collect.png",
     hasCollectImage: "/static/images/icon_collect_checked.png",
     collectBackImage: "/static/images/icon_collect.png",
@@ -32,12 +33,12 @@ Page({
     cartNumber: 0,
     autoplay: false,
     defaultFreight: 0,
-    current: 0,//banner当前的index
+    current: 0, //banner当前的index
     isPlay: true,
     indexNum: 0,
     windowWidth: 0,
     leftWidth: 0,
-    startX:0,
+    startX: 0,
     curr_id: '',
     videoHiddenName: true,
     imgHiddenName: false,
@@ -46,18 +47,18 @@ Page({
     detailContent: '',
     storeId: '',
     detailStoreId: '',
-    promId:'',
+    promId: '',
     merchSn: '',
     openTicketAttr: false,
-    ticketDiscountList:[],
+    ticketDiscountList: [],
     detailTicketDiscountList: [],
-    discountSize: 9999,//查看全部
-    discountDetailSize: 3,//详情查看部分
-    campDetailSize: 1,//详情查看部分
+    discountSize: 9999, //查看全部
+    discountDetailSize: 3, //详情查看部分
+    campDetailSize: 1, //详情查看部分
     detailStoreCampMinusList: [],
-    storeCampMinusList:[]
+    storeCampMinusList: []
   },
-  onLoad: function (options) {
+  onLoad: function(options) {
     // 页面初始化 options为页面跳转所带来的参数
     //由渠道推广生成的小程序码带来的参数,格式:商品id&门店id&推广id&用户id
     // options.scene = "1181115&20&1&26"; 
@@ -84,7 +85,7 @@ Page({
       });
       if (storeId) {
         wx.setStorageSync('storeId', storeId);
-        wx.setStorageSync('isShare', 'true');//商品详情是由用户分享进入的
+        wx.setStorageSync('isShare', 'true'); //商品详情是由用户分享进入的
       }
     } else {
       //由列表页、与普通用户分享点进来带来的参数,商品id,门店id;商品id,门店id,分享用户
@@ -103,26 +104,26 @@ Page({
         });
         wx.setStorageSync('isShare', 'true');
       } else {
-        wx.removeStorageSync('isShare');//由列表页、与普通用户分享点进来则清除是否分享缓存
+        wx.removeStorageSync('isShare'); //由列表页、与普通用户分享点进来则清除是否分享缓存
       }
     }
     var that = this;
     //  高度自适应
     wx.getSystemInfo({
-        success: function (res) {
-            var clientHeight = res.windowHeight,
-                clientWidth = res.windowWidth,
-                rpxR = 750 / clientWidth;
-            var calc = clientHeight * rpxR - 100;
-            // console.log(calc);
-            that.setData({
-              winHeight: calc,
-              windowWidth: res.windowWidth
-            });
-        }
+      success: function(res) {
+        var clientHeight = res.windowHeight,
+          clientWidth = res.windowWidth,
+          rpxR = 750 / clientWidth;
+        var calc = clientHeight * rpxR - 100;
+        // console.log(calc);
+        that.setData({
+          winHeight: calc,
+          windowWidth: res.windowWidth
+        });
+      }
     });
   },
-  onReady: function () {
+  onReady: function() {
     let that = this;
     this.videoContext = wx.createVideoContext('myVideo');
     // 页面渲染完成
@@ -149,25 +150,35 @@ Page({
     });
   },
   //小程序里的转义方法
-  escape2Html: function (str) {
-    var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"' };
-    return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function (all, t) { return arrEntities[t]; });
+  escape2Html: function(str) {
+    var arrEntities = {
+      'lt': '<',
+      'gt': '>',
+      'nbsp': ' ',
+      'amp': '&',
+      'quot': '"'
+    };
+    return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, t) {
+      return arrEntities[t];
+    });
   },
   //调用在需要的地方直接调用即可。如:this.escape2Html(contents)
-  getGoodsInfo: function () {
+  getGoodsInfo: function() {
     wx.showLoading({
       title: '加载中...',
     });
-    setTimeout(function () {
-    }, 350)
+    setTimeout(function() {}, 350)
     let that = this;
     const regex = new RegExp('<img', 'gi');
     console.log('分享的storeId' + wx.getStorageSync('storeId'))
     // console.log('promId' + that.data.promId)
     util.request(api.GoodsDetail, {
-      id: that.data.id, referrer: that.data.referrer,
-      merchSn: wx.getStorageSync('merchSn'), storeId: wx.getStorageSync('storeId'), promId: that.data.promId
-    }).then(function (res) {
+      id: that.data.id,
+      referrer: that.data.referrer,
+      merchSn: wx.getStorageSync('merchSn'),
+      storeId: wx.getStorageSync('storeId'),
+      promId: that.data.promId
+    }).then(function(res) {
       if (res.errno === 0) {
         that.setData({
           goods: res.data.info,
@@ -228,14 +239,14 @@ Page({
         goods_id: that.data.id,
         referrer: that.data.referrer,
         send_type: 2
-      }).then(function (res) {
+      }).then(function(res) {
 
       });
     }
     //商品列表图
     util.request(api.GoodsGallery, {
       goods_id: that.data.id
-    }).then(function (res) {
+    }).then(function(res) {
       if (res.errno === 0) {
         that.setData({
           gallery: res.data
@@ -255,7 +266,7 @@ Page({
   //     }
   //   });
   // },
-  clickSkuValue: function (event) {
+  clickSkuValue: function(event) {
     let that = this;
     let specNameId = event.currentTarget.dataset.nameId;
     let specValueId = event.currentTarget.dataset.valueId;
@@ -285,14 +296,20 @@ Page({
     goodsUtil.changeSpecInfo(that);
   },
   //购物车增加
-  addNumber2: function (e) {
+  addNumber2: function(e) {
     let that = this;
     var goodsId = e.currentTarget.dataset.goodsId;
     var productId = e.currentTarget.dataset.productId;
     var hotGoods = that.data.hotGoods;
-    util.request(api.CartAdd, { goodsId: goodsId, productId: productId, number: 1 }, 'POST').then(function (res) {
+    util.request(api.CartAdd, {
+      goodsId: goodsId,
+      productId: productId,
+      number: 1
+    }, 'POST').then(function(res) {
       if (res.errno === 0 && null != res.data) {
-        util.request(api.CartGoodsCount, { storeId: wx.getStorageSync('storeId') }).then(function (res) {
+        util.request(api.CartGoodsCount, {
+          storeId: wx.getStorageSync('storeId')
+        }).then(function(res) {
           if (res.errno === 0) {
             that.setData({
               cartGoodsCount: res.data.cartTotal.goodsCount
@@ -313,7 +330,7 @@ Page({
       }
     });
   },
-  onShow: function () {
+  onShow: function() {
     let that = this;
     // 页面显示
     if (wx.getStorageSync('userInfo') || wx.getStorageSync('token')) {
@@ -321,14 +338,16 @@ Page({
         util.request(api.ChooseStoreId, {
           storeId: wx.getStorageSync('storeId'),
           merchSn: wx.getStorageSync('merchSn')
-        }, 'POST').then(function (res) {
+        }, 'POST').then(function(res) {
           if (res.errno === 0) {
             wx.setStorageSync('storeId', wx.getStorageSync('storeId'));
             wx.setStorageSync('merchSn', wx.getStorageSync('merchSn'));
             that.reLoad();
 
             that.getGoodsInfo();
-            util.request(api.CartGoodsCount, { storeId: wx.getStorageSync('storeId') }).then(function (res) {
+            util.request(api.CartGoodsCount, {
+              storeId: wx.getStorageSync('storeId')
+            }).then(function(res) {
               if (res.errno === 0) {
                 that.setData({
                   cartGoodsCount: res.data.cartTotal.goodsCount
@@ -344,17 +363,18 @@ Page({
       })
     }
   },
-  onHide: function () {
+  onHide: function() {
     // 页面隐藏
 
   },
-  onUnload: function () {
+  onUnload: function() {
     // 页面关闭
 
   },
-  switchAttrPop: function () {
+  switchAttrPop: function() {
     this.setData({
       openAttr: !this.data.openAttr,
+      openAttrByOrder: false,
       openTicketAttr: false,
       openCampMinusAttr: false
     })
@@ -362,44 +382,58 @@ Page({
   hideSwitchAttrPop: function() {
     this.setData({
       openAttr: false,
+      openAttrByOrder: false,
+      openTicketAttr: false,
+      openCampMinusAttr: false
+    })
+  },
+  switchAttrPopByOrder: function () {
+    this.setData({
+      openAttr: false,
+      openAttrByOrder: !this.data.openAttrByOrder,
       openTicketAttr: false,
       openCampMinusAttr: false
     })
   },
-  reLoad: function () {
+  reLoad: function() {
     let that = this;
     if (wx.getStorageSync('storeId')) {
       if (wx.getStorageSync('userId')) {
         wx.request({
           url: api.updateLoginUser,
           data: {
-            userId: wx.getStorageSync('userId'), storeId: wx.getStorageSync('storeId'), merchSn: wx.getStorageSync('merchSn')
+            userId: wx.getStorageSync('userId'),
+            storeId: wx.getStorageSync('storeId'),
+            merchSn: wx.getStorageSync('merchSn')
           },
           method: 'POST',
           header: {
             'Content-Type': 'application/json'
           },
-          success: function (wxRes) {
+          success: function(wxRes) {
             if (wxRes.data.errno === 0) {
               // console.log("用户信息更新成功");
             }
           },
-          fail: function (err) {
+          fail: function(err) {
             console.log("failed");
           }
         });
       }
     }
   },
-  changeProperty: function (e) {
+  changeProperty: function(e) {
     var propertyName = e.currentTarget.dataset.propertyName;
     console.log(propertyName);
   },
-  closeAttrOrCollect: function () {
+  closeAttrOrCollect: function() {
     let that = this;
     //添加或是取消收藏
-    util.request(api.CollectAddOrDelete, { typeId: 0, valueId: this.data.id }, "POST")
-      .then(function (res) {
+    util.request(api.CollectAddOrDelete, {
+        typeId: 0,
+        valueId: this.data.id
+      }, "POST")
+      .then(function(res) {
         let _res = res;
         if (_res.errno == 0) {
           if (_res.data.type == 'add') {
@@ -430,17 +464,19 @@ Page({
 
       });
   },
-  openCartPage: function () {
+  openCartPage: function() {
     wx.switchTab({
       url: '/pages/cart/cart',
     });
   },
-  addToCart: function () {
+  addToCart: function() {
     var that = this;
     if (this.data.openAttr == false) {
       //打开规格选择窗口
       this.setData({
-        openAttr: !this.data.openAttr
+        openAttr: !this.data.openAttr,
+        openAttrByOrder: false,
+        number: 1
       });
     } else {
       //提示选择完整规格
@@ -448,15 +484,23 @@ Page({
         return false;
       }
 
-      if (that.data.number + that.data.cartNumber > that.data.stockNum){
+      if (that.data.number + that.data.cartNumber > that.data.stockNum) {
         // wx.showToast({
         //   title: '库存不足',
         //   mask: true
         // });
-        util.showErrorToast('库存不足');
+        if (that.data.cartNumber == that.data.stockNum){
+          wx.showToast({
+            title: '不能再加了,购物车中已加入库存' + that.data.cartNumber + '个',
+            icon: 'none'
+          })
+        }else{
+          util.showErrorToast('库存不足');
+        }
+        // util.showErrorToast('库存不足');
         //找不到对应的product信息,提示没有库存
         return false;
-      } 
+      }
       // console.log(that.data.productList)
       // //根据选中的规格,判断是否有对应的sku信息
       let checkedProduct = goodsUtil.getCheckedProductItem(goodsUtil.getCheckedSpecKey(that), that);
@@ -477,12 +521,12 @@ Page({
 
       //添加到购物车
       util.request(api.CartAdd, {
-        goodsId: this.data.goods.id,
-        number: this.data.number,
-        productId: checkedProduct[0].id,
-        promId: that.data.promId
-      }, "POST")
-        .then(function (res) {
+          goodsId: this.data.goods.id,
+          number: this.data.number,
+          productId: checkedProduct[0].id,
+          promId: that.data.promId
+        }, "POST")
+        .then(function(res) {
           let _res = res;
           if (_res.errno == 0) {
             wx.showToast({
@@ -490,6 +534,7 @@ Page({
             });
             that.setData({
               openAttr: !that.data.openAttr,
+              openAttrByOrder: false,
               cartGoodsCount: _res.data.cartTotal.goodsCount
             });
             if (that.data.userHasCollect == 1) {
@@ -515,17 +560,17 @@ Page({
 
     }
   },
-  cutNumber: function () {
+  cutNumber: function() {
     this.setData({
       number: (this.data.number - 1 > 1) ? this.data.number - 1 : 1
     });
   },
-  addNumber: function () {
+  addNumber: function() {
     this.setData({
       number: this.data.number + 1
     });
   },
-  onShareAppMessage: function () {
+  onShareAppMessage: function() {
     var that = this;
     // console.log("url:" + that.data.goods.list_pic_url);
     var userId = wx.getStorageSync('userId');
@@ -533,15 +578,15 @@ Page({
     console.log("detailStoreId:" + that.data.detailStoreId);
     console.log("merchSn:" + that.data.merchSn);
     console.log("promId:" + that.data.promId);
-    
+
     var requestUrl = "";
     if (that.data.promId) {
-      requestUrl = '/pages/goods/goods?scene='+that.data.id+'&'+that.data.detailStoreId+'&'+ that.data.promId
-        + '&' + wx.getStorageSync('userId');
+      requestUrl = '/pages/goods/goods?scene=' + that.data.id + '&' + that.data.detailStoreId + '&' + that.data.promId +
+        '&' + wx.getStorageSync('userId');
     } else {
-      requestUrl = '/pages/goods/goods?id=' + that.data.id + '&&referrer=' + wx.getStorageSync('userId')
-        + '&&storeId=' + that.data.detailStoreId
-        + '&&merchSn=' + that.data.merchSn;
+      requestUrl = '/pages/goods/goods?id=' + that.data.id + '&&referrer=' + wx.getStorageSync('userId') +
+        '&&storeId=' + that.data.detailStoreId +
+        '&&merchSn=' + that.data.merchSn;
     }
     // console.log("requestUrl:" + requestUrl);
     return {
@@ -549,10 +594,10 @@ Page({
       desc: null != that.data.goods.name ? that.data.goods.name : "商品详情",
       imageUrl: that.data.goods.list_pic_url,
       path: requestUrl,
-      success: function (res) {
+      success: function(res) {
         // console.log("转发成功");
-        console.log("转发成功12:"+that.data.promId);
-        if (that.data.promId){
+        console.log("转发成功12:" + that.data.promId);
+        if (that.data.promId) {
           //转发成功记录推广信息转发次数
           wx.request({
             url: api.GoodsSaveTransNum,
@@ -562,31 +607,39 @@ Page({
               promId: that.data.promId
             },
             method: 'POST',
-            header: { 'Content-Type': 'application/json' },
-            success: function (wxRes) {
+            header: {
+              'Content-Type': 'application/json'
+            },
+            success: function(wxRes) {
               console.log("转发成功");
             }
           });
         }
       },
-      fail: function (res) {
+      fail: function(res) {
         console.log("转发失败");
       }
     }
   },
   //购物车增加
-  addCrashNumber: function (e) {
+  addCrashNumber: function(e) {
     let that = this;
     var goodsId = e.currentTarget.dataset.goodsId;
     var productId = e.currentTarget.dataset.productId;
-    util.request(api.CartAdd, { goodsId: goodsId, productId: productId, number: 1 }, 'POST').then(function (res) {
+    util.request(api.CartAdd, {
+      goodsId: goodsId,
+      productId: productId,
+      number: 1
+    }, 'POST').then(function(res) {
       if (res.errno === 0 && null != res.data) {
         var hotGoods = that.data.hotGoods;
-        hotGoods.forEach(function (val, index, arr) {
+        hotGoods.forEach(function(val, index, arr) {
           if (val.id == goodsId) {
             val.cart_num = res.data;
             hotGoods[index] = val;
-            that.setData({ hotGoods: hotGoods });
+            that.setData({
+              hotGoods: hotGoods
+            });
           }
         }, that);
       }
@@ -665,7 +718,7 @@ Page({
   },
   //触摸事件start
   touchStart2(e) {
-    
+
   },
   touchEnd2(e) {
     this.setData({
@@ -675,9 +728,13 @@ Page({
     })
     this.videoContext.pause();
   },
-  getGoodsRelated: function () {
+  getGoodsRelated: function() {
     let that = this;
-    util.request(api.GoodsRelated, { id: that.data.id, page: that.data.page, size: that.data.size }).then(function (res) {
+    util.request(api.GoodsRelated, {
+      id: that.data.id,
+      page: that.data.page,
+      size: that.data.size
+    }).then(function(res) {
       if (res.errno === 0) {
         let goodsList = that.data.relatedGoods.concat(res.data.goodsList);
         that.setData({
@@ -697,10 +754,11 @@ Page({
     });
     that.getGoodsRelated();
   },
-  switchTicketPop: function () {
+  switchTicketPop: function() {
     this.setData({
       openTicketAttr: !this.data.openTicketAttr,
       openAttr: false,
+      openAttrByOrder: false,
       openCampMinusAttr: false
     })
     if (this.data.openTicketAttr) {
@@ -725,7 +783,7 @@ Page({
       tickDiscId: tickDiscId,
       storeTopicId: storeTopicId,
       storeId: storeId
-    }, 'POST').then(function (res) {
+    }, 'POST').then(function(res) {
       if (res.errno === 0) {
         wx.showToast({
           title: '领取成功'
@@ -747,11 +805,11 @@ Page({
    */
   getTicketDiscountList() {
     let that = this;
-    util.request(api.DiscountByGoodsIdList, { 
-      storeId: that.data.storeId, 
+    util.request(api.DiscountByGoodsIdList, {
+      storeId: that.data.storeId,
       goodsId: that.data.id,
-      size: that.data.discountSize 
-      }).then(function (res) {
+      size: that.data.discountSize
+    }).then(function(res) {
       if (res.errno === 0) {
         that.setData({
           ticketDiscountList: res.data
@@ -768,7 +826,7 @@ Page({
       storeId: that.data.storeId,
       goodsId: that.data.id,
       size: that.data.discountDetailSize
-    }).then(function (res) {
+    }).then(function(res) {
       if (res.errno === 0) {
         that.setData({
           detailTicketDiscountList: res.data
@@ -785,14 +843,14 @@ Page({
       storeId: that.data.storeId,
       goodsId: that.data.id,
       size: that.data.discountSize
-    }).then(function (res) {
+    }).then(function(res) {
       if (res.errno === 0) {
         that.setData({
           storeCampMinusList: res.data
         });
         let storeCampMinusList = that.data.storeCampMinusList
-        for (let i = 0; i < storeCampMinusList.length; i++){
-          if (storeCampMinusList[i].campMinusType == '00' && storeCampMinusList[i].minusMode == '00'){
+        for (let i = 0; i < storeCampMinusList.length; i++) {
+          if (storeCampMinusList[i].campMinusType == '00' && storeCampMinusList[i].minusMode == '00') {
             that.setData({
               minusList0000: true
             });
@@ -824,7 +882,7 @@ Page({
           }
         }
       }
-      }); 
+    });
   },
   /**
    * 查看满减满折列表,详情页展示
@@ -835,7 +893,7 @@ Page({
       storeId: that.data.storeId,
       goodsId: that.data.id,
       size: that.data.campDetailSize
-    }).then(function (res) {
+    }).then(function(res) {
       if (res.errno === 0) {
         that.setData({
           detailStoreCampMinusList: res.data
@@ -843,20 +901,22 @@ Page({
       }
     });
   },
-  switchCampMinusPop: function () {
+  switchCampMinusPop: function() {
     this.setData({
       openCampMinusAttr: !this.data.openCampMinusAttr,
       openTicketAttr: false,
+      openAttrByOrder: false,
       openAttr: false
     })
     if (this.data.openCampMinusAttr) {
       this.getStoreCampMinusList();
     }
   },
-  hideSwitchCampMinusPop: function () {
+  hideSwitchCampMinusPop: function() {
     this.setData({
       openCampMinusAttr: false,
       openTicketAttr: false,
+      openAttrByOrder: false,
       openAttr: false
     })
   },
@@ -864,9 +924,66 @@ Page({
     var that = this;
     let campId = event.currentTarget.dataset.campId;
     let campName = event.currentTarget.dataset.campName;
-    
+
     wx.navigateTo({
       url: '../ucenter/campMinus/campMinus?campMinusId=' + campId + '&&storeId=' + that.data.storeId + '&&campName=' + campName + "&&isShare=1"
     })
-  }
+  },
+  checkoutOrder: function() {
+    //获取已选择的商品
+    let that = this;
+    util.request(api.getCurUser, {
+      userInfo: app.globalData.userInfo
+    }, 'POST').then(function(res) {
+      if (res.errno === 0) {
+        // console.log('that.data.mobile:' + res.data.mobile);
+        if (res.data.mobile == '' || res.data.mobile == null) {
+          wx.showModal({
+            title: '',
+            confirmColor: '#b4282d',
+            showCancel: false,
+            content: '您的手机号码未绑定,请先绑定手机号再进行购买',
+            success: function(res) {
+              if (res.confirm) {
+                wx.navigateTo({
+                  url: '../../pages/auth/newuser/newuser'
+                });
+              }
+            }
+          });
+        } else {
+          if (that.data.openAttrByOrder == false) {
+            //打开规格选择窗口
+            that.setData({
+              openAttrByOrder: !that.data.openAttrByOrder,
+              openAttr: false,
+              number: 1
+            });
+          } else {
+            //提示选择完整规格
+            if (!goodsUtil.isCheckedAllSpec(that)) {
+              return false;
+            }
+            if (that.data.number > that.data.stockNum) {
+              util.showErrorToast('库存不足');
+              return false;
+            }
+            // //根据选中的规格,判断是否有对应的sku信息
+            let checkedProduct = goodsUtil.getCheckedProductItem(goodsUtil.getCheckedSpecKey(that), that);
+            //找不到对应的product信息,提示没有库存
+            if (!checkedProduct || checkedProduct.length <= 0) {
+              wx.showToast({
+                title: '库存不足',
+                icon: 'none'
+              });
+              return false;
+            }
+            wx.navigateTo({
+              url: '../shopping/checkout/checkout?checkCart=00&&goodsId=' + that.data.id + '&&number=' + that.data.number
+            })
+          }
+        }
+      }
+    });
+  },
 })

+ 39 - 6
wx-mall/pages/goods/goods.wxml

@@ -54,7 +54,7 @@
                     </view>
 
                     <view style="width: 750rpx;height: calc(9 * 750rpx / 16);" hidden="{{imgHiddenName}}">
-                      <image lazy-load="true" class="model-img" style="width: 750rpx;height: calc(9 * 750rpx / 16);background-size:650rpx 321rpx;" mode="aspectFill" src="{{gallery[1].img_url}}" background-size="cover"></image>
+                      <image lazy-load="true" class="model-img" style="width: 750rpx;height: calc(9 * 750rpx / 16);background-size:650rpx 321rpx;" mode="aspectFill" src="{{gallery[1].img_url}}?x-oss-process=image/resize,h_500" background-size="cover"></image>
                       <view class="model-btn">
                         <view class="play-icon"></view>
                       </view>
@@ -62,7 +62,7 @@
                   </view>
                   <!-- 视频播放结束 -->
                   <view wx:else>
-                    <image lazy-load="true" src="{{item.img_url}}?x-oss-process=image/resize,h_500" class="imageClass" mode='aspectFill' catchtap='preview' data-url="{{item.img_url}}" />
+                    <image lazy-load="true" src="{{item.img_url}}?x-oss-process=image/resize,h_500" class="imageClass" mode='aspectFill' />
                   </view>
                 </view>
 
@@ -271,10 +271,10 @@
         </view>
       </view>
     </view>
-
   </view>
+
   <view wx:if="{{openAttr}}" class="attr-pop">
-    <!-- <view class="attr-title">加入购物车</view> -->
+    <view class="attr-title">加入购物车</view>
     <view class="attr-close" bindtap="switchAttrPop">X</view>
     <view class="img-info">
       <view>
@@ -285,7 +285,6 @@
           <view class="p">价格:¥{{goods.retail_price}}</view>
           <view class="a" wx:if="{{productList.length>0}}">已选择:{{checkedSpecText}}</view>
           <view class="a">库存{{stockNum}}件</view>
-
         </view>
       </view>
     </view>
@@ -296,7 +295,6 @@
           <view class="value {{vitem.checked ? 'selected' : ''}}" bindtap="clickSkuValue" wx:for="{{item.valueList}}" wx:for-item="vitem" wx:key="{{vitem.id}}" data-value-id="{{vitem.id}}" data-name-id="{{vitem.specification_id}}">{{vitem.value}}</view>
         </view>
       </view>
-
       <view class="number-item">
         <view class="name">数量</view>
         <view class="selnum">
@@ -307,6 +305,40 @@
       </view>
     </view>
   </view>
+  
+  <view wx:if="{{openAttrByOrder}}" class="attr-pop">
+    <view class="attr-title">立即购买</view>
+    <view class="attr-close" bindtap="switchAttrPopByOrder">X</view>
+    <view class="img-info">
+      <view>
+        <image class="img" src="{{goods.list_pic_url}}"></image>
+      </view>
+      <view class="info">
+        <view class="c">
+          <view class="p">价格:¥{{goods.retail_price}}</view>
+          <view class="a" wx:if="{{productList.length>0}}">已选择:{{checkedSpecText}}</view>
+          <view class="a">库存{{stockNum}}件</view>
+        </view>
+      </view>
+    </view>
+    <view class="spec-con">
+      <view class="spec-item" wx:for="{{specificationList}}" wx:key="{{item.specification_id}}">
+        <view class="name">{{item.name}}</view>
+        <view class="values">
+          <view class="value {{vitem.checked ? 'selected' : ''}}" bindtap="clickSkuValue" wx:for="{{item.valueList}}" wx:for-item="vitem" wx:key="{{vitem.id}}" data-value-id="{{vitem.id}}" data-name-id="{{vitem.specification_id}}">{{vitem.value}}</view>
+        </view>
+      </view>
+      <view class="number-item">
+        <view class="name">数量</view>
+        <view class="selnum">
+          <view class="cut" bindtap="cutNumber">-</view>
+          <input value="{{number}}" class="number" disabled="true" type="number" />
+          <view class="{{number>= stockNum? 'addEnabel':'add'}}" bindtap="{{number>= stockNum ? '':'addNumber'}}">+</view>
+        </view>
+      </view>
+    </view>
+  </view>
+  
 </scroll-view>
 
 <!-- 领券弹框start -->
@@ -427,4 +459,5 @@
   </view>
   <!-- <view class="c">立即购买</view> -->
   <view class='{{stockNum ==0 || goods.is_on_sale == 0?"r-disable":"r"}}' bindtap='{{stockNum ==0 || goods.is_on_sale == 0?"":"addToCart"}}'>加入购物车</view>
+  <view class='{{stockNum ==0 || goods.is_on_sale == 0?"r-disable2":"r2"}}' bindtap='{{stockNum ==0 || goods.is_on_sale == 0?"":"checkoutOrder"}}'>立即购买</view>
 </view>

+ 23 - 2
wx-mall/pages/goods/goods.wxss

@@ -840,8 +840,8 @@
 }
 
 .bottom-btn .r {
-  border: 1px solid #b4282d;
-  background: #b4282d;
+  border: 1px solid #eb6064;
+  background: #eb6064;
   float: left;
   height: 100rpx;
   line-height: 96rpx;
@@ -861,6 +861,26 @@
   text-align: center;
   color: rgb(248, 206, 206);
 }
+.bottom-btn .r2 {
+  border: 1px solid #b4282d;
+  background: #b4282d;
+  float: left;
+  height: 100rpx;
+  line-height: 96rpx;
+  flex: 1;
+  text-align: center;
+  color: #fff;
+}
+.bottom-btn .r-disable2 {
+  border: 1px solid #c57477;
+  background: #c57477;
+  float: left;
+  height: 100rpx;
+  line-height: 96rpx;
+  flex: 1;
+  text-align: center;
+  color: rgb(248, 206, 206);
+}
 .attr-pop {
   width: 100%;
   height: auto;
@@ -897,6 +917,7 @@
   font-size: 35rpx;
   text-align: center;
   overflow: hidden;
+  font-weight:bold;
 }
 
 .attr-pop .img-info {

+ 12 - 11
wx-mall/pages/hotGoods/hotGoods.wxml

@@ -78,19 +78,20 @@
   </view>
   <view class="cate-item" bindtap="hideSwitchAttrPop">
     <view class="b">
-      <block wx:for="{{goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="unique">
-        <view class="item {{iindex % 2 == 0 ? 'item-b' : '' }}">
+      <scroll-view scroll-y>
+        <block wx:for="{{goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="unique">
+          <view class="item {{iindex % 2 == 0 ? 'item-b' : '' }}">
+            <navigator url="../goods/goods?id={{iitem.id}}&&storeId={{iitem.storeId}}">
+              <image class="img" src="{{iitem.list_pic_url}}"></image>
+              <text class="name">{{iitem.name}}</text>
+            </navigator>
 
-          <navigator url="../goods/goods?id={{iitem.id}}&&storeId={{iitem.storeId}}">
-            <image class="img" src="{{iitem.list_pic_url}}" ></image>
-            <text class="name">{{iitem.name}}</text>
-          </navigator>
-
-          <view class="price">¥{{iitem.retail_price}}
-            <image class="cart" src="/static/images/cart.png" data-goods-id="{{iitem.id}}" data-retail-price="{{iitem.retail_price}}" bindtap='addCart' background-size="cover"></image>
+            <view class="price">¥{{iitem.retail_price}}
+              <image lazy-load="true" class="cart" src="/static/images/cart.png" data-goods-id="{{iitem.id}}" data-retail-price="{{iitem.retail_price}}" bindtap='addCart' background-size="cover"></image>
+            </view>
           </view>
-        </view>
-      </block>
+        </block>
+      </scroll-view>
     </view>
   </view>
 

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

@@ -24,7 +24,7 @@ Page({
     openAttr: false,
     isMapShow: '', //第三方商户是否启用地图显示
   },
-  onLoad: function(options) {
+  onLoad: function (options) {
     let that = this;
     wx.setStorageSync("navUrl", "/pages/index/index");
     // options.scene = 38;
@@ -54,10 +54,10 @@ Page({
       }
     }
   },
-  onReady: function() {
+  onReady: function () {
     // 页面渲染完成
   },
-  onShow: function() {
+  onShow: function () {
     // 页面显示
     let that = this;
     wx.setStorageSync("navUrl", "/pages/index/index");
@@ -69,10 +69,10 @@ Page({
       })
     }
   },
-  onHide: function() {
+  onHide: function () {
     // 页面隐藏
   },
-  onUnload: function() {
+  onUnload: function () {
     // 页面关闭
   },
   showCouponPop() {
@@ -90,20 +90,20 @@ Page({
       content: that.data.couponVo.name
     })
   },
-  onShareAppMessage: function() {
+  onShareAppMessage: function () {
     return {
       title: '商业版',
       desc: '新人好礼送券',
       path: '/pages/index/index'
     }
   },
-  getIndexData: function() {
-    setTimeout(function() {}, 350)
+  getIndexData: function () {
+    setTimeout(function () { }, 350)
     wx.showLoading({
       title: '加载中...',
     })
     let that = this;
-    util.request(api.IndexUrl).then(function(res) {
+    util.request(api.IndexUrl).then(function (res) {
       if (res.errno === 0) {
         // console.log(res.data.banner);
         that.setData({
@@ -122,6 +122,8 @@ Page({
         // if (that.data.hotGoods.length == 0) {
         //   that.getGoodsList();
         // }
+        // console.log("mapIndexStoreId:" + wx.getStorageSync('mapIndexStoreId'))
+        // console.log("storeId:" + wx.getStorageSync('storeId'))
         console.log("isShare:" + wx.getStorageSync('isShare'))
         console.log("isLoadGoods:" + wx.getStorageSync('isLoadGoods'))
         //当切换了门店地图(mapIndexStoreId),或是由用户分享进入的商品详情切换进入的首页(isShare:true)
@@ -134,7 +136,7 @@ Page({
           if (wx.getStorageSync('isLoadGoods') == '1') {
             util.request(api.UpdateStoreLoadGoods, {
               storeId: wx.getStorageSync('storeId')
-            }).then(function(res) {});
+            }).then(function (res) { });
           }
           wx.setStorageSync('isShare', 'false');
         }
@@ -142,17 +144,17 @@ Page({
       wx.hideLoading();
     });
   },
-  getGoodsList: function() {
+  getGoodsList: function () {
     let that = this;
-    util.request(api.GoodsHot).then(function(res) {
+    util.request(api.GoodsHot).then(function (res) {
       if (res.errno == 0) {
         util.request(api.HotGoodsList, {
-            isHot: 1,
-            page: that.data.page,
-            size: that.data.size,
-            categoryId: 0
-          })
-          .then(function(res) {
+          isHot: 1,
+          page: that.data.page,
+          size: that.data.size,
+          categoryId: 0
+        })
+          .then(function (res) {
             if (res.errno == 0) {
               let goodsList = that.data.hotGoods.concat(res.data.goodsList);
               that.setData({
@@ -165,9 +167,9 @@ Page({
       }
     });
   },
-  getGroupData: function() {
+  getGroupData: function () {
     let that = this;
-    util.request(api.GroupList).then(function(res) {
+    util.request(api.GroupList).then(function (res) {
       if (res.errno === 0) {
         that.setData({
           groupGoods: res.data.data,
@@ -185,7 +187,7 @@ Page({
       url: '../search/search',
     })
   },
-  goCatalog: function(e) {
+  goCatalog: function (e) {
     let url = '';
     // console.log('dataset.goodsBizType:' + e.currentTarget.dataset.goodsBizType);
     app.globalData.appGoodsBizType = e.currentTarget.dataset.goodsBizType;
@@ -195,7 +197,7 @@ Page({
       url: '/pages/catalog/catalog',
     });
   },
-  onReachBottom: function() {
+  onReachBottom: function () {
     if (this.data.bottomLoadDone === true || this.data.bottomLoading === true) {
       return false;
     }
@@ -204,7 +206,7 @@ Page({
     });
     // this.getFloorCategory();
   },
-  reLoad: function() {
+  reLoad: function () {
     let that = this;
     // console.log(wx.getStorageSync('userId'));
     // console.log(wx.getStorageSync('storeId'));
@@ -222,28 +224,30 @@ Page({
           header: {
             'Content-Type': 'application/json'
           },
-          success: function(wxRes) {
+          success: function (wxRes) {
             if (wxRes.data.errno === 0) {
               that.setData({
                 isMapShow: wxRes.data.data.isMapShow
               });
+              // console.log(wxRes.data.data.isLoadGoods);
+              wx.setStorageSync('isLoadGoods', wxRes.data.data.isLoadGoods);
               wx.setStorageSync('thirdPartyMerchCode', wxRes.data.data.thirdPartyMerchCode);
               // console.log(that.data.isMapShow)
               // console.log("用户信息更新成功");
+              that.getIndexData();
+              that.enableActivity();
+              that.getGroupData();
             }
           },
-          fail: function(err) {
+          fail: function (err) {
             console.log("failed");
           }
         });
       }
-      that.getIndexData();
-      that.enableActivity();
-      that.getGroupData();
     }
   },
   // 同步门店
-  syncStore: function() {
+  syncStore: function () {
     let that = this;
     // console.log(wx.getStorageSync('merchSn'));
     //获取附件门店信息
@@ -274,7 +278,6 @@ Page({
         } else {
           wx.setStorageSync('nearStoreList', JSON.stringify(nlist));
           wx.setStorageSync('mapIndexStoreId', nlist[0].id);
-          wx.setStorageSync('isLoadGoods', nlist[0].isLoadGoods);
         }
 
         if (!nlist.length) {
@@ -296,12 +299,12 @@ Page({
 
   },
   // 更新门店Id
-  chooseStore: function(storeId, merchSn) {
+  chooseStore: function (storeId, merchSn) {
     let that = this;
     util.request(api.ChooseStoreId, {
       storeId: storeId,
       merchSn: merchSn
-    }, 'POST').then(function(res) {
+    }, 'POST').then(function (res) {
       if (res.errno === 0) {
         wx.setStorageSync('storeId', storeId);
         wx.setStorageSync('merchSn', merchSn);
@@ -310,7 +313,7 @@ Page({
     });
   },
   //购物车减少
-  cutNumber: function(e) {
+  cutNumber: function (e) {
     let that = this;
     var goodsId = e.currentTarget.dataset.goodsId;
     var productId = e.currentTarget.dataset.productId;
@@ -329,10 +332,10 @@ Page({
       goodsId: goodsId,
       productId: productId,
       number: 1
-    }, 'POST').then(function(res) {
+    }, 'POST').then(function (res) {
       if (res.errno === 0 && null != res.data) {
         var hotGoods = that.data.hotGoods;
-        hotGoods.forEach(function(val, index, arr) {
+        hotGoods.forEach(function (val, index, arr) {
           if (val.product_id == productId) {
             val.cart_num = res.data;
             hotGoods[index] = val;
@@ -345,7 +348,7 @@ Page({
     });
   },
   //购物车增加
-  addNumber: function(e) {
+  addNumber: function (e) {
     let that = this;
     var goodsId = e.currentTarget.dataset.goodsId;
     var productId = e.currentTarget.dataset.productId;
@@ -361,10 +364,10 @@ Page({
       goodsId: goodsId,
       productId: productId,
       number: 1
-    }, 'POST').then(function(res) {
+    }, 'POST').then(function (res) {
       if (res.errno === 0 && null != res.data) {
-        hotGoods.forEach(function(val, index, arr) {
-          res.data.cartList.forEach(function(cartVal, cartIndex, cartArr) {
+        hotGoods.forEach(function (val, index, arr) {
+          res.data.cartList.forEach(function (cartVal, cartIndex, cartArr) {
             if (val.product_id == cartVal.product_id) {
               val.cart_num = cartVal.number;
               hotGoods[index] = val;
@@ -374,6 +377,9 @@ Page({
             hotGoods: hotGoods
           });
         }, that);
+        wx.showToast({
+          title: '添加成功'
+        })
       } else {
         wx.showToast({
           title: res.errmsg,
@@ -383,7 +389,7 @@ Page({
     });
   },
   // 查询是否有活动
-  enableActivity: function() {
+  enableActivity: function () {
     let that = this;
     let couponIds = wx.getStorageSync('couponIds');
     if (!couponIds) {
@@ -410,7 +416,7 @@ Page({
     // });
   },
   // 商品扫码
-  scanGoodsCode: function(e) {
+  scanGoodsCode: function (e) {
     var that = this;
     var code;
     var value;
@@ -422,7 +428,7 @@ Page({
       onlyFromCamera: true,
       // 扫码类型, barCode:一维码, qrCode:二维码
       scanType: ['barCode', 'qrCode'],
-      success: function(res) {
+      success: function (res) {
         that.code = "结果:" + res.result + ",路径:" + res.path + ",编码:" + res.rawData;
         that.value = res.result;
         that.scanType = res.scanType;
@@ -452,7 +458,7 @@ Page({
               title: '',
               content: '您所扫描的商品无效',
               showCancel: false,
-              success: function(res) {
+              success: function (res) {
                 if (res.confirm) {
                   console.log('用户点击确定')
                 } else if (res.cancel) {
@@ -474,17 +480,17 @@ Page({
             id: goodId,
             storeId: storeId,
             referrer: ''
-          }).then(function(res) {
+          }).then(function (res) {
             if (res.errno === 0) {
               // console.log(res);
               // 跳转页面
-              setTimeout(function() {
+              setTimeout(function () {
                 wx.navigateTo({
                   url: that.value,
-                  success: function(e) {
+                  success: function (e) {
                     console.log('跳转成功');
                   },
-                  fail: function(e) {
+                  fail: function (e) {
                     console.log('跳转失败');
                   }
                 })
@@ -506,7 +512,7 @@ Page({
           });
         }
       },
-      fail: function() {
+      fail: function () {
         // 显示提示框
         wx.showToast({
           title: '扫码失败',
@@ -518,7 +524,7 @@ Page({
 
     })
   },
-  imgOnLoad: function(e) {
+  imgOnLoad: function (e) {
     let that = this;
     // console.log('图片加载完成');
     // var realthumb = e.target.dataset.thumb;
@@ -532,18 +538,18 @@ Page({
     //   })
     // }
   },
-  switchAttrPop: function() {
+  switchAttrPop: function () {
     this.setData({
       openAttr: !this.data.openAttr
     })
   },
-  hideSwitchAttrPop: function() {
+  hideSwitchAttrPop: function () {
     this.setData({
       openAttr: false
     })
   },
   //购物车增加
-  addCart: function(e) {
+  addCart: function (e) {
     let that = this;
     that.setData({
       number: 1
@@ -552,7 +558,7 @@ Page({
     var retailPrice = e.currentTarget.dataset.retailPrice;
     util.request(api.GoodsSku, {
       goodsId: goodsId
-    }).then(function(res) {
+    }).then(function (res) {
       if (res.errno === 0 && null != res.data) {
         that.setData({
           goodsVo: res.data.goodsVo,
@@ -580,7 +586,7 @@ Page({
     });
   },
 
-  shows: function(e) {
+  shows: function (e) {
     // wx.redirectTo({
     //   url: '/pages/images/images'
     // })

+ 33 - 27
wx-mall/pages/index/index.wxml

@@ -1,8 +1,8 @@
 <!--index.wxml-->
 <view class="container">
 
-<template name="dialog">
-</template>
+  <template name="dialog">
+  </template>
 
   <view class="modal-wrap" wx:if="{{showPop}}" bindtap="showCouponPop">
     <view class="discount-dialog">
@@ -19,7 +19,7 @@
 
   <view class="search-header">
     <view class="input-box">
-    <input name="input" class="keywrod" value="搜索商品" confirm-type="search" bindtap="goSearch" />
+      <input name="input" class="keywrod" value="搜索商品" confirm-type="search" bindtap="goSearch" />
     </view>
     <image src="../../static/images/service-sao.png" class="search-icon-shop" bindtap="scanGoodsCode"></image>
   </view>
@@ -30,11 +30,11 @@
 
   <swiper class="banner" indicator-dots="true" autoplay="true" interval="15000" duration="750">
     <swiper-item wx:for="{{banner}}" wx:key="{{item.id}}">
-    <scroll-view class='contents fade_in}}'>
-      <navigator url="{{item.link}}">
-        <image lazy-load="true" class="swiper-item" src="{{item.imageUrl}}" bindload="imgOnLoad"  mode="aspectFill" background-size="cover"></image>
-      </navigator>
-    </scroll-view>
+      <scroll-view class='contents fade_in'>
+        <navigator url="{{item.link}}">
+          <image lazy-load='true' class="swiper-item" src="{{item.imageUrl}}?x-oss-process=image/resize,h_500" mode="aspectFill" background-size="cover"></image>
+        </navigator>
+      </scroll-view>
     </swiper-item>
   </swiper>
   <view class="m-menu">
@@ -170,31 +170,37 @@
     </view>
     <view class="b">
       <view class="item" wx:for="{{hotGoods}}" wx:for-index="index" wx:for-item="item" wx:key="{{item.id}}">
-        <view class="c">
-          <navigator url="/pages/goods/goods?id={{item.id}}&&storeId={{item.storeId}}">
-            <image class="img" src="{{item.list_pic_url}}" mode="aspectFill"></image>
-          </navigator>
-        </view>
-        <view class="right">
-          <view class="text">
+        <scroll-view class='contents fade_in'>
+          <view class="c">
             <navigator url="/pages/goods/goods?id={{item.id}}&&storeId={{item.storeId}}">
-              <text class="name">{{item.name?item.name:""}}</text>
-              <text class="desc">{{item.goods_brief?item.goods_brief:""}}</text>
+              <image lazy-load="true" class="img" src="{{item.list_pic_url}}?x-oss-process=image/resize,h_500" mode="aspectFit"></image>
             </navigator>
-            <view class="goods-do">
-              <text class="price">{{item.retail_price?"¥"+item.retail_price:"0"}}</text>
-              <text class="org-price line-through">{{item.market_price?"¥"+item.market_price:""}}</text>
-              <!-- //数量加减 -->
-              <!-- <view class="number-item">
-                <view class="selnum">
-                  <view class="cut" data-goods-id="{{item.id}}" data-product-id="{{item.product_id}}" bindtap="cutNumber"></view>
+          </view>
+          <view class="right">
+            <view class="text">
+              <navigator url="/pages/goods/goods?id={{item.id}}&&storeId={{item.storeId}}">
+                <text class="name">{{item.name?item.name:""}}</text>
+                <text class="desc">{{item.goods_brief?item.goods_brief:""}}</text>
+              </navigator>
+              <view class="goods-do">
+                <navigator url="/pages/goods/goods?id={{item.id}}&&storeId={{item.storeId}}">
+                  <text class="price">{{item.retail_price?"¥"+item.retail_price:"0"}}</text>
+                  <text class="org-price line-through">{{item.market_price?"¥"+item.market_price:""}}</text>
+                </navigator>
+                <!-- //数量加减 -->
+                <view class="number-item">
+                  <view class="selnum">
+                    <!-- <image lazy-load="true" class="cart" src="/static/images/cart.png" data-goods-id="{{item.id}}" data-product-id="{{item.product_id}}" bindtap="addNumber" background-size="cover"></image> -->
+                    <!-- <view class="cut" data-goods-id="{{item.id}}" data-product-id="{{item.product_id}}" bindtap="cutNumber"></view>
                   <input value="{{item.cart_num}}" class="number" disabled="true" type="number" />
-                  <view class="add" data-goods-id="{{item.id}}" data-product-id="{{item.product_id}}" bindtap="addNumber"></view>
+                  <view class="add" data-goods-id="{{item.id}}" data-product-id="{{item.product_id}}" bindtap="addNumber"></view> -->
+                  </view>
                 </view>
-              </view> -->
+              </view>
             </view>
           </view>
-        </view>
+        </scroll-view>
+
       </view>
     </view>
   </view>

+ 9 - 2
wx-mall/pages/index/index.wxss

@@ -503,11 +503,12 @@
   align-items: center;
   position: absolute;
   right: 0;
-  margin-right: 40rpx;
+  margin-right: 60rpx;
+  /* margin-top:8rpx; */
 }
 
 .number-item .selnum {
-  height: 71rpx;
+  /* height: 71rpx; */
   display: flex;
 }
 
@@ -651,3 +652,9 @@
   margin-left: 15rpx;
   margin-top: 20rpx;
 }
+.cart{
+  margin-left: 20rpx;
+  width: 35rpx;
+  height: 35rpx;
+  vertical-align: -6rpx;
+}

+ 4 - 0
wx-mall/pages/pay/pay.js

@@ -48,7 +48,11 @@ Page({
 
   },
   onUnload: function () {
+    console.log('页面关闭');
     // 页面关闭
+    wx.switchTab({
+      url: "/pages/cart/cart"
+    });
 
   },
   reLoad: function () {

+ 76 - 53
wx-mall/pages/shopping/checkout/checkout.js

@@ -77,7 +77,62 @@ Page({
     campMinusDto11: '',
     checkCampId: 0,
     storeCampMinusList: [],
-    openCampMinusAttr: false
+    openCampMinusAttr: false,
+    goodsId: '',
+    number: ''
+  },
+  onLoad: function (options) {
+    // 页面初始化 options为页面跳转所带来的参数
+    // console.log(options.checkCart);
+    this.setData({
+      checkCart: options.checkCart
+    });
+    if(options.goodsId){
+      this.setData({
+        goodsId: options.goodsId,
+        number: options.number
+      });
+      console.log(this.data.goodsId);
+      console.log(this.data.number);
+    }
+  },
+  onReady: function () {
+    // 页面渲染完成
+  },
+  onShow: function () {
+    let that = this;
+    // 页面显示
+    wx.showLoading({
+      title: '加载中...',
+    })
+    if (wx.getStorageSync('userInfo') || wx.getStorageSync('token')) {
+      if (wx.getStorageSync('storeId')) {
+        util.request(api.ChooseStoreId, {
+          storeId: wx.getStorageSync('storeId'),
+          merchSn: wx.getStorageSync('merchSn')
+        }, 'POST').then(function (res) {
+          if (res.errno === 0) {
+            wx.setStorageSync('storeId', wx.getStorageSync('storeId'));
+            wx.setStorageSync('merchSn', wx.getStorageSync('merchSn'));
+            that.reLoad();
+          }
+        });
+        that.getCheckoutInfo();
+        that.initPicker()
+      }
+    } else {
+      wx.navigateTo({
+        url: '/pages/auth/btnAuth/btnAuth',
+      })
+    }
+  },
+  onHide: function () {
+    // 页面隐藏
+    console.log('页面隐藏');
+  },
+  onUnload: function () {
+    // 页面关闭
+    console.log('页面关闭');
   },
   bindMultiPickerColumnChange: function(e) {
     let that = this;
@@ -144,7 +199,9 @@ Page({
       campId11: that.data.campId11,
       merchSn: wx.getStorageSync('merchSn'),
       checkCart: that.data.checkCart,
-      isLoadStatus: 0//是首次加载
+      isLoadStatus: 0,//是首次加载
+      goodsId: that.data.goodsId,
+      number: that.data.number
     }, 'POST').then(function (res) {
       if (res.errno === 0) {
         console.log(res.data);
@@ -366,7 +423,9 @@ Page({
       campId02: that.data.campId02,
       campId10: that.data.campId10,
       campId11: that.data.campId11,
-      isLoadStatus: that.data.isLoadStatus
+      isLoadStatus: that.data.isLoadStatus,
+      goodsId: that.data.goodsId,
+      number: that.data.number
     }, 'POST').then(function(res) {
       if (res.errno === 0) {
         let actualPrice = that.data.actualPrice;
@@ -409,52 +468,6 @@ Page({
       }
     });
   },
-  onLoad: function(options) {
-    // 页面初始化 options为页面跳转所带来的参数
-    // console.log(options.checkCart);
-    this.setData({
-      checkCart: options.checkCart
-    });
-  },
-  onReady: function() {
-    // 页面渲染完成
-
-  },
-  onShow: function() {
-    let that = this;
-    // 页面显示
-    wx.showLoading({
-      title: '加载中...',
-    })
-    if (wx.getStorageSync('userInfo') || wx.getStorageSync('token')) {
-      if (wx.getStorageSync('storeId')) {
-        util.request(api.ChooseStoreId, {
-          storeId: wx.getStorageSync('storeId'),
-          merchSn: wx.getStorageSync('merchSn')
-        }, 'POST').then(function(res) {
-          if (res.errno === 0) {
-            wx.setStorageSync('storeId', wx.getStorageSync('storeId'));
-            wx.setStorageSync('merchSn', wx.getStorageSync('merchSn'));
-            that.reLoad();
-          }
-        });
-        that.getCheckoutInfo();
-        that.initPicker()
-      }
-    } else {
-      wx.navigateTo({
-        url: '/pages/auth/btnAuth/btnAuth',
-      })
-    }
-  },
-  onHide: function() {
-    // 页面隐藏
-
-  },
-  onUnload: function() {
-    // 页面关闭
-
-  },
   reLoad: function() {
     let that = this;
     if (wx.getStorageSync('storeId')) {
@@ -612,7 +625,9 @@ Page({
     util.request(api.DiscountByCheckCartList, {
       storeId: wx.getStorageSync('storeId'),
       checkCart: that.data.checkCart,
-      bizType: bizType
+      bizType: bizType,
+      goodsId: that.data.goodsId,
+      number: that.data.number
     }).then(function(res) {
       if (res.errno === 0) {
         that.setData({
@@ -673,11 +688,14 @@ Page({
       campId11: that.data.campId11,
       merchSn: wx.getStorageSync('merchSn'),
       checkCart: that.data.checkCart,
-      isLoadStatus: 2//2代表选择优惠券加载
+      isLoadStatus: 2,//2代表选择优惠券加载
+      goodsId: that.data.goodsId,
+      number: that.data.number
     }, 'POST').then(function (res) {
       console.log(res.data);
       if (res.errno === 0) {
         that.setData({
+          checkedGoodsList: res.data.checkedGoodsList,
           actualPrice: res.data.actualPrice,
           actualPrice00: res.data.actualPrice00,
           actualPrice02: res.data.actualPrice02,
@@ -753,7 +771,9 @@ Page({
     util.request(api.CampminusByCheckCartList, {
       storeId: wx.getStorageSync('storeId'),
       checkCart: that.data.checkCart,
-      bizType: goodsBizType
+      bizType: goodsBizType,
+      goodsId: that.data.goodsId,
+      number: that.data.number
     }).then(function(res) {
       if (res.errno === 0) {
         that.setData({
@@ -811,11 +831,14 @@ Page({
       campId11: that.data.campId11,
       merchSn: wx.getStorageSync('merchSn'),
       checkCart: that.data.checkCart,
-      isLoadStatus: 1//1代表选择促销活动加载
+      isLoadStatus: 1,//1代表选择促销活动加载
+      goodsId: that.data.goodsId,
+      number: that.data.number
     }, 'POST').then(function (res) {
       console.log(res.data);
       if (res.errno === 0) {
         that.setData({
+          checkedGoodsList: res.data.checkedGoodsList,
           actualPrice: res.data.actualPrice,
           actualPrice00: res.data.actualPrice00,
           actualPrice02: res.data.actualPrice02,

+ 29 - 20
wx-mall/pages/shopping/checkout/checkout.wxml

@@ -63,10 +63,12 @@
           <view class="info">
             <view class="t">
               <view class="name">
-                {{item.goods_name}}</view>
+                <text class='camps' style='color:white'wx:if="{{item.isCamp}}">满减</text><text class='camps' style='color:white;margin-left:4rpx;'wx:if="{{item.isDiscount}}">优惠</text> {{item.goods_name}}
+              </view>
               <text class="number">x{{item.number}}</text>
             </view>
-            <!-- <view class="m">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}</view> -->
+            <!-- <text wx:if="{{item.campNameList.length > 0}}" wx:for="{{item.campNameList}}" wx:for-item="cell" wx:key="{{index}}" class='camp'>{{cell}}</text> -->
+            <view class="m">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}</view>
             <view class="b">¥{{item.retail_price}}</view>
           </view>
         </view>
@@ -92,7 +94,7 @@
         <!-- 促销、优惠券、总金额、运费start -->
         <view class="list-cell-checked" bindtap="selectCamp" data-goods-type="00" wx:if="{{campList00.length > 0}}">
           <view class="list-cell-checked-bd">
-            <text wx:if="{{campMinusDto00.campMinusId!=0}}" class="name">促销:{{campMinusDto00.campMinusType==00?'满元减:':''}}{{campMinusDto00.campMinusType==01?'满件减:':''}}{{campMinusDto00.campMinusType==10?'满元折:':''}}{{campMinusDto00.campMinusType==11?'满件折:':''}}{{campMinusDto00.campName}}</text>
+            <text wx:if="{{campMinusDto00.campMinusId!=0}}" class="name">促销:{{campMinusDto00.campMinusType==00?'满元减:':''}}{{campMinusDto00.campMinusType==01?'满件减:':''}}{{campMinusDto00.campMinusType==10?'满元折:':''}}{{campMinusDto00.campMinusType==11?'满件折:':''}}{{campMinusDto00.campName}}<text style='font-size:22rpx'>{{campMinusDto00.applyType!=00?'(部分商品满减)':''}}</text></text>
             <text wx:if="{{campMinusDto00.campMinusId==0}}" class="name">促销:未选择</text>
           </view>
           <view class="list-cell-checked-ft router">
@@ -103,7 +105,7 @@
 
         <view class="list-cell-checked" bindtap="selectCoupon" data-goods-type="00" wx:if="{{couponList00.length > 0}}">
           <view class="list-cell-checked-bd">
-            <text wx:if="{{checkedCoupon00.id > 0}}" class="name">优惠券:{{checkedCoupon00.couponName}}</text>
+            <text wx:if="{{checkedCoupon00.id > 0}}" class="name">优惠券:{{checkedCoupon00.couponName}}<text style='font-size:22rpx'>{{checkedCoupon00.applyType!=00?'(部分商品优惠)':''}}</text></text>
             <text wx:if="{{checkedCoupon00.id==0}}" class="name">优惠券:未选择</text>
           </view>
           <view class="list-cell-checked-ft router">
@@ -116,7 +118,8 @@
             <view class="list-label">商品合计</view>
           </view>
           <view class="list-cell-ft">
-            <text class="txt">共{{goodsTotalByType00}}件商品  总计¥{{goodsTotalPrice00}} <text wx:if="{{checkedCoupon00||campMinusDto00}}" class="txt">优惠后价格<text style='color:#b4282d;font-size:24rpx'>¥{{actualPrice00}}</text></text></text>
+            <text class="txt">共{{goodsTotalByType00}}件商品  总计¥{{goodsTotalPrice00}} <text wx:if="{{checkedCoupon00||campMinusDto00}}" class="txt">优惠后价格<text style='color:#b4282d;font-size:24rpx'>¥{{actualPrice00}}</text></text>
+            </text>
           </view>
         </view>
         <view class="list-cell" wx:if="{{campMinusDto00.campMinusId > 0}}" bindtap="hideSwitchTicketPop">
@@ -160,7 +163,8 @@
           <view class="info">
             <view class="t">
               <view class="name">
-                {{item.goods_name}}</view>
+                <text class='camps' style='color:white'wx:if="{{item.isCamp}}">满减</text><text class='camps' style='color:white;margin-left:4rpx;'wx:if="{{item.isDiscount}}">优惠</text> {{item.goods_name}}
+              </view>
               <text class="number">x{{item.number}}</text>
             </view>
             <!-- <view class="m">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}</view> -->
@@ -189,7 +193,7 @@
         <!-- 促销、优惠券、总金额、运费start -->
         <view class="list-cell-checked" bindtap="selectCamp" data-goods-type="02" wx:if="{{campList02.length > 0}}">
           <view class="list-cell-checked-bd">
-            <text wx:if="{{campMinusDto02.campMinusId!=0}}" class="name">促销:{{campMinusDto02.campMinusType==00?'满元减:':''}}{{campMinusDto02.campMinusType==01?'满件减:':''}}{{campMinusDto02.campMinusType==10?'满元折:':''}}{{campMinusDto02.campMinusType==11?'满件折:':''}}{{campMinusDto02.campName}}</text>
+            <text wx:if="{{campMinusDto02.campMinusId!=0}}" class="name">促销:{{campMinusDto02.campMinusType==00?'满元减:':''}}{{campMinusDto02.campMinusType==01?'满件减:':''}}{{campMinusDto02.campMinusType==10?'满元折:':''}}{{campMinusDto02.campMinusType==11?'满件折:':''}}{{campMinusDto02.campName}}<text style='font-size:22rpx'>{{campMinusDto02.applyType!=00?'(部分商品满减)':''}}</text></text>
             <text wx:if="{{campMinusDto02.campMinusId==0}}" class="name">促销:未选择</text>
           </view>
           <view class="list-cell-checked-ft router">
@@ -200,8 +204,8 @@
 
         <view class="list-cell-checked" bindtap="selectCoupon" data-goods-type="02" wx:if="{{couponList02.length > 0}}">
           <view class="list-cell-checked-bd">
-            <text wx:if="{{checkedCoupon02.id > 0}}" class="name">优惠券:{{checkedCoupon02.couponName}}</text>
-            <text wx:if="{{checkedCoupon02.id==0}}" class="name">优惠券:未选择</text>
+            <text wx:if="{{checkedCoupon02.id > 0}}" class="name">优惠券:{{checkedCoupon02.couponName}}<text style='font-size:22rpx'>{{checkedCoupon02.applyType!=00?'(部分商品优惠)':''}}</text></text>
+            <text wx:if="{{checkedCoupon02.id==0}}" class="name">优惠券未选择</text>
           </view>
           <view class="list-cell-checked-ft router">
             <text wx:if="{{checkedCoupon02.id > 0}}" class="money red-txt">{{checkedCoupon02.tickDiscType==01?'¥'+checkedCoupon02.typeMoney+'折':'-¥'+checkedCoupon02.typeMoney}}</text>
@@ -213,7 +217,8 @@
             <view class="list-label">商品合计</view>
           </view>
           <view class="list-cell-ft">
-            <text class="txt">共{{goodsTotalByType02}}件商品  总计¥{{goodsTotalPrice02}} <text wx:if="{{checkedCoupon02||campMinusDto02}}" class="txt">优惠后价格<text style='color:#b4282d;font-size:24rpx'>¥{{actualPrice02}}</text></text></text>
+            <text class="txt">共{{goodsTotalByType02}}件商品  总计¥{{goodsTotalPrice02}} <text wx:if="{{checkedCoupon02||campMinusDto02}}" class="txt">优惠后价格<text style='color:#b4282d;font-size:24rpx'>¥{{actualPrice02}}</text></text>
+            </text>
           </view>
         </view>
         <view class="list-cell" wx:if="{{campMinusDto02.campMinusId > 0}}" bindtap="hideSwitchTicketPop">
@@ -256,7 +261,8 @@
           <view class="info">
             <view class="t">
               <view class="name">
-                {{item.goods_name}}</view>
+                <text class='camps' style='color:white'wx:if="{{item.isCamp}}">满减</text> <text class='camps' style='color:white;margin-left:4rpx;'wx:if="{{item.isDiscount}}">优惠</text>{{item.goods_name}}
+              </view>
               <text class="number">x{{item.number}}</text>
             </view>
             <!-- <view class="m">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}</view> -->
@@ -286,7 +292,7 @@
         <!-- 促销、优惠券、总金额、运费start -->
         <view class="list-cell-checked" bindtap="selectCamp" data-goods-type="10" wx:if="{{campList10.length > 0}}">
           <view class="list-cell-checked-bd">
-            <text wx:if="{{campMinusDto10.campMinusId!=0}}" class="name">促销:{{campMinusDto10.campMinusType==00?'满元减:':''}}{{campMinusDto10.campMinusType==01?'满件减:':''}}{{campMinusDto10.campMinusType==10?'满元折:':''}}{{campMinusDto10.campMinusType==11?'满件折:':''}}{{campMinusDto10.campName}}</text>
+            <text wx:if="{{campMinusDto10.campMinusId!=0}}" class="name">促销:{{campMinusDto10.campMinusType==00?'满元减:':''}}{{campMinusDto10.campMinusType==01?'满件减:':''}}{{campMinusDto10.campMinusType==10?'满元折:':''}}{{campMinusDto10.campMinusType==11?'满件折:':''}}{{campMinusDto10.campName}}<text style='font-size:22rpx'>{{campMinusDto10.applyType!=00?'(部分商品满减)':''}}</text></text>
             <text wx:if="{{campMinusDto10.campMinusId==0}}" class="name">促销:未选择</text>
           </view>
           <view class="list-cell-checked-ft router">
@@ -297,8 +303,8 @@
 
         <view class="list-cell-checked" bindtap="selectCoupon" data-goods-type="10" wx:if="{{couponList10.length > 0}}">
           <view class="list-cell-checked-bd">
-            <text wx:if="{{checkedCoupon10.id > 0}}" class="name">优惠券:{{checkedCoupon10.couponName}}</text>
-            <text wx:if="{{checkedCoupon10.id==0}}" class="name">优惠券:未选择</text>
+            <text wx:if="{{checkedCoupon10.id > 0}}" class="name">优惠券:{{checkedCoupon10.couponName}}<text style='font-size:22rpx'>{{checkedCoupon10.applyType!=00?'(部分商品优惠)':''}}</text></text>
+            <text wx:if="{{checkedCoupon10.id==0}}" class="name">优惠券未选择</text>
           </view>
           <view class="list-cell-checked-ft router">
             <text wx:if="{{checkedCoupon10.id > 0}}" class="money red-txt">{{checkedCoupon10.tickDiscType==01?'¥'+checkedCoupon10.typeMoney+'折':'-¥'+checkedCoupon10.typeMoney}}</text>
@@ -310,7 +316,8 @@
             <view class="list-label">商品合计</view>
           </view>
           <view class="list-cell-ft">
-            <text class="txt">共{{goodsTotalByType10}}件商品  总计¥{{goodsTotalPrice10}} <text wx:if="{{checkedCoupon10||campMinusDto10}}" class="txt">优惠后价格<text style='color:#b4282d;font-size:24rpx'>¥{{actualPrice10}}</text></text></text>
+            <text class="txt">共{{goodsTotalByType10}}件商品  总计¥{{goodsTotalPrice10}} <text wx:if="{{checkedCoupon10||campMinusDto10}}" class="txt">优惠后价格<text style='color:#b4282d;font-size:24rpx'>¥{{actualPrice10}}</text></text>
+            </text>
           </view>
         </view>
         <view class="list-cell" wx:if="{{campMinusDto10.campMinusId > 0}}" bindtap="hideSwitchTicketPop">
@@ -354,7 +361,8 @@
           <view class="info">
             <view class="t">
               <view class="name">
-                {{item.goods_name}}</view>
+                <text class='camps' style='color:white'wx:if="{{item.isCamp}}">满减</text> <text class='camps' style='color:white;margin-left:4rpx;'wx:if="{{item.isDiscount}}">优惠</text>{{item.goods_name}}
+              </view>
               <text class="number">x{{item.number}}</text>
             </view>
             <!-- <view class="m">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}</view> -->
@@ -383,7 +391,7 @@
         <!-- 促销、优惠券、总金额、运费start -->
         <view class="list-cell-checked" bindtap="selectCamp" data-goods-type="11" wx:if="{{campList11.length > 0}}">
           <view class="list-cell-checked-bd">
-            <text wx:if="{{campMinusDto11.campMinusId!=0}}" class="name">促销:{{campMinusDto11.campMinusType==00?'满元减:':''}}{{campMinusDto11.campMinusType==01?'满件减:':''}}{{campMinusDto11.campMinusType==10?'满元折:':''}}{{campMinusDto11.campMinusType==11?'满件折:':''}}{{campMinusDto11.campName}}</text>
+            <text wx:if="{{campMinusDto11.campMinusId!=0}}" class="name">促销:{{campMinusDto11.campMinusType==00?'满元减:':''}}{{campMinusDto11.campMinusType==01?'满件减:':''}}{{campMinusDto11.campMinusType==10?'满元折:':''}}{{campMinusDto11.campMinusType==11?'满件折:':''}}{{campMinusDto11.campName}}<text style='font-size:22rpx'>{{campMinusDto11.applyType!=00?'(部分商品满减)':''}}</text></text>
             <text wx:if="{{campMinusDto11.campMinusId==0}}" class="name">促销:未选择</text>
           </view>
           <view class="list-cell-checked-ft router">
@@ -394,8 +402,8 @@
 
         <view class="list-cell-checked" bindtap="selectCoupon" data-goods-type="11" wx:if="{{couponList11.length > 0}}">
           <view class="list-cell-checked-bd">
-            <text wx:if="{{checkedCoupon11.id > 0}}" class="name">优惠券:{{checkedCoupon11.couponName}}</text>
-            <text wx:if="{{checkedCoupon11.id==0}}" class="name">优惠券:未选择</text>
+            <text wx:if="{{checkedCoupon11.id > 0}}" class="name">优惠券:{{checkedCoupon11.couponName}}<text style='font-size:22rpx'>{{checkedCoupon11.applyType!=00?'(部分商品优惠)':''}}</text></text>
+            <text wx:if="{{checkedCoupon11.id==0}}" class="name">优惠券未选择</text>
           </view>
           <view class="list-cell-checked-ft router">
             <text wx:if="{{checkedCoupon11.id > 0}}" class="money red-txt">{{checkedCoupon11.tickDiscType==01?'¥'+checkedCoupon11.typeMoney+'折':'-¥'+checkedCoupon11.typeMoney}}</text>
@@ -407,7 +415,8 @@
             <view class="list-label">商品合计</view>
           </view>
           <view class="list-cell-ft">
-            <text class="txt">共{{goodsTotalByType11}}件商品  总计¥{{goodsTotalPrice11}} <text wx:if="{{checkedCoupon11||campMinusDto11}}" class="txt">优惠后价格<text style='color:#b4282d;font-size:24rpx'>¥{{actualPrice11}}</text></text></text>
+            <text class="txt">共{{goodsTotalByType11}}件商品  总计¥{{goodsTotalPrice11}} <text wx:if="{{checkedCoupon11||campMinusDto11}}" class="txt">优惠后价格<text style='color:#b4282d;font-size:24rpx'>¥{{actualPrice11}}</text></text>
+            </text>
           </view>
         </view>
         <view class="list-cell" wx:if="{{campMinusDto11.campMinusId > 0}}" bindtap="hideSwitchTicketPop">

+ 14 - 1
wx-mall/pages/shopping/checkout/checkout.wxss

@@ -157,7 +157,7 @@ white-space: nowrap;
   height: 29rpx;
   overflow: hidden;
   line-height: 29rpx;
-  margin-bottom: 25rpx;
+  /* margin-bottom: 25rpx; */
   font-size: 24rpx;
   color: #666;
 }
@@ -568,4 +568,17 @@ white-space: nowrap;
   flex: 1;
   text-align: center;
   color: #fff;
+}
+.camp{
+  color: #fff;
+  font-size: 24rpx;
+  background: #da6468;
+  border-radius: 8rpx;
+}
+.camps{
+  color:#fff;
+  background: #d81e06;
+  border-radius: 8rpx;
+  font-size: 20rpx;
+  float:left;
 }

+ 20 - 21
wx-mall/pages/ucenter/order/order.wxml

@@ -12,7 +12,7 @@
       <navigator class="list-cell" url="../orderDetail/orderDetail?id={{item.id}}&&tabIndex={{tabIndex}}&&isRefundStatus={{item.isRefundStatus}}&&refundStatus={{item.refundStatus}}&&approvalRemark={{item.approvalRemark}}">
         <view class="list-cell-bd">
           <view class="list-label" style="color: #FE7200;">
-            
+
             <image wx:if="{{item.orderBizType==00}}" src="../../../static/images/service-bao.png" class="search-icon-shop"></image>
             <text class="biz-type" wx:if="{{item.orderBizType==00}}">{{item.merchName}}{{item.storeName}} - 保税仓 </text>
             <image wx:if="{{item.orderBizType==02}}" src="../../../static/images/service-zs.png" class="search-icon-shop"></image>
@@ -20,9 +20,9 @@
             <image wx:if="{{item.orderBizType==10}}" src="../../../static/images/service-ziti.png" class="search-icon-shop"></image>
             <text class="biz-type" wx:if="{{item.orderBizType==10}}">{{item.merchName}}{{item.storeName}} - 现场速递</text>
             <image wx:if="{{item.orderBizType==11}}" src="../../../static/images/service-ptsp.png" class="search-icon-shop"></image>
-            <text class="biz-type" wx:if="{{item.orderBizType==11}}">{{item.merchName}}{{item.storeName}} - 普通商品</text> 
-            
-            <!-- <text class="add_time">{{item.add_time}}{{orderList[0].id}}</text> -->            
+            <text class="biz-type" wx:if="{{item.orderBizType==11}}">{{item.merchName}}{{item.storeName}} - 普通商品</text>
+
+            <!-- <text class="add_time">{{item.add_time}}{{orderList[0].id}}</text> -->
             <text class="add_time" wx:if="{{tabIndex!=5}}">{{tabIndex!=5 && item.order_status != 401 && item.pay_status!=7 && item.pay_status!=8?item.order_status_text:""}}{{item.order_status == 201 && item.isRefundStatus?"(维权申请中)":""}}{{item.pay_status==7?"订单关闭":""}}{{item.pay_status==8?"支付失败":""}}{{item.refundStatus==3?'-退款申请被拒绝':''}}
             </text>
             <text class="add_time" wx:if="{{tabIndex!=5 && item.order_status==401}}">{{item.pay_status==3 && item.order_status==401?'退款中':""}}{{item.pay_status==4 && item.order_status == 401?"已退款":""}}{{item.pay_status==5 && item.order_status == 401?"退款关闭":""}}{{item.pay_status==6 && item.order_status == 401?"退款异常":""}}
@@ -33,36 +33,34 @@
 
         </view>
       </navigator>
-      <view class="list-cell">
-        <view class="list-cell-hd order-image-hd">
-          <navigator url="../orderDetail/orderDetail?id={{item.id}}&&tabIndex={{tabIndex}}&&isRefundStatus={{item.isRefundStatus}}&&refundStatus={{item.refundStatus}}&&approvalRemark={{item.approvalRemark}}">
-            <image class="order-image" src="{{item.goodsList[0].list_pic_url}}"></image>
-          </navigator>
-        </view>
-        <view class="list-cell-bd">
-          <navigator url="../orderDetail/orderDetail?id={{item.id}}&&tabIndex={{tabIndex}}&&isRefundStatus={{item.isRefundStatus}}&&refundStatus={{item.refundStatus}}&&approvalRemark={{item.approvalRemark}}">
+      <navigator url="../orderDetail/orderDetail?id={{item.id}}&&tabIndex={{tabIndex}}&&isRefundStatus={{item.isRefundStatus}}&&refundStatus={{item.refundStatus}}&&approvalRemark={{item.approvalRemark}}">
+        <view class="list-cell2" wx:if="{{ index < 4 }}" wx:for="{{item.goodsList}}" wx:for-item="cell" wx:key="{{index}}">
+          <view class="list-cell-hd order-image-hd">
+            <image class="order-image" src="{{cell.list_pic_url}}"></image>
+          </view>
+          <view class="list-cell-bd">
             <view class="order-details">
-              <view class="order-details-cell" wx:if="{{ index < 4 }}" wx:for="{{item.goodsList}}" wx:for-item="cell" wx:key="{{index}}">
+              <view class="order-details-cell">
                 <text class="name">{{cell.goods_name}}</text>
                 <text class="num">x{{cell.number}}</text>
               </view>
               <view wx:if="{{ item.goodsList.length > 4 }}" class="order-details-cell">
                 <text>...</text>
               </view>
-              <view class="order-details-cell">
-                <text style="margin-left: auto;">共{{item.goodsCount}},实付<text class="price">¥{{item.actual_price}}</text></text>
+              <view class="order-details-cell" wx:if="{{(index+1)==item.goodsList.length}}">
+                <text style="margin-left: auto;">共{{item.goodsCount}}件商品,实付<text class="price">¥{{item.actual_price}}</text></text>
               </view>
             </view>
-          </navigator>
+          </view>
         </view>
-      </view>
+      </navigator>
       <!-- 订单配送中 -->
       <!-- <view class="list-cell" wx:if="{{item.order_status==300}}">
         <map id="map" longitude="{{item.markers[0].longitude}}" latitude="{{item.markers[0].latitude}}" show-location include-points markers="{{item.markers}}" style="width: 100%; height: 30vh;z-index: 600"></map>
       </view> -->
-      
+
       <view class="list-cell-tk" wx:if="{{tabIndex ==5 && (item.order_status == 401 || item.order_status == 402)}}">
-      <image src="../../../static/images/service-tk.png" class="search-icon-shop3"></image>
+        <image src="../../../static/images/service-tk.png" class="search-icon-shop3"></image>
         <text style='font-size: 26rpx;margin-left:5rpx'>
         {{item.order_status == 401?"仅退款 退款成功":""}}
         {{item.order_status == 402?"退货退款 退款成功":""}}
@@ -74,7 +72,7 @@
         </text>
       </view> -->
       <view class="list-cell-check" wx:if="{{item.buyerPayCheck == 2}}">
-      <image src="../../../static/images/service-jg.png" class="search-icon-shop2"></image>
+        <image src="../../../static/images/service-jg.png" class="search-icon-shop2"></image>
         <text class='names'>
         您的订付人身份证姓名不一致
         </text>
@@ -85,7 +83,8 @@
           <button wx:if="{{tabIndex != 5}}" class="{{item.orderBizType==00 && currentStoreId == item.store_id?'btn':'btn-disabel'}}" data-order-id="{{item.id}}" data-goods-type="{{item.orderBizType}}" data-is-Store='{{currentStoreId == item.store_id}}' catchtap="{{item.orderBizType==00 && currentStoreId == item.store_id ?'againBuy':'againBuyDisabel'}}">再来一单</button>
           <button class="btn" wx:if="{{item.order_status==300 && tabIndex != 5}}" data-shipping-No="{{item.shipping_no}}" data-shipping-Code="{{item.shipping_code}}" data-order-id="{{item.id}}" data-goods-type="{{item.orderBizType}}" catchtap="getWuliuList">查看物流</button>
           <button class="btn" data-actual-price="{{item.actual_price}}" data-order-id="{{item.id}}" data-order-index="{{index}}" catchtap="payOrder" wx:if="{{item.handleOption.pay && item.dateformat && tabIndex != 5}}">去付款 {{item.dateformat.min}}{{item.dateformat?':':''}}{{item.dateformat.sec}}</button>
-          <button wx:if="{{item.order_status==201 && tabIndex != 5 && !item.isRefundStatus}}" class="btn" data-order-Id="{{item.id}}" data-actual-Price="{{item.actual_price}}" data-merch-Order-Sn="{{item.merchOrderSn}}" data-is-Store='{{currentStoreId == item.store_id}}' catchtap="applyRefund">申请维权</button>
+          <button wx:if="{{item.order_status==201 && tabIndex != 5 && !item.isRefundStatus}}" class="btn" data-order-Id="{{item.id}}" data-actual-Price="{{item.actual_price}}" data-merch-Order-Sn="{{item.merchOrderSn}}" data-is-Store='{{currentStoreId == item.store_id}}'
+            catchtap="applyRefund">申请维权</button>
         </view>
       </view>
     </view>

+ 63 - 52
wx-mall/pages/ucenter/order/order.wxss

@@ -10,53 +10,52 @@ page {
   overflow: hidden;
 }
 
-.add_time{
+.add_time {
   font-size: 0.9em;
-  color:#d81e06;
+  color: #d81e06;
   float: right;
   margin-top: 8rpx;
-
 }
 
-.order-details-cell{
+.order-details-cell {
   display: flex;
   padding: 20rpx 30rpx;
   padding-right: 0;
 }
 
-.order-details-cell text{
-  font-size: .9em;
+.order-details-cell text {
+  font-size: 0.9em;
 }
 
-.order-details-cell .name{
+.order-details-cell .name {
   flex: 1;
 }
 
-.order-details-cell .num{
+.order-details-cell .num {
   margin-left: auto;
   width: 50rpx;
   text-align: right;
 }
 
-.order-details-cell .price{
+.order-details-cell .price {
   font-size: 1.1em;
   color: #000;
 }
 
-.order-image-hd{
+.order-image-hd {
   align-self: flex-start;
 }
 
-.order-image{
-  width: 146rpx;
-  height:146rpx;
+.order-image {
+  width: 130rpx;
+  height: 130rpx;
 }
 
-.btn-box{
+.btn-box {
   margin-left: auto;
 }
 
-.btn-box .btn{
+.btn-box .btn {
   border: 1px solid #d81e06;
   color: #d81e06;
   border-radius: 30rpx;
@@ -67,7 +66,8 @@ page {
   /* padding: 10rpx 20rpx; */
   background-color: #fff;
 }
-.btn-box .btn-disabel{
+
+.btn-box .btn-disabel {
   border: 1px solid rgb(150, 149, 149);
   color: rgb(136, 135, 134);
   border-radius: 30rpx;
@@ -77,35 +77,35 @@ page {
   line-height: 1.6;
   /* padding: 10rpx 20rpx; */
   background-color: #fff;
-  
 }
-.tab-bar{
+
+.tab-bar {
   height: 8vh;
   display: flex;
   line-height: 8vh;
   background-color: #fff;
-  position:fixed;
-  top:0px;
-  z-index:999;
-  width:100%;
-
+  position: fixed;
+  top: 0px;
+  z-index: 999;
+  width: 100%;
 }
-.tab-bar .tab-bar-item{
+
+.tab-bar .tab-bar-item {
   flex: 1;
   text-align: center;
   color: #555;
   font-size: 30rpx;
 }
-.tab-bar .tab-bar-item.active{
-  color: #FF5778;
-  border-bottom: 1px solid #FF5778;
+
+.tab-bar .tab-bar-item.active {
+  color: #ff5778;
+  border-bottom: 1px solid #ff5778;
 }
 
-.biz-type{
-  font-size:25rpx;
+.biz-type {
+  font-size: 25rpx;
   padding-left: 10rpx;
-  /* color: white; */
-  /* background-color: red; */
+  /* color: white; *//* background-color: red; */
   font-weight: bold;
   height: 40rpx;
 }
@@ -117,16 +117,18 @@ page {
   margin-top: 20rpx; */
   margin-bottom: -8rpx;
 }
-.list-cell-tk{
+
+.list-cell-tk {
   position: relative;
   display: flex;
   align-items: center;
-  height:40rpx;
-  margin-bottom:10px;
-  margin-left:512rpx;
+  height: 40rpx;
+  margin-bottom: 10px;
+  margin-left: 512rpx;
 }
-.list-cell-wq{
-  padding:5px 20px;
+
+.list-cell-wq {
+  padding: 5px 20px;
   position: relative;
   display: flex;
   align-items: center;
@@ -134,32 +136,41 @@ page {
   height: 0rpx;
   line-height: 0rpx;
   /* margin-left:550rpx; */
-  margin-bottom:10px;
+  margin-bottom: 10px;
 }
-.list-cell-wq .names{
-  font-size:14px;
+
+.list-cell-wq .names {
+  font-size: 14px;
 }
+
 .list-cell-check {
   position: relative;
   display: flex;
-  align-items:flex-end;
+  align-items: flex-end;
   height: 30rpx;
   bottom: 8rpx;
-  justify-content:flex-end;
+  justify-content: flex-end;
   width: 98%;
 }
-.list-cell-check .names{
-  font-size:12px;
-  margin-left:5rpx;
-  color:#FE7200;
+
+.list-cell-check .names {
+  font-size: 12px;
+  margin-left: 5rpx;
+  color: #fe7200;
 }
 
 .search-icon-shop2 {
-  width:30rpx;
-  height:30rpx;
+  width: 30rpx;
+  height: 30rpx;
 }
+
 .search-icon-shop3 {
-  width:28rpx;
-  height:28rpx;
-  vertical-align:middle;
-}
+  width: 28rpx;
+  height: 28rpx;
+  vertical-align: middle;
+}
+
+.list-cell2 {
+  padding: 4rpx 30rpx;
+  display: flex;
+}

+ 54 - 38
wx-mall/pages/ucenter/orderDetail/orderDetail.wxml

@@ -2,14 +2,10 @@
   <view class="order-info2" wx:if="{{wuliu}}">
     <view class="list-cell">
       <view class="list-cell-bd2">
-        <view class="list-label strong2"><image src="../../../static/images/service-jyjl.png" class="icon"></image>
-        {{orderInfo.order_status==0?"待付款":""}}
-        {{orderInfo.order_status==100?"订单付款中":""}}
-        {{orderInfo.order_status==101?"订单已取消":""}}
-        {{orderInfo.order_status==201?"订单已付款":""}}
-        {{orderInfo.order_status==300?"订单已发货":""}}
-        {{orderInfo.order_status==301?"确认收货":""}}
-        {{orderInfo.order_status==401 || orderInfo.order_status==402?"订单已退款":""}}
+        <view class="list-label strong2">
+          <image src="../../../static/images/service-jyjl.png" class="icon"></image>
+          {{orderInfo.order_status==0?"待付款":""}} {{orderInfo.order_status==100?"订单付款中":""}} {{orderInfo.order_status==101?"订单已取消":""}} {{orderInfo.order_status==201?"订单已付款":""}} {{orderInfo.order_status==300?"订单已发货":""}} {{orderInfo.order_status==301?"确认收货":""}}
+          {{orderInfo.order_status==401 || orderInfo.order_status==402?"订单已退款":""}}
         </view>
       </view>
     </view>
@@ -17,12 +13,7 @@
       <view class="list-cell">
         <view class="list-cell-bd">
           <view class="list-label week3">
-            {{orderInfo.order_status==0?"您的订单待付款":""}}
-            {{orderInfo.order_status==101?"您的订单已取消":""}}
-            {{orderInfo.order_status==100?"您的订单正在付款中":""}}
-            {{orderInfo.order_status==201?"您的订单已付款":""}}
-            {{orderInfo.order_status==300?"您的订单已发货":""}}   
-            {{orderInfo.order_status==301?"用户已确认收货":""}}
+            {{orderInfo.order_status==0?"您的订单待付款":""}} {{orderInfo.order_status==101?"您的订单已取消":""}} {{orderInfo.order_status==100?"您的订单正在付款中":""}} {{orderInfo.order_status==201?"您的订单已付款":""}} {{orderInfo.order_status==300?"您的订单已发货":""}} {{orderInfo.order_status==301?"用户已确认收货":""}}
             {{orderInfo.order_status==401 || orderInfo.order_status==402?"您的订单已退款":""}}
           </view>
           <view class="list-label week3" wx:if="{{orderInfo.order_status==201 && refundStatus == 3}}">
@@ -35,7 +26,7 @@
       </view>
     </view>
     <view>
-    <view class="list-cell" wx:if="{{orderInfo.order_status==0}}" >
+      <view class="list-cell" wx:if="{{orderInfo.order_status==0}}">
         <view class="list-cell-bd">
           <view class="list-label week3">
             您的订单已提交,请在{{orderInfo.dateformat.min}}{{orderInfo.dateformat?':':''}}{{orderInfo.dateformat.sec}}内完成支付,超时订单自动取消</view>
@@ -45,7 +36,7 @@
     <navigator open-type='navigate' wx:if="{{orderInfo.order_status==300 || orderInfo.order_status==301}}" url="/pages/ucenter/wuliu/wuliu?id={{orderInfo.shipping_no}}&code={{orderInfo.shipping_code}}&orderId={{orderInfo.id}}&goodsType={{orderInfo.orderBizType}}">
       <view class="list-cell">
         <view class="list-cell-bd">
-          <view class="list-label week3">物流信息:  {{wuliu.AcceptTime}}</view>
+          <view class="list-label week3">物流信息: {{wuliu.AcceptTime}}</view>
         </view>
       </view>
       <view class="list-cell">
@@ -56,7 +47,8 @@
     </navigator>
   </view>
   <view class="order-info">
-    <view class="item-a"><image src="../../../static/images/service-hsdz.png" class="icon"></image> {{orderInfo.consignee}}     {{orderInfo.mobile}}</view>
+    <view class="item-a">
+      <image src="../../../static/images/service-hsdz.png" class="icon"></image> {{orderInfo.consignee}} {{orderInfo.mobile}}</view>
     <view class="item-b2">收货地址:{{orderInfo.province}}{{orderInfo.city}}{{orderInfo.district}}{{orderInfo.address}}</view>
   </view>
 
@@ -69,24 +61,42 @@
     <view class="list-cell">
       <view class="goods-list">
         <view wx:for="{{orderGoods}}" wx:key="{{index}}" class="goods-list-cell">
-          <view wx:if ='{{currentStoreId != orderInfo.store_id || (orderInfo.orderBizType ==02 || orderInfo.orderBizType == 10)}}'>
-            <image class="order-image" src="{{item.list_pic_url}}"></image>
-            <text class="name">{{item.goods_name}}</text>
-            <text class="num fr">x{{item.number}}</text>
-            <text class="price fr">¥{{item.retail_price}}</text>
+          <view wx:if='{{currentStoreId != orderInfo.store_id || (orderInfo.orderBizType ==02 || orderInfo.orderBizType == 10)}}'>
+            <view style='width:100rpx;float:left;'><image class="order-image" src="{{item.list_pic_url}}"></image></view>
+            <view style='width:500rpx;float:left;'>
+              <text class="name">{{item.goods_name}}</text>
+              <text class='attr'>{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}</text>
+            </view>
+            <view style='float:left;width:50rpx;'>
+              <text class="price fr">¥{{item.retail_price}}</text>
+              <text class="num fr">x{{item.number}}</text>
+            </view>
           </view>
-          <navigator open-type='navigate' wx:if = '{{currentStoreId == orderInfo.store_id && (orderInfo.orderBizType ==00 || orderInfo.orderBizType == 11)}}' url='/pages/goods/goods?id={{item.goods_id}}&&storeId={{item.storeId}}'>
-            <image class="order-image" src="{{item.list_pic_url}}"></image>
-            <text class="name">{{item.goods_name}}</text>
-            <text class="num fr">x{{item.number}}</text>
-            <text class="price fr">¥{{item.retail_price}}</text>
+          <navigator open-type='navigate' wx:if='{{currentStoreId == orderInfo.store_id && (orderInfo.orderBizType ==00 || orderInfo.orderBizType == 11)}}' url='/pages/goods/goods?id={{item.goods_id}}&&storeId={{item.storeId}}'>
+            <view style='width:100rpx;float:left;'><image class="order-image" src="{{item.list_pic_url}}"></image></view>
+            <view style='width:500rpx;float:left;'>
+              <view style='width:600rpx;'><text class='camps' style='color:white' wx:if="{{item.campTopicId}}">满减</text><text class='camps' style='color:white' wx:if="{{item.distcountTopicId}}">优惠</text><text class="name">{{item.goods_name}}</text></view>
+              <view><text class='attr'>{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}</text></view>
+            </view>
+            <view style='float:left;width:50rpx;'>
+              <text class="price fr">¥{{item.retail_price}}</text>
+              <text class="num fr">x{{item.number}}</text>
+            </view>
           </navigator>
         </view>
       </view>
     </view>
     <view class="list-cell">
       <view class="list-cell-bd">
-        <view class="list-label week">配送费</view>
+        <view class="list-label week">商品总价</view>
+      </view>
+      <view class="list-cell-ft week">
+        ¥{{orderInfo.goods_price}}
+      </view>
+    </view>
+    <view class="list-cell">
+      <view class="list-cell-bd">
+        <view class="list-label week">运费</view>
       </view>
       <view class="list-cell-ft week">
         ¥{{orderInfo.freight_price}}
@@ -94,7 +104,9 @@
     </view>
     <view class="list-cell" wx:if="{{orderInfo.full_cut_price}}">
       <view class="list-cell-bd">
-        <view class="list-label week orange">满减:<text class='orange'>{{orderInfo.campName}}</text></view>
+        <view class="list-label week ">满减:
+          <text class='orange'>{{orderInfo.campName}}{{orderInfo.applyType!='00'?'(部分商品减)':''}}</text>
+        </view>
       </view>
       <view class="list-cell-ft week orange">
         -¥{{orderInfo.full_cut_price}}
@@ -102,7 +114,9 @@
     </view>
     <view class="list-cell" wx:if="{{orderInfo.coupon_price}}">
       <view class="list-cell-bd">
-        <view class="list-label week ">优惠券:<text class='orange'>{{orderInfo.coupon_name}}</text></view>
+        <view class="list-label week ">优惠券:
+          <text class='orange'>{{orderInfo.coupon_name}}{{orderInfo.discountApplyType!='00'?'(部分商品减)':''}}</text>
+        </view>
       </view>
       <view class="list-cell-ft week orange">
         -¥{{orderInfo.coupon_price}}
@@ -112,11 +126,11 @@
       <view class="list-cell-bd">
       </view>
       <view class="list-cell-ft week">
-        合计
+        实付款(含运费)
         <text class="orange">¥{{orderInfo.actual_price}}</text>
-        <!-- <view class="refund" wx:if="{{ orderInfo.order_status == 201 }}" bindtap="refund">退款</view> --> 
-            <view class="refund"  wx:if='{{ orderInfo.order_status==201 && isRefundStatus =="true"}}'>维权申请中</view>      
-        
+        <!-- <view class="refund" wx:if="{{ orderInfo.order_status == 201 }}" bindtap="refund">退款</view> -->
+        <view class="refund" wx:if='{{ orderInfo.order_status==201 && isRefundStatus =="true"}}'>维权申请中</view>
+
       </view>
     </view>
   </view>
@@ -125,13 +139,15 @@
     <view class="item-a">下单时间:{{orderInfo.add_time}}</view>
     <view class="item-a" wx:if="{{orderInfo.pay_time}}">付款时间:{{orderInfo.pay_time}}</view>
     <view class="item-a" wx:if="{{orderInfo.confirm_time}}">成交时间:{{orderInfo.confirm_time}}</view>
-    <view class="item-b">订单编号:{{orderInfo.order_sn}} <view style='font-size:26rpx;color:#d81e06;float:right;' bindtap="copyBtn">复制</view></view>
-    <view class="item-c">
+    <view class="item-b">订单编号:{{orderInfo.order_sn}}
+      <view style='font-size:26rpx;color:#d81e06;float:right;margin-right:30rpx;' bindtap="copyBtn">复制</view>
+    </view>
+    <!-- <view class="item-c">
       <view class="l">实付:
         <text class="cost">¥{{orderInfo.actual_price}}</text>
       </view>
       
-    </view>
+    </view> -->
   </view>
 
   <view class="order-info" wx:if="{{tabIndex == 5}}">
@@ -147,7 +163,7 @@
         <view class="list-label strong">送达信息</view>
       </view>
     </view>
-    <view class="list-cell"  wx:if="{{orderInfo.delivery_remark}}">
+    <view class="list-cell" wx:if="{{orderInfo.delivery_remark}}">
       <view class="list-cell-bd">
         <view class="list-label week">期望时间:{{orderInfo.delivery_remark}}</view>
       </view>

+ 66 - 18
wx-mall/pages/ucenter/orderDetail/orderDetail.wxss

@@ -7,6 +7,7 @@ page {
 .strong {
   font-size: 1em !important;
 }
+
 .week {
   font-size: 0.9em !important;
 }
@@ -14,8 +15,8 @@ page {
 .orange {
   color: #d81e06;
 }
-.orange2{
-  
+
+.orange2 {
   height: 40rpx;
   text-align: center;
   line-height: 40rpx;
@@ -92,7 +93,7 @@ page {
   background-color: #fff;
 }
 
-.goods-info .list-cell-ft{
+.goods-info .list-cell-ft {
   padding-right: 0;
 }
 
@@ -101,7 +102,9 @@ page {
 }
 
 .goods-list-cell {
-  /* padding: 20rpx 0; */
+  /* padding: 20rpx 0; *//* padding: 10rpx 10rpx; */
+  padding-right: 0rpx;
+  height:120rpx;
 }
 
 .goods-list-cell text {
@@ -109,13 +112,41 @@ page {
   color: #9b9b9b;
 }
 
+.goods-list-cell .name {
+  width: 470rpx;
+  font-size: 25rpx;
+  color: #333;
+  display: inline-block;
+  /* overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap; */
+}
+
 .goods-list-cell .price {
   padding-right: 20rpx;
+  color:black;
 }
 
 .fr {
-  float: right;
-  margin-top:40px;
+  margin-left: auto;
+  width: 50rpx;
+  text-align: right;
+}
+
+.attr {
+  margin-bottom: 17rpx;
+  height: 24rpx;
+  line-height: 24rpx;
+  font-size: 22rpx;
+  color: #666;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+
+.num {
+  padding-right: 20rpx;
+  padding-top: 57rpx;
 }
 
 .order-goods {
@@ -357,6 +388,7 @@ page {
   color: #666;
   margin-left: 38rpx;
 }
+
 .icon2 {
   width: 30rpx;
   height: 30rpx;
@@ -369,33 +401,39 @@ page {
   font-size: 0.95em !important;
   color: white;
 }
-.list-cell-bd2{
-  flex:1;
-  margin-top:-15px;
+
+.list-cell-bd2 {
+  flex: 1;
+  margin-top: -15px;
   color: white;
 }
+
 .order-info2 {
-  padding-top:20rpx;
-  background:rgb(126, 125, 125);
-  height:auto;
-  overflow:hidden;
+  padding-top: 20rpx;
+  background: rgb(126, 125, 125);
+  height: auto;
+  overflow: hidden;
   color: white;
   font-weight: bold;
 }
+
 .week2 {
   font-size: 0.9em !important;
   color: white;
 }
-.week3{
+
+.week3 {
   font-size: 0.9em !important;
   color: white;
   margin-left: 40rpx;
 }
-.week4{
+
+.week4 {
   font-size: 0.8em !important;
   color: white;
   margin-left: 40rpx;
 }
+
 .btns {
   position: fixed;
   bottom: 0;
@@ -442,6 +480,7 @@ page {
   display: block;
   width: 130rpx;
 }
+
 .list-group2 {
   margin-top: 0.6em;
   background-color: #fff;
@@ -451,10 +490,19 @@ page {
   position: relative;
   padding-bottom: 89rpx;
 }
-.order-image{
+
+.order-image {
   width: 100rpx;
-  height:100rpx;
+  height: 100rpx;
 }
-.name{
+
+.name {
   height: 40rpx;
 }
+.camps{
+  color:#fff;
+  background: #d81e06;
+  border-radius: 8rpx;
+  font-size: 20rpx;
+  float:left;
+}

+ 1 - 1
wx-mall/project.config.json

@@ -9,7 +9,7 @@
 		"uglifyFileName": true
 	},
 	"compileType": "miniprogram",
-	"libVersion": "2.6.6",
+	"libVersion": "2.7.2",
 	"appid": "wxb6b30b1b14ee502a",
 	"projectname": "wx-mall",
 	"simulatorType": "wechat",

+ 11 - 0
wx-mall/utils/util.js

@@ -204,6 +204,17 @@ function getLocation(callback) {
     success: function (res) {
       var latitude = res.latitude;
       var longitude = res.longitude;
+      console.log('latitude:'+latitude);
+      if (latitude == '' || longitude == ''){
+        wx.showModal({
+          title: '',
+          content: '请检查手机是否打开GPS',
+          success: function (res) {
+            if (res.confirm) {
+            }
+          }
+        })
+      }
       callback && callback(longitude, latitude)
     }
   })