Sfoglia il codice sorgente

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

黄亚琴 5 anni fa
parent
commit
4ff134eea1
90 ha cambiato i file con 2010 aggiunte e 747 eliminazioni
  1. 14 0
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderRefundController.java
  2. 6 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysOssController.java
  3. 2 0
      kmall-admin/src/main/java/com/kmall/admin/controller/mk/store/MkStoreCampMinusGoodsController.java
  4. 23 0
      kmall-admin/src/main/java/com/kmall/admin/dao/MerchUserDao.java
  5. 181 0
      kmall-admin/src/main/java/com/kmall/admin/entity/MerchUserEntity.java
  6. 0 10
      kmall-admin/src/main/java/com/kmall/admin/entity/StoreEntity.java
  7. 30 30
      kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java
  8. 9 6
      kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java
  9. 164 0
      kmall-admin/src/main/resources/mybatis/mapper/MerchUserDao.xml
  10. 17 11
      kmall-admin/src/main/resources/mybatis/mapper/OrderRefundDao.xml
  11. 3 7
      kmall-admin/src/main/resources/mybatis/mapper/StoreDao.xml
  12. 6 1
      kmall-admin/src/main/webapp/WEB-INF/page/mk/mkstorecampminus.html
  13. 12 2
      kmall-admin/src/main/webapp/WEB-INF/page/mk/mkstoreticketdiscount.html
  14. 2 2
      kmall-admin/src/main/webapp/WEB-INF/page/shop/ad.html
  15. 8 8
      kmall-admin/src/main/webapp/WEB-INF/page/shop/brand.html
  16. 4 4
      kmall-admin/src/main/webapp/WEB-INF/page/shop/category.html
  17. 8 8
      kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html
  18. 2 2
      kmall-admin/src/main/webapp/WEB-INF/page/shop/goodsgroup.html
  19. 1 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/goodsspecification.html
  20. 1 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/order.html
  21. 8 3
      kmall-admin/src/main/webapp/WEB-INF/page/shop/topic.html
  22. 1 1
      kmall-admin/src/main/webapp/WEB-INF/page/shop/topiccategory.html
  23. 42 5
      kmall-admin/src/main/webapp/WEB-INF/page/sys/main.html
  24. 2 2
      kmall-admin/src/main/webapp/js/mk/mkstorecampminus.js
  25. 1 1
      kmall-admin/src/main/webapp/js/mk/mkstoreticketdiscount.js
  26. 1 1
      kmall-admin/src/main/webapp/js/shop/ad.js
  27. 1 1
      kmall-admin/src/main/webapp/js/shop/brand.js
  28. 1 1
      kmall-admin/src/main/webapp/js/shop/category.js
  29. 8 2
      kmall-admin/src/main/webapp/js/shop/goods.js
  30. 1 1
      kmall-admin/src/main/webapp/js/shop/goodsgroup.js
  31. 1 1
      kmall-admin/src/main/webapp/js/shop/goodsspecification.js
  32. 10 1
      kmall-admin/src/main/webapp/js/shop/orderrefund.js
  33. 0 36
      kmall-admin/src/main/webapp/js/shop/storeProductStock.js
  34. 1 1
      kmall-admin/src/main/webapp/js/shop/topic.js
  35. 1 1
      kmall-admin/src/main/webapp/js/shop/topiccategory.js
  36. 10 1
      kmall-admin/src/main/webapp/js/statis/mkstoretopicstat.js
  37. 13 6
      kmall-api/src/main/java/com/kmall/api/api/ApiAuthController.java
  38. 15 5
      kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java
  39. 12 3
      kmall-api/src/main/java/com/kmall/api/api/ApiStoreCampMinusController.java
  40. 11 3
      kmall-api/src/main/java/com/kmall/api/api/ApiStoreTicketDiscountController.java
  41. 2 0
      kmall-api/src/main/java/com/kmall/api/dao/ApiMerchUserMapper.java
  42. 0 2
      kmall-api/src/main/java/com/kmall/api/dao/ApiStoreMapper.java
  43. 11 0
      kmall-api/src/main/java/com/kmall/api/dto/CampMinusDto.java
  44. 18 0
      kmall-api/src/main/java/com/kmall/api/dto/CheckOutDto.java
  45. 19 0
      kmall-api/src/main/java/com/kmall/api/dto/UserCouponDto.java
  46. 53 0
      kmall-api/src/main/java/com/kmall/api/entity/CartVo.java
  47. 10 0
      kmall-api/src/main/java/com/kmall/api/entity/MerchUserVo.java
  48. 30 0
      kmall-api/src/main/java/com/kmall/api/entity/OrderGoodsVo.java
  49. 20 0
      kmall-api/src/main/java/com/kmall/api/entity/OrderVo.java
  50. 10 0
      kmall-api/src/main/java/com/kmall/api/entity/ThirdMerchantBizVo.java
  51. 11 0
      kmall-api/src/main/java/com/kmall/api/entity/UserCouponVo.java
  52. 4 3
      kmall-api/src/main/java/com/kmall/api/entity/mk/MkStoreCampMinusVo.java
  53. 166 29
      kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java
  54. 3 0
      kmall-api/src/main/java/com/kmall/api/service/ApiMerchUserService.java
  55. 115 32
      kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java
  56. 0 3
      kmall-api/src/main/java/com/kmall/api/service/ApiStoreService.java
  57. 1 0
      kmall-api/src/main/java/com/kmall/api/service/ApiUserCouponService.java
  58. 37 26
      kmall-api/src/main/java/com/kmall/api/service/mk/ApiMkStoreCampMinusService.java
  59. 20 16
      kmall-api/src/main/java/com/kmall/api/service/mk/ApiMkStorePromStatService.java
  60. 21 0
      kmall-api/src/main/java/com/kmall/api/service/mk/ApiMkStoreTicketDiscountService.java
  61. 8 0
      kmall-api/src/main/resources/mybatis/mapper/ApiCartMapper.xml
  62. 1 1
      kmall-api/src/main/resources/mybatis/mapper/ApiGoodsMapper.xml
  63. 17 2
      kmall-api/src/main/resources/mybatis/mapper/ApiMerchUserMapper.xml
  64. 9 3
      kmall-api/src/main/resources/mybatis/mapper/ApiOrderGoodsMapper.xml
  65. 3 1
      kmall-api/src/main/resources/mybatis/mapper/ApiOrderMapper.xml
  66. 1 12
      kmall-api/src/main/resources/mybatis/mapper/ApiStoreMapper.xml
  67. 9 3
      kmall-api/src/main/resources/mybatis/mapper/mk/ApiMkStoreCampMinusMapper.xml
  68. 2 1
      wx-mall/app.json
  69. 5 5
      wx-mall/app.wxss
  70. 13 13
      wx-mall/pages/cart/cart.wxml
  71. 8 4
      wx-mall/pages/catalog/catalog.js
  72. 6 6
      wx-mall/pages/catalog/catalog.wxml
  73. 11 8
      wx-mall/pages/catalog/catalog.wxss
  74. 219 102
      wx-mall/pages/goods/goods.js
  75. 39 6
      wx-mall/pages/goods/goods.wxml
  76. 23 2
      wx-mall/pages/goods/goods.wxss
  77. 12 11
      wx-mall/pages/hotGoods/hotGoods.wxml
  78. 60 54
      wx-mall/pages/index/index.js
  79. 33 27
      wx-mall/pages/index/index.wxml
  80. 9 2
      wx-mall/pages/index/index.wxss
  81. 4 0
      wx-mall/pages/pay/pay.js
  82. 76 53
      wx-mall/pages/shopping/checkout/checkout.js
  83. 29 20
      wx-mall/pages/shopping/checkout/checkout.wxml
  84. 14 1
      wx-mall/pages/shopping/checkout/checkout.wxss
  85. 20 21
      wx-mall/pages/ucenter/order/order.wxml
  86. 63 52
      wx-mall/pages/ucenter/order/order.wxss
  87. 54 38
      wx-mall/pages/ucenter/orderDetail/orderDetail.wxml
  88. 66 18
      wx-mall/pages/ucenter/orderDetail/orderDetail.wxss
  89. 1 1
      wx-mall/project.config.json
  90. 11 0
      wx-mall/utils/util.js

+ 14 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/OrderRefundController.java

@@ -40,6 +40,8 @@ public class OrderRefundController {
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
         ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
+        params.put("sidx", "mod_time");
+        params.put("order", "desc");
         //查询列表数据
         Query query = new Query(params);
 
@@ -59,6 +61,18 @@ public class OrderRefundController {
     }
 
     /**
+     * 总计
+     */
+    @RequestMapping("/queryTotal")
+    @ResponseBody
+    public R queryTotal(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
+        int total = orderRefundService.queryTotal(params);
+
+        return R.ok().put("sum", total);
+    }
+
+    /**
      * 查看信息
      */
     @RequestMapping("/info/{id}")

+ 6 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SysOssController.java

@@ -109,6 +109,12 @@ public class SysOssController {
         }
 //        String name = file.getOriginalFilename();
 //        Thumbnails.of(name).size(200, 200).keepAspectRatio(false).allowOverwrite(true).toFile(name);
+        int AllowImgFileSize=0; //允许上传图片文件的大小 0为无限制 单位:KB
+        Long size = file.getSize();
+        int ImgFileSize=Math.round(size/1024*100)/100;//取得图片文件的大小
+        if(ImgFileSize > 200){
+            throw new RRException("上传图片,不能超过 300k");
+        }
         //上传文件
         String url = FileManager.upload(file);
 

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/mk/store/MkStoreCampMinusGoodsController.java

@@ -5,6 +5,7 @@ import java.util.Map;
 
 import com.kmall.admin.entity.mk.store.MkStoreCampMinusGoodsEntity;
 import com.kmall.admin.service.mk.store.MkStoreCampMinusGoodsService;
+import com.kmall.admin.utils.ParamUtils;
 import com.kmall.common.utils.PageUtils;
 import com.kmall.common.utils.Query;
 import com.kmall.common.utils.R;
@@ -46,6 +47,7 @@ public class MkStoreCampMinusGoodsController {
     @ResponseBody
     public R queryCampMinusGoodsByIdList(@RequestParam Map<String, Object> params) {
         //查询列表数据
+        ParamUtils.setName(params, "goodsName");
         Query query = new Query(params);
         List<MkStoreCampMinusGoodsEntity> mkStoreCampMinusGoodsList = mkStoreCampMinusGoodsService.queryCampMinusGoodsByIdList(query);
         int total = mkStoreCampMinusGoodsService.queryCampMinusGoodsByIdTotal(query);

+ 23 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/MerchUserDao.java

@@ -0,0 +1,23 @@
+package com.kmall.admin.dao;
+
+
+import com.kmall.admin.entity.MerchUserEntity;
+import com.kmall.manager.dao.BaseDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Dao
+ *
+ * @author huangyq
+ * @email admin@qhdswl.com
+ * @date 2018-12-05 14:34:32
+ */
+public interface MerchUserDao extends BaseDao<MerchUserEntity> {
+    MerchUserEntity queryObjectByStoreId(@Param("storeId") Long storeId, @Param("userId") Long userId);
+
+    List<MerchUserEntity> queryMerchUserByLoadGoods(@Param("storeId") Long storeId);
+
+    Integer updateStoreLoadGoodsById(MerchUserEntity merchUserEntity);
+}

+ 181 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/MerchUserEntity.java

@@ -0,0 +1,181 @@
+package com.kmall.admin.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 实体
+ * 表名 mall_merch_user
+ *
+ * @author huangyq
+ * @email admin@qhdswl.com
+ * @date 2018-12-05 14:34:32
+ */
+public class MerchUserEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Integer id;
+    /**
+     * 商户编号
+     */
+    private String merchSn;
+    /**
+     * 门店编号
+     */
+    private Integer storeId;
+    /**
+     * 用户编号
+     */
+    private Integer userId;
+    /**
+     * 创建人编号
+     */
+    private String createrSn;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改人编号
+     */
+    private String moderSn;
+    /**
+     * 修改时间
+     */
+    private Date modTime;
+    /**
+     * 时间戳
+     */
+    private Date tstm;
+
+    private String isLoadGoods;
+
+    public String getIsLoadGoods() {
+        return isLoadGoods;
+    }
+
+    public void setIsLoadGoods(String isLoadGoods) {
+        this.isLoadGoods = isLoadGoods;
+    }
+
+    /**
+     * 设置:主键
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取:主键
+     */
+    public Integer getId() {
+        return id;
+    }
+    /**
+     * 设置:商户编号
+     */
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
+    /**
+     * 获取:商户编号
+     */
+    public String getMerchSn() {
+        return merchSn;
+    }
+    /**
+     * 设置:门店编号
+     */
+    public void setStoreId(Integer storeId) {
+        this.storeId = storeId;
+    }
+
+    /**
+     * 获取:门店编号
+     */
+    public Integer getStoreId() {
+        return storeId;
+    }
+    /**
+     * 设置:用户编号
+     */
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    /**
+     * 获取:用户编号
+     */
+    public Integer getUserId() {
+        return userId;
+    }
+    /**
+     * 设置:创建人编号
+     */
+    public void setCreaterSn(String createrSn) {
+        this.createrSn = createrSn;
+    }
+
+    /**
+     * 获取:创建人编号
+     */
+    public String getCreaterSn() {
+        return createrSn;
+    }
+    /**
+     * 设置:创建时间
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * 获取:创建时间
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+    /**
+     * 设置:修改人编号
+     */
+    public void setModerSn(String moderSn) {
+        this.moderSn = moderSn;
+    }
+
+    /**
+     * 获取:修改人编号
+     */
+    public String getModerSn() {
+        return moderSn;
+    }
+    /**
+     * 设置:修改时间
+     */
+    public void setModTime(Date modTime) {
+        this.modTime = modTime;
+    }
+
+    /**
+     * 获取:修改时间
+     */
+    public Date getModTime() {
+        return modTime;
+    }
+    /**
+     * 设置:时间戳
+     */
+    public void setTstm(Date tstm) {
+        this.tstm = tstm;
+    }
+
+    /**
+     * 获取:时间戳
+     */
+    public Date getTstm() {
+        return tstm;
+    }
+}

+ 0 - 10
kmall-admin/src/main/java/com/kmall/admin/entity/StoreEntity.java

@@ -82,16 +82,6 @@ public class StoreEntity implements Serializable {
 
     private String isValid;
 
-    private String isLoadGoods;
-
-    public String getIsLoadGoods() {
-        return isLoadGoods;
-    }
-
-    public void setIsLoadGoods(String isLoadGoods) {
-        this.isLoadGoods = isLoadGoods;
-    }
-
     public String getIsValid() {
         return isValid;
     }

+ 30 - 30
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -56,6 +56,8 @@ public class GoodsServiceImpl implements GoodsService {
     private ThirdMerchantBizDao thirdMerchantBizDao;
     @Autowired
     private MngChangeDao mngChangeDao;
+    @Autowired
+    private MerchUserDao merchUserDao;
 
     @Override
     public GoodsEntity queryObject(Integer id) {
@@ -335,20 +337,6 @@ public class GoodsServiceImpl implements GoodsService {
         if (galleryEntityList == null || galleryEntityList.size() <= 0) {
             throw new RRException("至少保留一张商品轮播图!");
         }
-        List<ProductStoreRelaEntity> proStoreList = productStoreRelaDao.queryByGoodsId(goodsEntity.getId());
-        Long[] storeIds = new Long[proStoreList.size()];
-        if(goodsEntity.getIsStockShare().equalsIgnoreCase(Dict.isStockShare.item_0.getItem())) {
-            Integer goodsNumber = goods.getGoodsNumber();//商品总库存
-            Integer storeTotalGoodsNumber = 0;//商品分配库存
-            for (int i = 0; i < proStoreList.size(); i++) {
-                ProductStoreRelaEntity relaEntity = proStoreList.get(i);
-                storeTotalGoodsNumber = storeTotalGoodsNumber + relaEntity.getStockNum();
-                storeIds[i] = relaEntity.getStoreId();
-            }
-            if (goodsNumber < storeTotalGoodsNumber) {
-                throw new RRException("该商品已在各门店分配库存" + storeTotalGoodsNumber + ",当前商品总库存不能小于分配库存总额!请先修改门店库存!");
-            }
-        }
 
         List<GoodsEntity> prodbarGoodsList = goodsDao.queryObjectByProdBarcode(goods.getProdBarcode(),goods.getMerchSn(),goods.getId());
         if(prodbarGoodsList != null && prodbarGoodsList.size() > 0){
@@ -412,9 +400,12 @@ public class GoodsServiceImpl implements GoodsService {
         goodsDao.update(goods);
 
         // 保税商品修改各个门店商品价格
-        List<ProductStoreRelaEntity> productStoreRelaEntityList = productStoreRelaDao.queryByGoodsId(goods.getId());
+        List<ProductStoreRelaEntity> productStoreRelaEntityList = productStoreRelaDao.queryByGoodsId(goodsEntity.getId());
+        Long[] storeIds = new Long[productStoreRelaEntityList.size()];
+        Integer goodsNumber = goods.getGoodsNumber();//商品总库存
+        Integer storeTotalGoodsNumber = 0;//商品分配库存
         if (productStoreRelaEntityList != null && productStoreRelaEntityList.size() > 0) {
-            for (ProductStoreRelaEntity productStoreRela : productStoreRelaEntityList) {
+            for (int i = 0; i < productStoreRelaEntityList.size(); i++) {
                 //修改该商品的所属商户信息,如在该商户门店中有该上架的商品信息,则提示该商品不能修改
                 /*if(org.apache.commons.lang3.StringUtils.isNotEmpty(productStoreRela.getMerchSn()) && productStoreRela.getMerchSn().equalsIgnoreCase(goods.getMerchSn())
                         && goods.getIsOnSale() == Integer.parseInt(Dict.isOnSale.item_1.getItem())) {
@@ -439,13 +430,21 @@ public class GoodsServiceImpl implements GoodsService {
                         throw new RRException("商品编码为【" + goods.getGoodsSn() + "】的商品已上架在商户编号为【" + productStoreRela.getMerchSn() + "】的门店中,可先将该商品下架后再进行修改!");
                     }
                 }*/
-                if(org.apache.commons.lang3.StringUtils.isNotEmpty(productStoreRela.getMerchSn()) && productStoreRela.getMerchSn().equalsIgnoreCase(goods.getMerchSn())
+                ProductStoreRelaEntity relaEntity = productStoreRelaEntityList.get(i);
+                if(org.apache.commons.lang3.StringUtils.isNotEmpty(relaEntity.getMerchSn()) && relaEntity.getMerchSn().equalsIgnoreCase(goods.getMerchSn())
                         && goods.getIsOnSale() == Integer.parseInt(Dict.isOnSale.item_1.getItem())) {
                 }else {
                     if (goods.getIsOnSale() != Integer.parseInt(Dict.isOnSale.item_0.getItem())) {
-                        throw new RRException("商品编码为【" + goods.getGoodsSn() + "】的商品已上架在商户编号为【" + productStoreRela.getMerchSn() + "】的门店中,可先将该商品下架后再进行修改!");
+                        throw new RRException("商品编码为【" + goods.getGoodsSn() + "】的商品已上架在商户编号为【" + relaEntity.getMerchSn() + "】的门店中,可先将该商品下架后再进行修改!");
                     }
                 }
+                storeTotalGoodsNumber = storeTotalGoodsNumber + relaEntity.getStockNum();
+                storeIds[i] = relaEntity.getStoreId();
+            }
+        }
+        if(goodsEntity.getIsStockShare().equalsIgnoreCase(Dict.isStockShare.item_0.getItem())) {
+            if (goodsNumber < storeTotalGoodsNumber) {
+                throw new RRException("该商品已在各门店分配库存" + storeTotalGoodsNumber + ",当前商品总库存不能小于分配库存总额!请先修改门店库存!");
             }
         }
 
@@ -525,6 +524,12 @@ public class GoodsServiceImpl implements GoodsService {
                 goodsSpecificationDao.save(goodsSpecification);
             }
 
+            //更新门店商品是否有修改字段
+            if(storeIds.length > 0){
+                for(int i=0;i<storeIds.length;i++){
+                    updateLoadGoodsByStoreId(storeIds[i], user);
+                }
+            }
             if(product == null){
                 product = new ProductEntity();
                 product.setGoodsSn(goods.getGoodsSn());
@@ -540,12 +545,6 @@ public class GoodsServiceImpl implements GoodsService {
                 return productDao.update(product);
             }
         }
-        //更新门店商品是否有修改字段
-        if(storeIds.length > 0){
-            for(int i=0;i<storeIds.length;i++){
-                updateLoadGoodsByStoreId(storeIds[i], user);
-            }
-        }
         return 1;
     }
 
@@ -555,12 +554,13 @@ public class GoodsServiceImpl implements GoodsService {
      * @param user
      */
     private void updateLoadGoodsByStoreId(Long storeId, SysUserEntity user){
-        StoreEntity storeEntity = new StoreEntity();
-        storeEntity.setIsLoadGoods("1");
-        storeEntity.setModerSn(user.getUsername());
-        storeEntity.setModTime(new Date());
-        storeEntity.setId(storeId);
-        storeDao.update(storeEntity);
+        List<MerchUserEntity> list = merchUserDao.queryMerchUserByLoadGoods(storeId);
+        for(MerchUserEntity entity : list) {
+            entity.setIsLoadGoods("1");
+            entity.setModerSn(user.getUsername());
+            entity.setStoreId(Integer.valueOf(String.valueOf(storeId)));
+            merchUserDao.updateStoreLoadGoodsById(entity);
+        }
     }
 
     @Override

+ 9 - 6
kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java

@@ -59,6 +59,8 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
     private MkDistSellAllocationDao mkDistSellAllocationDao;
     @Autowired
     private StoreDao storeDao;
+    @Autowired
+    private MerchUserDao merchUserDao;
 
     @Override
     public ProductStoreRelaEntity queryObject(Integer id) {
@@ -454,12 +456,13 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
      * @param user
      */
     private void updateLoadGoodsByStoreId(String storeId, SysUserEntity user){
-        StoreEntity storeEntity = new StoreEntity();
-        storeEntity.setIsLoadGoods("1");
-        storeEntity.setModerSn(user.getUsername());
-        storeEntity.setModTime(new Date());
-        storeEntity.setId(Long.valueOf(storeId));
-        storeDao.update(storeEntity);
+        List<MerchUserEntity> list = merchUserDao.queryMerchUserByLoadGoods(Long.valueOf(storeId));
+        for(MerchUserEntity entity : list) {
+            entity.setIsLoadGoods("1");
+            entity.setStoreId(Integer.valueOf(String.valueOf(storeId)));
+            entity.setModerSn(user.getUsername());
+            merchUserDao.updateStoreLoadGoodsById(entity);
+        }
     }
 
     /**

+ 164 - 0
kmall-admin/src/main/resources/mybatis/mapper/MerchUserDao.xml

@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.kmall.admin.dao.MerchUserDao">
+
+    <resultMap type="com.kmall.admin.entity.MerchUserEntity" id="merchUserMap">
+        <result property="id" column="id"/>
+        <result property="merchSn" column="merch_sn"/>
+        <result property="storeId" column="store_id"/>
+        <result property="userId" column="user_id"/>
+        <result property="createrSn" column="creater_sn"/>
+        <result property="createTime" column="create_time"/>
+        <result property="moderSn" column="moder_sn"/>
+        <result property="modTime" column="mod_time"/>
+        <result property="tstm" column="tstm"/>
+		<result property="isLoadGoods" column="is_load_goods"/>
+    </resultMap>
+
+	<select id="queryObject" resultType="com.kmall.admin.entity.MerchUserEntity">
+		select
+			`id`,
+			`merch_sn`,
+			`store_id`,
+			`user_id`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			is_load_goods,
+			`tstm`
+		from mall_merch_user
+		where id = #{id}
+	</select>
+
+	<select id="queryObjectByStoreId" resultType="com.kmall.admin.entity.MerchUserEntity">
+		select
+		`id`,
+		`merch_sn`,
+		`store_id`,
+		`user_id`,
+		`creater_sn`,
+		`create_time`,
+		`moder_sn`,
+		`mod_time`,
+		is_load_goods,
+		`tstm`
+		from mall_merch_user
+		where store_id = #{storeId} and user_id = #{userId}
+	</select>
+
+	<select id="queryMerchUserByLoadGoods" resultType="com.kmall.admin.entity.MerchUserEntity">
+		select
+		`id`,
+		`merch_sn`,
+		`store_id`,
+		`user_id`,
+		`creater_sn`,
+		`create_time`,
+		`moder_sn`,
+		`mod_time`,
+		is_load_goods,
+		`tstm`
+		from mall_merch_user
+		where store_id = #{storeId} and is_load_goods = 0
+	</select>
+
+	<select id="queryList" resultType="com.kmall.admin.entity.MerchUserEntity">
+		select
+    		`id`,
+    		`merch_sn`,
+    		`store_id`,
+    		`user_id`,
+    		`creater_sn`,
+    		`create_time`,
+    		`moder_sn`,
+    		`mod_time`,
+			is_load_goods,
+    		`tstm`
+		from mall_merch_user
+		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND name LIKE concat('%',#{name},'%')
+		</if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+			<otherwise>
+                order by id desc
+			</otherwise>
+        </choose>
+		<if test="offset != null and limit != null">
+			limit #{offset}, #{limit}
+		</if>
+	</select>
+	
+ 	<select id="queryTotal" resultType="int">
+		select count(*) from mall_merch_user
+		WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND name LIKE concat('%',#{name},'%')
+        </if>
+	</select>
+	 
+	<insert id="save" parameterType="com.kmall.admin.entity.MerchUserEntity" useGeneratedKeys="true" keyProperty="id">
+		insert into mall_merch_user(
+			`merch_sn`,
+			`store_id`,
+			`user_id`,
+			is_load_goods,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`)
+		values(
+			#{merchSn},
+			#{storeId},
+			#{userId},
+			#{isLoadGoods},
+			#{createrSn},
+			#{createTime},
+			#{moderSn},
+			#{modTime},
+			#{tstm})
+	</insert>
+	 
+	<update id="update" parameterType="com.kmall.admin.entity.MerchUserEntity">
+		update mall_merch_user 
+		<set>
+			<if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
+			<if test="storeId != null">`store_id` = #{storeId}, </if>
+			<if test="userId != null">`user_id` = #{userId}, </if>
+			<if test="isLoadGoods != null">`is_load_goods` = #{isLoadGoods}, </if>
+			<if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
+			<if test="createTime != null">`create_time` = #{createTime}, </if>
+			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
+			<if test="modTime != null">`mod_time` = #{modTime}, </if>
+			<if test="tstm != null">`tstm` = #{tstm}</if>
+		</set>
+		where id = #{id}
+	</update>
+	
+	<delete id="delete">
+		delete from mall_merch_user where id = #{value}
+	</delete>
+	
+	<delete id="deleteBatch">
+		delete from mall_merch_user where id in 
+		<foreach item="id" collection="array" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</delete>
+
+	<update id="updateStoreLoadGoodsById" parameterType="com.kmall.api.entity.StoreVo">
+		update mall_merch_user
+		<set>
+			<if test="isLoadGoods != null">`is_load_goods` = #{isLoadGoods}, </if>
+			mod_time = now(),
+			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
+		</set>
+		where store_id = #{storeId}
+	</update>
+</mapper>

+ 17 - 11
kmall-admin/src/main/resources/mybatis/mapper/OrderRefundDao.xml

@@ -108,22 +108,22 @@
         <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
             AND s.third_party_merch_code = #{thirdPartyMerchCode}
         </if>
-        <if test="orderId != null">
-            AND o.id = #{orderId}
-        </if>
         <if test="storeId != null and storeId != ''">
             AND o.store_id = #{storeId}
         </if>
         <if test="merchSn != null and merchSn.trim() != ''">
             AND o.merch_sn = #{merchSn}
         </if>
-        <if test="shippingStatus != null and shippingStatus.trim() != ''">
+        <if test="orderId != null">
+            AND o.id = #{orderId}
+        </if>
+        <if test="shippingStatus != null and shippingStatus != ''">
             AND o.shipping_status = #{shippingStatus}
         </if>
-        <if test="payStatus != null and payStatus.trim() != ''">
+        <if test="payStatus != null and payStatus != ''">
             AND o.pay_status = #{payStatus}
         </if>
-        <if test="orderStatus != null and orderStatus.trim() != ''">
+        <if test="orderStatus != null and orderStatus != ''">
             AND o.order_status = #{orderStatus}
         </if>
         <if test="noCancelStatus != null and noCancelStatus == 'true'">
@@ -132,9 +132,12 @@
         <if test="refundStatus != null">
             AND r.refund_status = #{refundStatus}
         </if>
-        <if test="orderType != null and orderType.trim() != ''">
+        <if test="orderType != null and orderType != ''">
             AND o.order_type = #{orderType}
         </if>
+        <if test="isOnfflineOrder != null and isOnfflineOrder != ''">
+            AND o.is_onffline_order = #{isOnfflineOrder}
+        </if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
@@ -173,13 +176,13 @@
         <if test="orderId != null">
             AND o.id = #{orderId}
         </if>
-        <if test="shippingStatus != null and shippingStatus.trim() != ''">
+        <if test="shippingStatus != null and shippingStatus != ''">
             AND o.shipping_status = #{shippingStatus}
         </if>
-        <if test="payStatus != null and payStatus.trim() != ''">
+        <if test="payStatus != null and payStatus != ''">
             AND o.pay_status = #{payStatus}
         </if>
-        <if test="orderStatus != null and orderStatus.trim() != ''">
+        <if test="orderStatus != null and orderStatus != ''">
             AND o.order_status = #{orderStatus}
         </if>
         <if test="noCancelStatus != null and noCancelStatus == 'true'">
@@ -188,9 +191,12 @@
         <if test="refundStatus != null">
             AND r.refund_status = #{refundStatus}
         </if>
-        <if test="orderType != null and orderType.trim() != ''">
+        <if test="orderType != null and orderType != ''">
             AND o.order_type = #{orderType}
         </if>
+        <if test="isOnfflineOrder != null and isOnfflineOrder != ''">
+            AND o.is_onffline_order = #{isOnfflineOrder}
+        </if>
     </select>
 
     <insert id="save" parameterType="com.kmall.admin.entity.OrderRefundEntity" useGeneratedKeys="true" keyProperty="id">

+ 3 - 7
kmall-admin/src/main/resources/mybatis/mapper/StoreDao.xml

@@ -27,7 +27,6 @@
 		<result property="thirdPartyMerchName" column="third_party_merch_name"/>
 		<result property="exprAgreementType" column="expr_agreement_type"/>
 		<result property="isValid" column="is_valid"/>
-		<result property="isLoadGoods" column="is_load_goods"/>
 
     </resultMap>
 
@@ -44,7 +43,7 @@
 			`county_name`,
 			`latitude`,
 			`longitude`,
-			`cover_radius`,expr_agreement_type,is_load_goods,
+			`cover_radius`,expr_agreement_type,
 			`remark`,merch_sn, merch_name, creater_sn, create_time,third_party_merch_code,third_party_merch_name,
 		moder_sn, mod_time, tstm,is_valid
 		from mall_store
@@ -64,7 +63,7 @@
 		`county_name`,
 		`latitude`,
 		`longitude`,
-		`cover_radius`,expr_agreement_type,is_load_goods,
+		`cover_radius`,expr_agreement_type,
 		`remark`,merch_sn, merch_name, creater_sn, create_time,third_party_merch_code,third_party_merch_name,
     moder_sn, mod_time, tstm,is_valid
 		from mall_store
@@ -104,7 +103,7 @@
 		s.`county_name`,
 		s.`latitude`,
 		s.`longitude`,
-		s.`cover_radius`,s.is_load_goods,
+		s.`cover_radius`,
 		s.`remark`,s.merch_sn, s.merch_name, s.creater_sn, s.create_time,s.third_party_merch_code,t.third_party_merch_name,s.expr_agreement_type,
 		s.moder_sn, s.mod_time, s.tstm,s.is_valid
 		from mall_store s left join third_merchant_biz t on s.third_party_merch_code = t.third_party_merch_code
@@ -180,7 +179,6 @@
 			`longitude`,
 			`cover_radius`,
 			is_valid,
-			is_load_goods,
 			`remark`,
 			third_party_merch_code,
 			third_party_merch_name,
@@ -203,7 +201,6 @@
 			#{longitude},
 			#{coverRadius},
 			#{isValid},
-			#{isLoadGoods},
 			#{remark},
 			#{thirdPartyMerchCode},
 			#{thirdPartyMerchName},
@@ -230,7 +227,6 @@
 			<if test="longitude != null">`longitude` = #{longitude}, </if>
 			<if test="coverRadius != null">`cover_radius` = #{coverRadius}, </if>
 			<if test="isValid != null">`is_valid` = #{isValid}, </if>
-			<if test="isLoadGoods != null">`is_load_goods` = #{isLoadGoods}, </if>
 			<if test="remark != null">`remark` = #{remark},</if>
 			<if test="createrSn != null" >creater_sn = #{createrSn},</if>
 			<if test="createTime != null" >create_time = #{createTime},</if>

+ 6 - 1
kmall-admin/src/main/webapp/WEB-INF/page/mk/mkstorecampminus.html

@@ -518,7 +518,7 @@
                         <i-col span="3">
                             <Form-item :label-width="1">
                                 <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                        max-size="2048"
+                                        max-size="100"
                                         :on-success="handleSuccessAdvImgUrl" :on-format-error="handleFormatError"
                                         :show-upload-list="false"
                                         :on-exceeded-size="handleMaxSize">
@@ -532,6 +532,11 @@
                             </Form-item>
                         </i-col>
                     </Row>
+                    <Row>
+                        <i-col span="16" style="margin-top: -30px;">
+                            <span style="margin-left: 140px;color: red;font-size: 12px;">* 尺寸建议410*110像素以内,大小100K以下</span>
+                        </i-col>
+                    </Row>
                     <Form-item label="活动说明" prop="advDesc">
                         <i-input type="textarea" :rows="3" v-model="mkStoreCampMinus.advDesc" placeholder="活动说明" style="width: 400px"></i-input>
                     </Form-item>

+ 12 - 2
kmall-admin/src/main/webapp/WEB-INF/page/mk/mkstoreticketdiscount.html

@@ -402,7 +402,7 @@
                         <i-col span="3">
                             <Form-item :label-width="1">
                                 <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                        max-size="2048"
+                                        max-size="100"
                                         :on-success="handleSuccessAdvImgUrl" :on-format-error="handleFormatError"
                                         :show-upload-list="false"
                                         :on-exceeded-size="handleMaxSize">
@@ -417,6 +417,11 @@
                         </i-col>
                     </Row>
                     <Row>
+                        <i-col span="16" style="margin-top: -30px;">
+                            <span style="margin-left: 100px;color: red;font-size: 12px;">* 尺寸建议410*110像素以内,大小100K以下</span>
+                        </i-col>
+                    </Row>
+                    <Row>
                         <i-col span="16">
                             <Form-item label="门店logo图url" prop="storeLogoUrl">
                                 <i-input v-model="mkStoreTicketDiscount.storeLogoUrl" placeholder="门店logo图url" readonly/>
@@ -425,7 +430,7 @@
                         <i-col span="3">
                             <Form-item :label-width="1">
                                 <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                        max-size="2048"
+                                        max-size="100"
                                         :on-success="handleSuccessStoreLogoUrl" :on-format-error="handleFormatError"
                                         :show-upload-list="false"
                                         :on-exceeded-size="handleMaxSize">
@@ -439,6 +444,11 @@
                             </Form-item>
                         </i-col>
                     </Row>
+                    <Row>
+                        <i-col span="16" style="margin-top: -30px;">
+                            <span style="margin-left: 140px;color: red;font-size: 12px;">* 尺寸建议410*110像素以内,大小100K以下</span>
+                        </i-col>
+                    </Row>
                     <Form-item label="图片是否展示在广告栏" prop="isStoreShow">
                         <Radio-group v-model="mkStoreTicketDiscount.isStoreShow">
                             <Radio label="0">

+ 2 - 2
kmall-admin/src/main/webapp/WEB-INF/page/shop/ad.html

@@ -65,7 +65,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccess" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">
@@ -81,7 +81,7 @@
             </Row>
             <Row>
                 <i-col span="16" style="margin-top: -20px;">
-                    <span style="margin-left: 80px;color: red;font-size: 12px;">尺寸建议750*400像素以内,大小2M以下</span>
+                    <span style="margin-left: 80px;color: red;font-size: 12px;">尺寸建议750*400像素以内,大小100K以下</span>
                 </i-col>
             </Row>
             <Form-item label="内容" prop="content">

+ 8 - 8
kmall-admin/src/main/webapp/WEB-INF/page/shop/brand.html

@@ -62,7 +62,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccessListPicUrl" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">
@@ -78,7 +78,7 @@
             </Row>
             <Row>
                 <i-col span="16" style="margin-top: -30px;">
-                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 图片尺寸建议760*484像素以内,大小2M以下</span>
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 图片尺寸建议760*484像素以内,大小100k以下</span>
                 </i-col>
             </Row>
             <Form-item label="描述" prop="simpleDesc">
@@ -93,7 +93,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccessPicUrl" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">
@@ -109,7 +109,7 @@
             </Row>
             <Row>
                 <i-col span="16" style="margin-top: -30px;">
-                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 图片尺寸建议760*484像素以内,大小2M以下</span>
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 图片尺寸建议760*484像素以内,大小100k以下</span>
                 </i-col>
             </Row>
             <Form-item label="排序" prop="sortOrder">
@@ -137,7 +137,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccessAppListPicUrl" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">
@@ -153,7 +153,7 @@
             </Row>
             <Row>
                 <i-col span="16" style="margin-top: -30px;">
-                    <span style="margin-left: 100px;color: red;font-size: 12px;">* app显示图片尺寸建议760*484像素以内,大小2M以下</span>
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* app显示图片尺寸建议760*484像素以内,大小100k以下</span>
                 </i-col>
             </Row>
             <Form-item label="新品牌" prop="isNew">
@@ -175,7 +175,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccessNewPicUrl" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">
@@ -191,7 +191,7 @@
             </Row>
             <Row>
                 <i-col span="16" style="margin-top: -30px;">
-                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 新品牌图片尺寸建议760*484像素以内,大小2M以下</span>
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 新品牌图片尺寸建议760*484像素以内,大小100k以下</span>
                 </i-col>
             </Row>
             <Form-item label="新品牌排序" prop="newSortOrder">

+ 4 - 4
kmall-admin/src/main/webapp/WEB-INF/page/shop/category.html

@@ -133,7 +133,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccessIconUrl" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">
@@ -149,7 +149,7 @@
             </Row>
             <Row>
                 <i-col span="16" style="margin-top: -30px;">
-                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 尺寸建议90*90像素以内,大小2M以下</span>
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 尺寸建议90*90像素以内,大小100K以下</span>
                 </i-col>
             </Row>
             <!--<Row>-->
@@ -189,7 +189,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccessWapBannerUrl" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">
@@ -205,7 +205,7 @@
             </Row>
             <Row>
                 <i-col span="16" style="margin-top: -30px;">
-                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 一级分类图片尺寸建议720*246像素以内,二级分类图片尺寸建议250*250像素以内,大小2M以下</span>
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 一级分类图片尺寸建议720*246像素以内,二级分类图片尺寸建议250*250像素以内,大小100K以下</span>
                 </i-col>
             </Row>
             <!--<Form-item label="类型" prop="type">-->

+ 8 - 8
kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html

@@ -243,7 +243,7 @@
                         <i-col span="4">
                             <Form-item :label-width="1">
                                 <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                        max-size="2048"
+                                        max-size="100"
                                         :on-success="handleSuccessPicUrl" :on-format-error="handleFormatError"
                                         :show-upload-list="false"
                                         :on-exceeded-size="handleMaxSize">
@@ -259,7 +259,7 @@
                     </Row>
                     <Row>
                         <i-col span="16" style="margin-top: -30px;">
-                            <span style="margin-left: 140px;color: red;font-size: 12px;">* 尺寸建议200x200(正方形模式)像素以内,大小2M以下</span>
+                            <span style="margin-left: 140px;color: red;font-size: 12px;">* 尺寸建议200x200(正方形模式)像素以内,大小100k以内</span>
                         </i-col>
                     </Row>
                     <Row>
@@ -271,7 +271,7 @@
                         <i-col span="4">
                             <Form-item :label-width="1">
                                 <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                        max-size="2048"
+                                        max-size="100"
                                         :on-success="handleSuccessListPicUrl" :on-format-error="handleFormatError"
                                         :show-upload-list="false"
                                         :on-exceeded-size="handleMaxSize">
@@ -287,7 +287,7 @@
                     </Row>
                     <Row>
                         <i-col span="16" style="margin-top: -30px;">
-                            <span style="margin-left: 140px;color: red;font-size: 12px;">* 尺寸建议200x200(正方形模式)像素以内,大小2M以下</span>
+                            <span style="margin-left: 140px;color: red;font-size: 12px;">* 尺寸建议200x200(正方形模式)像素以内,大小100k以内</span>
                         </i-col>
                     </Row>
                 <Row>
@@ -299,7 +299,7 @@
                     <i-col span="4">
                         <Form-item :label-width="1">
                             <Upload style="width: 300px;" action="../sys/oss/upload" :format="['mp4']"
-                                    max-size="2048"
+                                    max-size="1024"
                                     :on-success="handleSuccessListVideoUrl" :on-format-error="handleVideoFormatError"
                                     :show-upload-list="false"
                                     :on-exceeded-size="handleVideoMaxSize">
@@ -315,7 +315,7 @@
                 </Row>
                 <Row>
                     <i-col span="16" style="margin-top: -30px;">
-                            <span style="margin-left: 140px;color: red;font-size: 12px;">* 视频不能超过2M,视频时限20秒内,支持mp4视频格式</span>
+                            <span style="margin-left: 140px;color: red;font-size: 12px;">* 视频不能超过1M,视频时限20秒内,支持mp4视频格式</span>
                     </i-col>
                 </Row>
                 <!--</i-form>-->
@@ -413,7 +413,7 @@
                             :default-file-list="uploadList"
                             :on-success="handleSuccess"
                             :format="['jpg','jpeg','png']"
-                            :max-size="2048"
+                            :max-size="100"
                             :on-format-error="handleFormatError"
                             :on-exceeded-size="handleMaxSize"
                             :before-upload="handleBeforeUpload"
@@ -428,7 +428,7 @@
                     <Modal title="查看图片" v-model="visible">
                         <img :src="imgName" v-if="visible" style="width: 100%"/>
                     </Modal>
-                    <span style="color: red;font-size: 12px;">* 商品详情轮播图,尺寸建议750x750(正方形模式)像素以内,大小2M以下</span>
+                    <span style="color: red;font-size: 12px;">* 商品详情轮播图,尺寸建议750x750(正方形模式)像素以内,大小100k以内</span>
                 </template>
                 <div id="goodsDesc"></div>
             </Tab-Pane>

+ 2 - 2
kmall-admin/src/main/webapp/WEB-INF/page/shop/goodsgroup.html

@@ -55,7 +55,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccess" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">
@@ -78,7 +78,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleAbbrSuccess" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">

+ 1 - 1
kmall-admin/src/main/webapp/WEB-INF/page/shop/goodsspecification.html

@@ -57,7 +57,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccess" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">

+ 1 - 1
kmall-admin/src/main/webapp/WEB-INF/page/shop/order.html

@@ -391,7 +391,7 @@
                         <i-input v-model="order.consignee" readonly/>
                     </Form-item>
                     <Form-item label="收货地址" prop="address">
-                        <i-input v-model="order.address" readonly/>
+                        {{order.province}}{{order.city}}{{order.district}}{{order.address}}
                     </Form-item>
                     <Form-item label="联系电话" prop="mobile">
                         <i-input v-model="order.mobile" readonly/>

+ 8 - 3
kmall-admin/src/main/webapp/WEB-INF/page/shop/topic.html

@@ -49,7 +49,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccessAvatar" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">
@@ -64,6 +64,11 @@
                 </i-col>
             </Row>
             <Row>
+                <i-col span="16" style="margin-top: -30px;">
+                    <span style="margin-left: 100px;color: red;font-size: 12px;">* 尺寸建议410*110像素以内,大小100K以下</span>
+                </i-col>
+            </Row>
+            <Row>
                 <i-col span="16">
                     <Form-item label="活动条例图片" prop="itemPicUrl">
                         <i-input v-model="topic.itemPicUrl" placeholder="活动条例图片" readonly/>
@@ -72,7 +77,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccessItemPicUrl" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">
@@ -107,7 +112,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccessScenePicUrl" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">

+ 1 - 1
kmall-admin/src/main/webapp/WEB-INF/page/shop/topiccategory.html

@@ -45,7 +45,7 @@
                 <i-col span="4">
                     <Form-item :label-width="1">
                         <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
-                                max-size="2048"
+                                max-size="100"
                                 :on-success="handleSuccess" :on-format-error="handleFormatError"
                                 :show-upload-list="false"
                                 :on-exceeded-size="handleMaxSize">

+ 42 - 5
kmall-admin/src/main/webapp/WEB-INF/page/sys/main.html

@@ -63,12 +63,12 @@
             <div class="small-box bg-fuchsia">
                 <div class="inner">
                     <h3>{{thcOrderSum}}</h3>
-                    <p>退货</p>
+                    <p>申请退款订单</p>
                 </div>
                 <div class="icon">
                     <i class="fa fa-shopping-bag"></i>
                 </div>
-                <a onclick="vm.toOrderByShipStatus(4)" class="small-box-footer">详情 <i
+                <a onclick="vm.toOrderByRefundStatus(1)" class="small-box-footer">详情 <i
                         class="fa fa-arrow-circle-right"></i></a>
             </div>
         </div>
@@ -161,7 +161,7 @@
             yfOrderSum: 0,//已发货
             yfkOrderSum: 0,//待付款
             ywcOrderSum: 0,//已完成
-            thcOrderSum: 0,//退
+            thcOrderSum: 0,//退
             userSum: 0,//所有会员数
             goodsSum: 0,//所有商品数
             yfkOrderUserSum: 0,//已付款订单会员数
@@ -201,7 +201,7 @@
                         iview.Message.error('没有数据!');
                         return;
                     }
-                } else if (shippingStatus == 4) {//退
+                } else if (shippingStatus == 4) {//退
                     if (vm.thcOrderSum == 0) {
                         iview.Message.error('没有数据!');
                         return;
@@ -215,6 +215,19 @@
                     content: url
                 });
             },
+            toOrderByRefundStatus: function (refundStatus) {
+                let url = '../shop/orderrefund.html?refundStatus=' + refundStatus;
+                if (vm.thcOrderSum == 0) {
+                    iview.Message.error('没有数据!');
+                    return;
+                }
+                openWindow({
+                    top: true,
+                    type: 2,
+                    title: '订单申请维权信息',
+                    content: url
+                });
+            },
             toOrderByPayStatus: function (payStatus) {
                 if (vm.yfkOrderSum == 0) {
                     iview.Message.error('没有数据!');
@@ -294,8 +307,32 @@
             $.getJSON("../order/queryTotal?isOnfiilineOrder=0&orderStatus=402", function (r) {
                 vue.ywcOrderSum = r.sum;
             });
-            $.getJSON("../order/queryTotal?isOnfiilineOrder=0&shippingStatus=4", function (r) {
+//            $.getJSON("../orderrefund/queryTotal?isOnfflineOrder=0&refundStatus=1", function (r) {
+//                console.log(r.sum)
+//                vue.thcOrderSum = r.sum;
+//            });
+            $.get("../orderrefund/queryTotal?isOnfflineOrder=0&refundStatus=1", function (r) {
                 vue.thcOrderSum = r.sum;
+                if (r.sum > 0) {
+                    iview.Notice.info({
+                        title: '您有退款申请订单',
+                        desc: '<a onclick="vm.toOrderByRefundStatus(1)" class="small-box-footer">查看</a>',
+                        duration: 0
+                    });
+                    let iN = new iNotify({
+                        effect: 'flash',
+                        interval: 500,
+                        message: "申请退款订单",
+                        audio: {
+                            file: ['../statics/audio/dforder.mp3']
+                        },
+                        notification: {
+                            title: "通知!",
+                            body: '您有退款申请订单'
+                        }
+                    });
+                    iN.setTitle(true).player();
+                }
             });
             $.getJSON("../order/getUserOrderInfo?type=yfkOrderUserSum", function (r) {
                 vue.yfkOrderUserSum = r.result;

+ 2 - 2
kmall-admin/src/main/webapp/js/mk/mkstorecampminus.js

@@ -374,7 +374,7 @@ let vm = new Vue({
             vm.isShowGoods = false;//为false则可以添加商品
             vm.showStoreGoodsList = true;
 
-            vm.reloadOrder();
+            vm.reloadOrderSearch();
         },
         queryOrder: function () {
             vm.reloadOrder();
@@ -958,7 +958,7 @@ let vm = new Vue({
         handleMaxSize: function (file) {
             this.$Notice.warning({
                 title: '超出文件大小限制',
-                desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
+                desc: '文件 ' + file.name + ' 太大,不能超过 100K。'
             });
         },
         eyeImageAdvImgUrl: function () {

+ 1 - 1
kmall-admin/src/main/webapp/js/mk/mkstoreticketdiscount.js

@@ -1025,7 +1025,7 @@ let vm = new Vue({
         handleMaxSize: function (file) {
             this.$Notice.warning({
                 title: '超出文件大小限制',
-                desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
+                desc: '文件 ' + file.name + ' 太大,不能超过 100K。'
             });
         },
         eyeImageAdvImgUrl: function () {

+ 1 - 1
kmall-admin/src/main/webapp/js/shop/ad.js

@@ -180,7 +180,7 @@ var vm = new Vue({
         handleMaxSize: function (file) {
             this.$Notice.warning({
                 title: '超出文件大小限制',
-                desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
+                desc: '文件 ' + file.name + ' 太大,不能超过 100K。'
             });
         },
         handleSubmit: function (name) {

+ 1 - 1
kmall-admin/src/main/webapp/js/shop/brand.js

@@ -232,7 +232,7 @@ var vm = new Vue({
         handleMaxSize: function (file) {
             this.$Notice.warning({
                 title: '超出文件大小限制',
-                desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
+                desc: '文件 ' + file.name + ' 太大,不能超过 100k。'
             });
         },
         eyeImageListPicUrl: function () {

+ 1 - 1
kmall-admin/src/main/webapp/js/shop/category.js

@@ -230,7 +230,7 @@ var vm = new Vue({
         handleMaxSize: function (file) {
             this.$Notice.warning({
                 title: '超出文件大小限制',
-                desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
+                desc: '文件 ' + file.name + ' 太大,不能超过 100K。'
             });
         },
         handleSuccessBannerUrl: function (res, file) {

+ 8 - 2
kmall-admin/src/main/webapp/js/shop/goods.js

@@ -626,7 +626,13 @@ var vm = new Vue({
         handleMaxSize: function (file) {
             this.$Notice.warning({
                 title: '超出文件大小限制',
-                desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
+                desc: '文件 ' + file.name + ' 太大,不能超过 100k。'
+            });
+        },
+        handleMaxSizeByInfo: function (file) {
+            this.$Notice.warning({
+                title: '超出文件大小限制',
+                desc: '文件 ' + file.name + ' 太大,不能超过 300k。'
             });
         },
         handleReset: function (name) {
@@ -662,7 +668,7 @@ var vm = new Vue({
         handleVideoMaxSize: function (file) {
             this.$Notice.warning({
                 title: '超出文件大小限制',
-                desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
+                desc: '文件 ' + file.name + ' 太大,不能超过 1M。'
             });
         },
         handleSuccessListVideoUrl: function (res, file) {

+ 1 - 1
kmall-admin/src/main/webapp/js/shop/goodsgroup.js

@@ -205,7 +205,7 @@ let vm = new Vue({
         handleMaxSize: function (file) {
             this.$Notice.warning({
                 title: '超出文件大小限制',
-                desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
+                desc: '文件 ' + file.name + ' 太大,不能超过 100K。'
             });
         },
         handleSuccess: function (res, file) {

+ 1 - 1
kmall-admin/src/main/webapp/js/shop/goodsspecification.js

@@ -158,7 +158,7 @@ var vm = new Vue({
         handleMaxSize: function (file) {
             this.$Notice.warning({
                 title: '超出文件大小限制',
-                desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
+                desc: '文件 ' + file.name + ' 太大,不能超过 100K。'
             });
         },
         handleSuccess: function (res, file) {

+ 10 - 1
kmall-admin/src/main/webapp/js/shop/orderrefund.js

@@ -1,6 +1,15 @@
 $(function () {
+    let refundStatus = getQueryString("refundStatus");
+    let isOnfflineOrder = getQueryString("isOnfflineOrder");
+    let url = '../orderrefund/list?1';
+    if (refundStatus) {
+        url += '&refundStatus=' + refundStatus;
+    }
+    if (isOnfflineOrder) {
+        url += '&isOnfflineOrder=' + isOnfflineOrder;
+    }
     $("#jqGrid").jqGrid({
-        url: '../orderrefund/list',
+        url: url,
         datatype: "json",
         colModel: [
 			{label: 'id', name: 'id', index: 'id', key: true, hidden: true},

+ 0 - 36
kmall-admin/src/main/webapp/js/shop/storeProductStock.js

@@ -588,47 +588,11 @@ var vm = new Vue({
         uploadExcelError: function () {
             alert('上传出现异常');
         },
-        handleView(name) {
-            this.imgName = name;
-            this.visible = true;
-        },
-        handleRemove(file) {
-            // 从 upload 实例删除数据
-            const fileList = this.uploadList;
-            this.uploadList.splice(fileList.indexOf(file), 1);
-        },
-        handleSuccess(res, file) {
-            // 因为上传过程为实例,这里模拟添加 url
-            file.imgUrl = res.url;
-            file.name = res.url;
-            vm.uploadList.add(file);
-        },
-        handleBeforeUpload() {
-            const check = this.uploadList.length < 5;
-            if (!check) {
-                this.$Notice.warning({
-                    title: '最多只能上传 5 张图片。'
-                });
-            }
-            return check;
-        },
         handleSubmit: function (name) {
             handleSubmitValidate(this, name, function () {
                 vm.saveOrUpdate()
             });
         },
-        handleFormatError: function (file) {
-            this.$Notice.warning({
-                title: '文件格式不正确',
-                desc: '文件 ' + file.name + ' 格式不正确,请上传 jpg 或 png 格式的图片。'
-            });
-        },
-        handleMaxSize: function (file) {
-            this.$Notice.warning({
-                title: '超出文件大小限制',
-                desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
-            });
-        },
         handleReset: function (name) {
             handleResetForm(this, name);
         },

+ 1 - 1
kmall-admin/src/main/webapp/js/shop/topic.js

@@ -178,7 +178,7 @@ var vm = new Vue({
         handleMaxSize: function (file) {
             this.$Notice.warning({
                 title: '超出文件大小限制',
-                desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
+                desc: '文件 ' + file.name + ' 太大,不能超过 100K。'
             });
         },
         eyeImageAvatar: function () {

+ 1 - 1
kmall-admin/src/main/webapp/js/shop/topiccategory.js

@@ -141,7 +141,7 @@ var vm = new Vue({
         handleMaxSize: function (file) {
             this.$Notice.warning({
                 title: '超出文件大小限制',
-                desc: '文件 ' + file.name + ' 太大,不能超过 2M。'
+                desc: '文件 ' + file.name + ' 太大,不能超过 100K。'
             });
         },
         eyeImage: function () {

+ 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",

+ 13 - 6
kmall-api/src/main/java/com/kmall/api/api/ApiAuthController.java

@@ -158,10 +158,11 @@ public class ApiAuthController extends ApiBaseAction {
     @GetMapping("updateStoreLoadGoodsById")
     @IgnoreAuth
     public Object updateStoreLoadGoodsById(@RequestParam String storeId) {
-        StoreVo storeVo = new StoreVo();
-        storeVo.setId(Long.valueOf(storeId));
-        storeVo.setIsLoadGoods("0");//门店商品是否修改字段更新为否
-        apiStoreService.updateStoreLoadGoodsById(storeVo);
+        MerchUserVo merchUserVo = new MerchUserVo();
+        merchUserVo.setStoreId(Integer.valueOf(storeId));
+        merchUserVo.setUserId(Integer.parseInt(String.valueOf(getUserId())));
+        merchUserVo.setIsLoadGoods("0");//门店商品是否修改字段更新为否
+        apiMerchUserService.updateStoreLoadGoodsById(merchUserVo);
         return toResponsSuccess("成功");
     }
 
@@ -204,25 +205,31 @@ public class ApiAuthController extends ApiBaseAction {
         Long storeId = jsonParam.getLong("storeId");
         Long userId = jsonParam.getLong("userId");
         String merchSn = (String)jsonParam.get("merchSn");
-        Date nowTime = new Date();
+//        Date nowTime = new Date();
         UserVo userVo = userService.queryObject(userId);
+        String isLoadGoods = "";
         if (null != userVo) {
             MerchUserVo merchUser = apiMerchUserService.queryObjectByStoreId(storeId,userId);
             MerchUserVo merchUserVo = new MerchUserVo();
             merchUserVo.setStoreId(Integer.parseInt(String.valueOf(storeId)));
             merchUserVo.setMerchSn(merchSn);
             merchUserVo.setUserId(Integer.parseInt(String.valueOf(userId)));
-            if(merchUser != null) {;
+            if(merchUser != null) {
+                isLoadGoods = merchUser.getIsLoadGoods();
                 merchUserVo.setModTime(new Date());
                 merchUserVo.setId(merchUser.getId());
                 apiMerchUserService.update(merchUserVo);
             }else{
                 merchUserVo.setCreateTime(new Date());
                 merchUserVo.setModTime(new Date());
+                merchUserVo.setIsLoadGoods("0");
                 apiMerchUserService.save(merchUserVo);
             }
         }
         ThirdMerchantBizVo thirdMerchantBizVo = apiThirdMerchantBizService.queryDataByStoreId(storeId);
+        if(thirdMerchantBizVo != null){
+            thirdMerchantBizVo.setIsLoadGoods(isLoadGoods);
+        }
         return toResponsSuccess(thirdMerchantBizVo);
     }
 }

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

@@ -15,6 +15,7 @@ import com.kmall.api.entity.*;
 import com.kmall.api.service.*;
 import com.kmall.api.util.ApiBaseAction;
 import com.kmall.common.utils.MapUtils;
+import com.kmall.common.utils.RRException;
 import com.qiniu.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -64,9 +65,9 @@ public class ApiCartController extends ApiBaseAction {
      * 获取购物车中的数据
      */
     @GetMapping("getCartMoney")
-    public Object getCartMoney(@LoginUser UserVo loginUser, String checkCart) {
+    public Object getCartMoney(@LoginUser UserVo loginUser, CheckOutDto checkOutDto) {
         Long storeId = getStoreId();
-        Map<String, Object> resultObj = cartService.getCartMoney(loginUser,checkCart,storeId);
+        Map<String, Object> resultObj = cartService.getCartMoney(loginUser, checkOutDto, storeId);
         return resultObj;
     }
 
@@ -277,7 +278,9 @@ public class ApiCartController extends ApiBaseAction {
         //判断商品是否可以购买
         GoodsVo goodsInfo = goodsService.queryObjectByStoreId(goodsId, getStoreId());
         if (null == goodsInfo || goodsInfo.getIs_delete() == 1 || goodsInfo.getIs_on_sale() == 0) {
+            logger.error("商品已下架" );
             return toResponsFail("商品已下架");
+//            throw new RRException("商品已下架");
         }
         Long storeId = getStoreId();
         //取得规格的信息,判断规格库存
@@ -290,7 +293,9 @@ public class ApiCartController extends ApiBaseAction {
         }*/
         ProductVo productInfo = productService.queryByStoreId(productId, storeId);
         if (null == productInfo) {
+            logger.error("商品已下架" );
             return toResponsFail("商品已下架");
+//            throw new RRException("商品已下架");
         }
         //// TODO: 2019/3/5  普通商品不受共享库存影响,直接取门店配置库存
         Integer stockNum = StockUtil.setStockNumByGoodsVo(goodsInfo);
@@ -308,7 +313,9 @@ public class ApiCartController extends ApiBaseAction {
             }
         }*/
         if(stockNum == null || number > stockNum || stockNum <= 0){
+            logger.error("该商品库存不足" );
             return toResponsFail("该商品库存不足");
+//            throw new RRException("该商品库存不足");
         }
         if (null == productInfo.getRetail_price()) {
             productInfo.setRetail_price(goodsInfo.getRetail_price());
@@ -348,6 +355,7 @@ public class ApiCartController extends ApiBaseAction {
             cartService.save(cartInfo);
         } else {
             if(number + cartInfo.getNumber() > stockNum){
+                logger.error("商品选购数量(含购物车已加购数量)已超过库存" );
                 return toResponsFail("商品选购数量(含购物车已加购数量)已超过库存");
             }
             cartInfo.setNumber(cartInfo.getNumber() + number);
@@ -411,7 +419,9 @@ public class ApiCartController extends ApiBaseAction {
             //判断商品是否可以购买
             ProductVo productInfo = productService.queryByStoreId(goodsVo.getProduct_id(), storeId);
             if (null == productInfo) {
-                return toResponsFail("商品已下架");
+                logger.error("商品已下架" );
+                throw new RRException("商品已下架");
+//                return toResponsFail("商品已下架");
             }
             GoodsVo goodsInfo = goodsService.queryObjectByStoreId(goodsVo.getGoods_id(), getStoreId());
             if (null == goodsInfo || goodsInfo.getIs_delete() == 1 || goodsInfo.getIs_on_sale() == 0) {
@@ -691,10 +701,10 @@ public class ApiCartController extends ApiBaseAction {
         JSONObject jsonParam = getJsonRequest();
 
         CheckOutDto checkOutDto = JSONObject.parseObject(jsonParam.toString(), CheckOutDto.class);
-        //获取要购买的商品
-        Map<String, Object> cartData = (Map<String, Object>)this.getCartMoney(loginUser,checkOutDto.getCheckCart());
         checkOutDto.setLoginUser(loginUser);
         checkOutDto.setStoreId(getStoreId());
+        //获取要购买的商品
+        Map<String, Object> cartData = (Map<String, Object>)this.getCartMoney(loginUser,checkOutDto);
         checkOutDto.setCartData(cartData);
 
         Map<String, Object> resultObj = cartService.getCheckOut(checkOutDto);

+ 12 - 3
kmall-api/src/main/java/com/kmall/api/api/ApiStoreCampMinusController.java

@@ -2,6 +2,7 @@ package com.kmall.api.api;
 
 import com.kmall.api.annotation.LoginUser;
 import com.kmall.api.dto.CampMinusDto;
+import com.kmall.api.dto.CheckOutDto;
 import com.kmall.api.dto.UserCouponDto;
 import com.kmall.api.entity.CartVo;
 import com.kmall.api.entity.UserCouponVo;
@@ -76,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++) {
@@ -96,9 +97,17 @@ public class ApiStoreCampMinusController extends ApiBaseAction {
      * 确认订单页,查看订单商品所支持的满减满折列表
      */
     @GetMapping("getCampminusByCheckCartList")
-    public Object getCampminusByCheckCartList(@LoginUser UserVo loginUser, Integer storeId, String checkCart, String bizType) {
+    public Object getCampminusByCheckCartList(@LoginUser UserVo loginUser, Integer storeId, String checkCart, String bizType, Long goodsId, Integer number) {
+        CheckOutDto checkOutDto = new CheckOutDto();
+        checkOutDto.setCheckCart(checkCart);
+        //商品id不为空,则提交订单是从商品详情页立即购买过来的
+        if(goodsId != null){
+            checkOutDto.setGoodsId(goodsId);
+            checkOutDto.setNumber(number);
+        }
+        checkOutDto.setLoginUser(loginUser);
         //获取要购买的商品
-        Map<String, Object> cartData = apiCartService.getCartMoney(loginUser, checkCart, Long.valueOf(storeId));
+        Map<String, Object> cartData = apiCartService.getCartMoney(loginUser, checkOutDto, Long.valueOf(storeId));
 
         List<CartVo> checkedGoodsList = new ArrayList();
         List<CartVo> cartGoodsList = (List<CartVo>) cartData.get("cartList");

+ 11 - 3
kmall-api/src/main/java/com/kmall/api/api/ApiStoreTicketDiscountController.java

@@ -2,6 +2,7 @@ package com.kmall.api.api;
 
 import com.google.common.collect.Maps;
 import com.kmall.api.annotation.LoginUser;
+import com.kmall.api.dto.CheckOutDto;
 import com.kmall.api.dto.UserCouponDto;
 import com.kmall.api.entity.*;
 import com.kmall.api.entity.mk.MkStoreTicketDiscountVo;
@@ -158,10 +159,17 @@ public class ApiStoreTicketDiscountController  extends ApiBaseAction {
      * 查看当前用户已领取的且订单商品所支持的优惠券列表
      */
     @GetMapping("getDiscountByCheckCartList")
-    public Object getDiscountByCheckCartList(@LoginUser UserVo loginUser, Integer storeId, String checkCart,String bizType) {
-
+    public Object getDiscountByCheckCartList(@LoginUser UserVo loginUser, Integer storeId, String checkCart,String bizType, Long goodsId, Integer number) {
+        CheckOutDto checkOutDto = new CheckOutDto();
+        checkOutDto.setCheckCart(checkCart);
+        //商品id不为空,则提交订单是从商品详情页立即购买过来的
+        if(goodsId != null){
+            checkOutDto.setGoodsId(goodsId);
+            checkOutDto.setNumber(number);
+        }
+        checkOutDto.setLoginUser(loginUser);
         //获取要购买的商品
-        Map<String, Object> cartData = apiCartService.getCartMoney(loginUser, checkCart, Long.valueOf(storeId));
+        Map<String, Object> cartData = apiCartService.getCartMoney(loginUser, checkOutDto, Long.valueOf(storeId));
 
         List<CartVo> checkedGoodsList = new ArrayList();
         List<CartVo> cartGoodsList = (List<CartVo>) cartData.get("cartList");

+ 2 - 0
kmall-api/src/main/java/com/kmall/api/dao/ApiMerchUserMapper.java

@@ -14,4 +14,6 @@ import org.apache.ibatis.annotations.Param;
  */
 public interface ApiMerchUserMapper extends BaseDao<MerchUserVo> {
     MerchUserVo queryObjectByStoreId(@Param("storeId") Long storeId, @Param("userId")Long userId);
+
+    Integer updateStoreLoadGoodsById(MerchUserVo merchUserVo);
 }

+ 0 - 2
kmall-api/src/main/java/com/kmall/api/dao/ApiStoreMapper.java

@@ -18,6 +18,4 @@ import java.util.Map;
 @Service
 public interface ApiStoreMapper extends BaseDao<StoreVo> {
     List<StoreVo> queryNearbyList(Map param);
-
-    Integer updateStoreLoadGoodsById(StoreVo storeVo);
 }

+ 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;
     }

+ 18 - 0
kmall-api/src/main/java/com/kmall/api/dto/CheckOutDto.java

@@ -24,6 +24,24 @@ public class CheckOutDto {
     private Integer campId10;
     private Integer campId11;
     private Integer isLoadStatus;
+    private Long goodsId;
+    private Integer number;
+
+    public Integer getNumber() {
+        return number;
+    }
+
+    public void setNumber(Integer number) {
+        this.number = number;
+    }
+
+    public Long getGoodsId() {
+        return goodsId;
+    }
+
+    public void setGoodsId(Long goodsId) {
+        this.goodsId = goodsId;
+    }
 
     public Integer getIsLoadStatus() {
         return isLoadStatus;

+ 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;
     }

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

@@ -51,6 +51,16 @@ public class MerchUserVo implements Serializable {
      */
     private Date tstm;
 
+    private String isLoadGoods;
+
+    public String getIsLoadGoods() {
+        return isLoadGoods;
+    }
+
+    public void setIsLoadGoods(String isLoadGoods) {
+        this.isLoadGoods = isLoadGoods;
+    }
+
     /**
      * 设置:主键
      */

+ 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;
     }

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

@@ -61,6 +61,16 @@ public class ThirdMerchantBizVo implements Serializable {
 
     private String isMapShow;
 
+    private String isLoadGoods;
+
+    public String getIsLoadGoods() {
+        return isLoadGoods;
+    }
+
+    public void setIsLoadGoods(String isLoadGoods) {
+        this.isLoadGoods = isLoadGoods;
+    }
+
     public String getIsMapShow() {
         return isMapShow;
     }

+ 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;
     }
 

+ 166 - 29
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;
@@ -200,17 +201,11 @@ public class ApiCartService {
         return cartDao.queryCartByGoodsBizType(goodsBizType);
     }
 
-    public Map<String, Object> getCartMoney(UserVo loginUser, String checkCart, Long storeId){
+    public Map<String, Object> getCartMoney(UserVo loginUser, CheckOutDto checkOutDto, Long storeId){
         Map<String, Object> resultObj = Maps.newHashMap();
-        //查询列表数据
-        Map param = Maps.newHashMap();
-        param.put("user_id", loginUser.getId());
-        param.put("store_id", storeId);
-        param.put("checkCart",checkCart);
-        param.put("checked", "1");
-        param.putAll(setIsStockShare(storeId));
-        List<CartVo> cartList = cartDao.queryList(param);
-        //获取购物车统计信息
+        Long goodsId = checkOutDto.getGoodsId();
+        Integer number = checkOutDto.getNumber();
+        String checkCart = checkOutDto.getCheckCart();
         Integer goodsCount = 0;
         BigDecimal goodsAmount = new BigDecimal(0.00);
         Integer checkedGoodsCount = 0;
@@ -219,6 +214,45 @@ public class ApiCartService {
         BigDecimal checkedGoodsAmount02 = new BigDecimal(0.00);
         BigDecimal checkedGoodsAmount10 = new BigDecimal(0.00);
         BigDecimal checkedGoodsAmount11 = new BigDecimal(0.00);
+        List<CartVo> cartList = new ArrayList<>();
+        //商品id不为空,则提交订单是从商品详情页立即购买过来的
+        if(goodsId != null){
+            GoodsVo goodsVo = apiGoodsMapper.queryObjectByStoreId(goodsId, storeId);
+            if(goodsVo != null){
+                if(goodsVo.getGoods_number() == 0){
+                    logger.error("商品库存不足" );
+                    throw new RRException("商品库存不足");
+                }
+                CartVo vo = new CartVo();
+                vo.setGoodsBizType(goodsVo.getGoodsBizType());
+                vo.setGoods_id(goodsVo.getId());
+                vo.setNumber(number);
+                vo.setUser_id(checkOutDto.getLoginUser().getId());
+                vo.setSku(goodsVo.getSku());
+                vo.setGoods_sn(goodsVo.getGoods_sn());
+                vo.setGoods_name(goodsVo.getName());
+                vo.setRetail_price(goodsVo.getRetail_price());
+                vo.setStore_id(Long.valueOf(goodsVo.getStoreId()));
+                vo.setChecked(1);
+                vo.setList_pic_url(goodsVo.getList_pic_url());
+                vo.setProduct_id(Long.valueOf(goodsVo.getProduct_id()));
+                vo.setMarket_price(goodsVo.getMarket_price());
+                cartList.add(vo);
+            }else {
+                logger.error("商品信息不存在" );
+                throw new RRException("商品信息不存在");
+            }
+        }else{
+            //查询列表数据
+            Map param = Maps.newHashMap();
+            param.put("user_id", loginUser.getId());
+            param.put("store_id", storeId);
+            param.put("checkCart",checkCart);
+            param.put("checked", "1");
+            param.putAll(setIsStockShare(storeId));
+            cartList = cartDao.queryList(param);
+        }
+        //获取购物车统计信息
         for (CartVo cartItem : cartList) {
             goodsCount += cartItem.getNumber();
             goodsAmount = goodsAmount.add(cartItem.getRetail_price().multiply(new BigDecimal(cartItem.getNumber())));
@@ -279,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;
@@ -298,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;
@@ -434,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);
         }
@@ -444,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);
         }
@@ -454,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);
         }
@@ -464,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);
         }
@@ -483,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);
@@ -516,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);
@@ -569,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{
@@ -600,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);
@@ -625,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) {
@@ -652,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);
                             }

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

@@ -51,4 +51,7 @@ public class ApiMerchUserService {
     public MerchUserVo queryObjectByStoreId(Long storeId,Long userId){
         return apiMerchUserMapper.queryObjectByStoreId(storeId,userId);
     }
+    public int updateStoreLoadGoodsById(MerchUserVo merchUserVo){
+        return apiMerchUserMapper.updateStoreLoadGoodsById(merchUserVo);
+    }
 }

+ 115 - 32
kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java

@@ -4,10 +4,13 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Maps;
 import com.kmall.api.dao.mk.ApiMkStoreCampMinusMapper;
+import com.kmall.api.dao.mk.ApiMkStorePromMapper;
 import com.kmall.api.dao.mk.ApiMkStoreTicketDiscountMapper;
 import com.kmall.api.dto.CampMinusDto;
 import com.kmall.api.dto.CheckOutDto;
 import com.kmall.api.entity.mk.MkStoreCampMinusVo;
+import com.kmall.api.entity.mk.MkStorePromStatVo;
+import com.kmall.api.entity.mk.MkStorePromVo;
 import com.kmall.api.entity.mk.MkStoreTicketDiscountVo;
 import com.kmall.api.fromcomm.entity.FormIdsEntity;
 import com.kmall.api.service.mk.ApiMkStorePromStatService;
@@ -74,6 +77,8 @@ public class ApiOrderService {
     @Autowired
     private ApiStoreMngChangeMapper apiStoreMngChangeMapper;
     @Autowired
+    private ApiMkStorePromMapper apiMkStorePromMapper;
+    @Autowired
     private ApiMkStorePromStatService apiMkStorePromStatService;
     @Autowired
     private ApiMkStoreTicketDiscountMapper apiMkStoreTicketDiscountMapper;
@@ -262,6 +267,8 @@ public class ApiOrderService {
         Integer campId10 = jsonParam.getInteger("campId10");//促销id
         Integer campId11 = jsonParam.getInteger("campId11");//促销id
         Integer isLoadStatus = jsonParam.getInteger("isLoadStatus");
+        Integer number = jsonParam.getInteger("number");
+        Long goodsId = jsonParam.getLong("goodsId");
         UserVo user = apiUserMapper.queryObjectByIdNoAndName(idNo, userName);
         UserVo userVo = new UserVo();
         userVo.setId(loginUser.getId());
@@ -290,27 +297,13 @@ public class ApiOrderService {
             resultObj.put("errmsg", vo.getRespMessage());
             return resultObj;
         }
-
-        //获取要购买的商品
-        Map<String, Object> cartData = cartService.getCartMoney(loginUser,checkCart,storeId);
-        List<CartVo> checkedGoodsList = (List<CartVo>) cartData.get("cartList");
-//        Map param = Maps.newHashMap();
-//        param.put("user_id", loginUser.getId());
-//        param.put("store_id", storeId);
-//        param.put("checked", 1);
-//        param.put("checkCart", checkCart);
-//        List<CartVo> checkedGoodsList = apiCartMapper.queryList(param);
-        if (null == checkedGoodsList) {
-            resultObj.put("errno", 400);
-            resultObj.put("errmsg", "请选择商品");
-            logger.error("请选择商品");
-            return resultObj;
-        }
-        // 检查库存和更新库存
-        checkStock(checkedGoodsList, storeId, userName);
-
         CheckOutDto checkOutDto = new CheckOutDto();
         checkOutDto.setCheckCart(checkCart);
+        //商品id不为空,则提交订单是从商品详情页立即购买过来的
+        if(goodsId != null){
+            checkOutDto.setGoodsId(goodsId);
+            checkOutDto.setNumber(number);
+        }
         checkOutDto.setLoginUser(loginUser);
         if(tickDiscId00 != null){
             checkOutDto.setTickDiscId00(Long.valueOf(tickDiscId00));
@@ -338,6 +331,22 @@ public class ApiOrderService {
         }
         checkOutDto.setIsLoadStatus(isLoadStatus);
         checkOutDto.setStoreId(storeId);
+        //获取要购买的商品
+        Map<String, Object> cartData = cartService.getCartMoney(loginUser, checkOutDto, storeId);
+        List<CartVo> checkedGoodsList = (List<CartVo>) cartData.get("cartList");
+//        Map param = Maps.newHashMap();
+//        param.put("user_id", loginUser.getId());
+//        param.put("store_id", storeId);
+//        param.put("checked", 1);
+//        param.put("checkCart", checkCart);
+//        List<CartVo> checkedGoodsList = apiCartMapper.queryList(param);
+        if (null == checkedGoodsList) {
+            resultObj.put("errno", 400);
+            resultObj.put("errmsg", "请选择商品");
+            logger.error("请选择商品");
+            return resultObj;
+        }
+
         checkOutDto.setCartData(cartData);
         Map<String, Object> cartResultObj = cartService.getCheckOut(checkOutDto);
 
@@ -346,6 +355,8 @@ public class ApiOrderService {
         Boolean isBizType10 =  (Boolean) cartResultObj.get("isBizType10");
         Boolean isBizType11 =  (Boolean) cartResultObj.get("isBizType11");
 
+        // 检查库存和更新库存
+        checkStock(checkedGoodsList, storeId, userName);
 
         List<OrderVo> orderInfoList = new ArrayList();
         String merchOrderSn = "EMATO" + CommonUtil.generateOrderNumber();
@@ -406,20 +417,34 @@ public class ApiOrderService {
                             logger.error("订单提交失败:商品不存在");
                             throw new RRException("订单提交失败:商品不存在");
                         }
-                        OrderGoodsVo orderGoodsVo = setOrderGoodsVo(orderInfo, goodsItem, goodsVo);
+                        OrderGoodsVo orderGoodsVo = setOrderGoodsVo(orderInfo, cartResultObj, goodsItem, goodsVo);
                         apiOrderGoodsMapper.save(orderGoodsVo);
-
-                        Integer cartId = Integer.parseInt(String.valueOf(goodsItem.getId()));
-                        //更新渠道追踪统计下单量数据
-                        apiMkStorePromStatService.updateMkStorePromStat(orderGoodsVo, orderInfo, loginUser, cartId);
+                        //购物车id为空,则提交订单是从商品详情页立即购买过来的
+                        if(goodsItem.getId() == null){
+                            MkStorePromVo mkStorePromVo = apiMkStorePromMapper.queryObjectByGoodsIdAndStoreId(Integer.parseInt(String.valueOf(goodsItem.getGoods_id())),
+                                    Integer.parseInt(String.valueOf(storeId)));
+                            if(mkStorePromVo != null){
+                                MkStorePromStatVo statVo = apiMkStorePromStatService.queryObjectByPromId(mkStorePromVo.getPromId());
+                                if(statVo != null){
+                                    apiMkStorePromStatService.updateStorePromStat(orderGoodsVo, orderInfo, loginUser, statVo);
+                                }
+                            }
+                        }else {
+                            Integer cartId = Integer.parseInt(String.valueOf(goodsItem.getId()));
+                            //更新渠道追踪统计下单量数据
+                            apiMkStorePromStatService.updateMkStorePromStat(orderGoodsVo, orderInfo, loginUser, cartId);
+                        }
                     }
                 }
-                //记录优惠券活动营销统计下单量数据
-                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()+""));
@@ -432,8 +457,12 @@ public class ApiOrderService {
 
             orderProcessRecordMapper.saveBatch(processRecordEntityList);//新增订单流转信息
 
-            //清空已购买的商品
-            apiCartMapper.deleteByCart(loginUser.getId(), storeId, 1, checkCart);
+
+            //商品id不为空,则提交订单是从商品详情页立即购买过来的
+            if(goodsId == null) {
+                //清空已购买的商品
+                apiCartMapper.deleteByCart(loginUser.getId(), storeId, 1, checkCart);
+            }
 
             if (apiOrderMapper.queryCountByMerchOrderSn(merchOrderSn) > 1) {//不止一笔订单则为拆单订单
                 OrderVo orderVo = new OrderVo();
@@ -874,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());
@@ -890,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()));

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

@@ -36,7 +36,4 @@ public class ApiStoreService {
         return apiStoreMapper.queryNearbyList(map);
     }
 
-    public int updateStoreLoadGoodsById(StoreVo storeVo){
-        return apiStoreMapper.updateStoreLoadGoodsById(storeVo);
-    }
 }

+ 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;

+ 20 - 16
kmall-api/src/main/java/com/kmall/api/service/mk/ApiMkStorePromStatService.java

@@ -69,22 +69,26 @@ public class ApiMkStorePromStatService {
         Integer goodsId = Integer.parseInt(String.valueOf(orderGoodsVo.getGoods_id()));
         MkStorePromStatVo statVo = mkStorePromStatMapper.queryStatDataByCartIdAndGoodsId(cartId, goodsId);
         if(statVo != null){
-            MkStorePromOrderRealVo orderRealVo = new MkStorePromOrderRealVo();
-            orderRealVo.setOrderId(Integer.parseInt(String.valueOf(orderInfo.getId())));
-            orderRealVo.setOrderGoodsId(Integer.parseInt(String.valueOf(orderGoodsVo.getId())));
-            orderRealVo.setModTime(new Date());
-            orderRealVo.setPromOrderRealId(statVo.getPromOrderRealId());
-            orderRealVo.setUserId(Integer.parseInt(String.valueOf(loginUser.getId())));
-            apiMkStorePromOrderRealService.update(orderRealVo);
-
-            MkStorePromStatVo mkStorePromStatVo = new MkStorePromStatVo();
-            //获取推广订单关联表中根据推广id查询下单人数
-            Integer submitNum = apiMkStorePromOrderRealService.querySubmitNumByPromId(statVo.getPromId());
-            Integer submitOrdNum = apiMkStorePromOrderRealService.querySubmitOrderNumByPromId(statVo.getPromId());
-            mkStorePromStatVo.setSubmitNum(submitNum == null ? 0 : submitNum);//下单人数
-            mkStorePromStatVo.setSubmitOrderNum(submitOrdNum);//下单单数
-            mkStorePromStatVo.setPromStatId(statVo.getPromStatId());
-            mkStorePromStatMapper.update(mkStorePromStatVo);
+            updateStorePromStat(orderGoodsVo, orderInfo, loginUser, statVo);
         }
     }
+
+    public void updateStorePromStat(OrderGoodsVo orderGoodsVo, OrderVo orderInfo, UserVo loginUser, MkStorePromStatVo statVo){
+        MkStorePromOrderRealVo orderRealVo = new MkStorePromOrderRealVo();
+        orderRealVo.setOrderId(Integer.parseInt(String.valueOf(orderInfo.getId())));
+        orderRealVo.setOrderGoodsId(Integer.parseInt(String.valueOf(orderGoodsVo.getId())));
+        orderRealVo.setModTime(new Date());
+        orderRealVo.setPromOrderRealId(statVo.getPromOrderRealId());
+        orderRealVo.setUserId(Integer.parseInt(String.valueOf(loginUser.getId())));
+        apiMkStorePromOrderRealService.update(orderRealVo);
+
+        MkStorePromStatVo mkStorePromStatVo = new MkStorePromStatVo();
+        //获取推广订单关联表中根据推广id查询下单人数
+        Integer submitNum = apiMkStorePromOrderRealService.querySubmitNumByPromId(statVo.getPromId());
+        Integer submitOrdNum = apiMkStorePromOrderRealService.querySubmitOrderNumByPromId(statVo.getPromId());
+        mkStorePromStatVo.setSubmitNum(submitNum == null ? 0 : submitNum);//下单人数
+        mkStorePromStatVo.setSubmitOrderNum(submitOrdNum);//下单单数
+        mkStorePromStatVo.setPromStatId(statVo.getPromStatId());
+        mkStorePromStatMapper.update(mkStorePromStatVo);
+    }
 }

+ 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">

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

@@ -139,7 +139,7 @@
         mb.is_stock_share isStockShare,
         mb.is_supplier_goods 'isSupplierGoods',
         mb2.third_party_merch_code 'supplierThirdMerchCode',
-        mb2.is_stock_share 'isStockShareBySuppler'
+        mb2.is_stock_share 'isStockShareBySuppler',psr1.product_id
         from mall_goods a left join mall_merch m on a.merch_sn = m.merch_sn
         LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id and a.merch_sn = psr1.merch_sn
         LEFT JOIN mall_store s ON s.id = psr1.store_id

+ 17 - 2
kmall-api/src/main/resources/mybatis/mapper/ApiMerchUserMapper.xml

@@ -13,6 +13,7 @@
         <result property="moderSn" column="moder_sn"/>
         <result property="modTime" column="mod_time"/>
         <result property="tstm" column="tstm"/>
+		<result property="isLoadGoods" column="is_load_goods"/>
     </resultMap>
 
 	<select id="queryObject" resultType="com.kmall.api.entity.MerchUserVo">
@@ -25,12 +26,13 @@
 			`create_time`,
 			`moder_sn`,
 			`mod_time`,
+			is_load_goods,
 			`tstm`
 		from mall_merch_user
 		where id = #{id}
 	</select>
 
-	<select id="queryObjectByStoreId" resultType="com.kmall.api.entity.MerchUserVo">
+	<select id="queryObjectByStoreId" resultMap="merchUserMap">
 		select
 		`id`,
 		`merch_sn`,
@@ -40,12 +42,13 @@
 		`create_time`,
 		`moder_sn`,
 		`mod_time`,
+		is_load_goods,
 		`tstm`
 		from mall_merch_user
 		where store_id = #{storeId} and user_id = #{userId}
 	</select>
 
-	<select id="queryList" resultType="com.kmall.api.entity.MerchUserVo">
+	<select id="queryList" resultMap="merchUserMap">
 		select
     		`id`,
     		`merch_sn`,
@@ -55,6 +58,7 @@
     		`create_time`,
     		`moder_sn`,
     		`mod_time`,
+			is_load_goods,
     		`tstm`
 		from mall_merch_user
 		WHERE 1=1
@@ -87,6 +91,7 @@
 			`merch_sn`,
 			`store_id`,
 			`user_id`,
+			is_load_goods,
 			`creater_sn`,
 			`create_time`,
 			`moder_sn`,
@@ -96,6 +101,7 @@
 			#{merchSn},
 			#{storeId},
 			#{userId},
+			#{isLoadGoods},
 			#{createrSn},
 			#{createTime},
 			#{moderSn},
@@ -109,6 +115,7 @@
 			<if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
 			<if test="storeId != null">`store_id` = #{storeId}, </if>
 			<if test="userId != null">`user_id` = #{userId}, </if>
+			<if test="isLoadGoods != null">`is_load_goods` = #{isLoadGoods}, </if>
 			<if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
 			<if test="createTime != null">`create_time` = #{createTime}, </if>
 			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
@@ -128,5 +135,13 @@
 			#{id}
 		</foreach>
 	</delete>
+	<update id="updateStoreLoadGoodsById" parameterType="com.kmall.api.entity.StoreVo">
+		update mall_merch_user
+		<set>
+			<if test="isLoadGoods != null">`is_load_goods` = #{isLoadGoods}, </if>
+			mod_time = now()
+		</set>
+		where store_id = #{storeId} and user_id = #{userId}
+	</update>
 
 </mapper>

+ 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>
 

+ 1 - 12
kmall-api/src/main/resources/mybatis/mapper/ApiStoreMapper.xml

@@ -37,7 +37,6 @@
 			`latitude`,
 			`longitude`,
 			`cover_radius`,
-			is_load_goods,
 			`remark`,
 			merch_sn,
 			merch_name,
@@ -64,8 +63,7 @@
         merch_sn,
         merch_name,
         third_party_merch_code,
-        third_party_merch_name,
-        is_load_goods
+        third_party_merch_name
         from mall_store
         WHERE 1=1  and is_valid = 0
         <if test="province_name != null and province_name.trim() != ''">
@@ -165,7 +163,6 @@
             *pow(sin((a.longitude*pi()/180-#{longitude}*pi()/180)/2),2)))*1000) as distance,
         merch_sn,
         merch_name,
-        is_load_goods,
         third_party_merch_code,
         third_party_merch_name
         from mall_store a
@@ -189,13 +186,5 @@
         order by distance asc
         limit 0, 10
     </select>
-    <update id="updateStoreLoadGoodsById" parameterType="com.kmall.api.entity.StoreVo">
-        update mall_store
-        <set>
-            <if test="isLoadGoods != null">`is_load_goods` = #{isLoadGoods}, </if>
-            mod_time = now()
-        </set>
-        where id = #{id}
-    </update>
 
 </mapper>

+ 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)
     }
   })