Kaynağa Gözat

小程序清空购物车、订单、打印代码修改

hyq 6 yıl önce
ebeveyn
işleme
b5a0b6d937
33 değiştirilmiş dosya ile 429 ekleme ve 95 silme
  1. 1 7
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java
  2. 2 2
      kmall-admin/src/main/resources/conf/common.properties
  3. 33 6
      kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java
  4. 2 2
      kmall-api/src/main/java/com/kmall/api/api/ApiOrderController.java
  5. 3 0
      kmall-api/src/main/java/com/kmall/api/dao/ApiCartMapper.java
  6. 2 0
      kmall-api/src/main/java/com/kmall/api/dao/ApiProductMapper.java
  7. 20 0
      kmall-api/src/main/java/com/kmall/api/entity/OrderProcessRecordEntity.java
  8. 12 2
      kmall-api/src/main/java/com/kmall/api/entity/OrderVo.java
  9. 14 8
      kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java
  10. 68 3
      kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java
  11. 6 6
      kmall-api/src/main/java/com/kmall/api/service/ApiPayService.java
  12. 3 0
      kmall-api/src/main/java/com/kmall/api/service/ApiProductService.java
  13. 42 3
      kmall-api/src/main/resources/mybatis/mapper/ApiCartMapper.xml
  14. 2 2
      kmall-api/src/main/resources/mybatis/mapper/ApiCollectMapper.xml
  15. 3 2
      kmall-api/src/main/resources/mybatis/mapper/ApiFootprintMapper.xml
  16. 3 3
      kmall-api/src/main/resources/mybatis/mapper/ApiGoodsMapper.xml
  17. 5 1
      kmall-api/src/main/resources/mybatis/mapper/ApiOrderProcessRecordMapper.xml
  18. 19 0
      kmall-api/src/main/resources/mybatis/mapper/ApiProductMapper.xml
  19. 8 1
      kmall-common/src/main/java/com/kmall/common/utils/print/ticket/TicketPrintUtil.java
  20. 1 1
      kmall-schedule/src/main/resources/mybatis/mapper/QzOrderMapper.xml
  21. 2 1
      wx-mall/config/api.js
  22. 22 2
      wx-mall/pages/cart/cart.js
  23. 34 1
      wx-mall/pages/cart/cart.wxml
  24. 30 3
      wx-mall/pages/cart/cart.wxss
  25. 2 0
      wx-mall/pages/catalog/catalog.js
  26. 4 4
      wx-mall/pages/catalog/catalog.wxml
  27. 17 8
      wx-mall/pages/goods/goods.wxml
  28. 38 0
      wx-mall/pages/goods/goods.wxss
  29. 5 2
      wx-mall/pages/hotGoods/hotGoods.js
  30. 2 2
      wx-mall/pages/hotGoods/hotGoods.wxml
  31. 3 3
      wx-mall/pages/index/index.wxml
  32. 3 3
      wx-mall/pages/ucenter/footprint/footprint.wxml
  33. 18 17
      wx-mall/pages/ucenter/order/order.js

+ 1 - 7
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -226,13 +226,7 @@ public class OrderServiceImpl implements OrderService {
         cusListing.setOriginAddress(PrintTicketPropertiesBuilder.instance().getAddress());
         cusListing.setDeliveryAddress(storeEntity.getStoreAddress());
 
-        // 小票脚
-        TicketFoot foot = new TicketFoot();
-        foot.setSummary(PrintTicketPropertiesBuilder.instance().getSummary());
-        foot.setServiceTel(PrintTicketPropertiesBuilder.instance().getServiceTel());
-        foot.setUrl1(PrintTicketPropertiesBuilder.instance().getUrl1());
-
-        return TicketPrintUtil.print(head, goodsList, cashInfo, cusListing, foot);
+        return TicketPrintUtil.print(head, goodsList, cashInfo, cusListing);
     }
     /**
      * 飞鸽打印

+ 2 - 2
kmall-admin/src/main/resources/conf/common.properties

@@ -13,7 +13,7 @@ yunpian.sms.url=https://sms.yunpian.com/v2/sms/single_send.json
 
 ##########  身份证认证配置 ##########
 #apikey
-id.card.apikey=1dd75986321871d706334e60b89c4022
+id.card.apikey=111
 
 #url
-id.card.url=https://sms.yunpian.com/v2/sms/single_send.json
+id.card.url=https://111

+ 33 - 6
kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java

@@ -100,6 +100,8 @@ public class ApiCartController extends ApiBaseAction {
         Long storeId = getStoreId();
         param.put("store_id", storeId);
         List<CartVo> cartList = cartService.queryList(param);
+
+        List<CartVo> validCartList = cartService.queryValidCartList(param);
         //获取购物车统计信息
         Integer goodsCount = 0;
         BigDecimal goodsAmount = new BigDecimal(0.00);
@@ -161,6 +163,7 @@ public class ApiCartController extends ApiBaseAction {
         resultObj.put("cart10List", cart10List);
         resultObj.put("cart11List", cart11List);
         resultObj.put("cartList", cartList);
+        resultObj.put("validCartList", validCartList);
         //
         Map<String, Object> cartTotal = new HashMap();
         cartTotal.put("goodsCount", goodsCount);
@@ -227,13 +230,13 @@ public class ApiCartController extends ApiBaseAction {
         //判断商品是否可以购买
         GoodsVo goodsInfo = goodsService.queryObject(goodsId);
         if (null == goodsInfo || goodsInfo.getIs_delete() == 1) {
-            return this.toResponsObject(400, "商品已下架", "");
+            return toResponsFail("商品已下架");
         }
         Long storeId = getStoreId();
         //取得规格的信息,判断规格库存
         ProductVo productInfo = productService.queryObjectByStoreId(productId, storeId);
         if (null == productInfo) {
-            return this.toResponsObject(400, "商品已下架", "");
+            return toResponsFail("商品已下架");
         }
         if (null == productInfo.getRetail_price()) {
             productInfo.setRetail_price(goodsInfo.getRetail_price());
@@ -286,7 +289,7 @@ public class ApiCartController extends ApiBaseAction {
         //判断商品是否可以购买
         GoodsVo goodsInfo = goodsService.queryObject(goodsId);
         if (null == goodsInfo || goodsInfo.getIs_delete() == 1) {
-            return this.toResponsObject(400, "商品已下架", "");
+            return toResponsFail("商品已下架");
         }
         Long storeId = getStoreId();
         Map resultObj = cartService.addByGoodsId(getUserId(), goodsId, storeId);
@@ -310,14 +313,17 @@ public class ApiCartController extends ApiBaseAction {
             //判断商品是否可以购买
             GoodsVo goodsInfo = goodsService.queryObject(goodsVo.getGoods_id());
             if (null == goodsInfo || goodsInfo.getIs_delete() == 1) {
-                return this.toResponsObject(400, "商品已下架", "");
+                return toResponsFail("商品已下架");
             }
         }
         Long storeId = getStoreId();
         for (OrderGoodsVo goodsVo : orderGoodsVos) {
-            ProductVo productInfo = productService.queryObjectByStoreId(goodsVo.getProduct_id(), storeId);
+            ProductVo productInfo = productService.queryByStoreId(goodsVo.getProduct_id(), storeId);
             if (null == productInfo) {
-                return this.toResponsObject(400, "商品已下架", "");
+                return toResponsFail("商品已下架");
+            }
+            if(productInfo.getStock_num() == null || goodsVo.getNumber() > productInfo.getStock_num() || productInfo.getStock_num() == 0){
+                return toResponsFail("该商品暂无库存");
             }
             CartVo cartInfo = new CartVo();
             cartInfo.setGoods_id(goodsVo.getGoods_id());
@@ -674,4 +680,25 @@ public class ApiCartController extends ApiBaseAction {
         return toResponsSuccess(map);
     }
 
+    /**
+     * 清空购物车失效商品
+     * @return
+     */
+    @GetMapping("deleteValidCart")
+    public Object deleteValidCart() {
+        try{
+            Map param = new HashMap();
+            param.put("user_id", getUserId());
+            Long storeId = getStoreId();
+            param.put("store_id", storeId);
+            List<CartVo> list = cartService.queryValidCartList(param);
+            for (CartVo cart: list) {
+                cartService.delete(cart.getId());
+            }
+            return toResponsSuccess(getCart());
+        }catch (Exception e){
+            return toResponsFail("清空失败");
+        }
+    }
+
 }

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/api/ApiOrderController.java

@@ -80,7 +80,6 @@ public class ApiOrderController extends ApiBaseAction {
         Query query = new Query(params);
         List<OrderVo> orderEntityList = orderService.queryList(query);
         int total = orderService.queryTotal(query);
-        ApiPageUtils pageUtil = new ApiPageUtils(orderEntityList, total, query.getLimit(), query.getPage());
         //
         for (OrderVo item : orderEntityList) {
             Map orderGoodsParam = new HashMap();
@@ -105,6 +104,7 @@ public class ApiOrderController extends ApiBaseAction {
             }
             item.setGoodsList(goodsList);
         }
+        ApiPageUtils pageUtil = new ApiPageUtils(orderEntityList, total, query.getLimit(), query.getPage());
         return toResponsSuccess(pageUtil);
     }
 
@@ -255,7 +255,7 @@ public class ApiOrderController extends ApiBaseAction {
                     orderService.cancelOrder(orderVo);
                     return toResponsMsgSuccess("取消成功");
                 } else {
-                    return toResponsObject(400, "取消失败", "");
+                    return toResponsFail("取消失败");
                 }
             } else {
                 orderVo.setOrder_status(101);

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

@@ -6,6 +6,7 @@ import com.kmall.common.dao.BaseDao;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author Scott
@@ -22,4 +23,6 @@ public interface ApiCartMapper extends BaseDao<CartVo> {
     void deleteByCart(@Param("user_id") Long user_id, @Param("store_id") Long store_id, @Param("checked") Integer checked);
 
     List<CartVo> queryCartByGoodsBizType(@Param("goodsBizType") String goodsBizType);
+
+    List<CartVo> queryValidCartList(Map<String, Object> map);
 }

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

@@ -23,6 +23,8 @@ public interface ApiProductMapper extends BaseDao<ProductVo> {
      */
     ProductVo queryOneByGoodsId(@Param("goods_id") Long goods_id, @Param("store_id") Long store_id);
 
+    ProductVo queryByStoreId(@Param("id") Long id, @Param("store_id") Long store_id);
+
     /**
      * 更新库存
      *

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

@@ -101,6 +101,26 @@ public class OrderProcessRecordEntity implements Serializable {
 
     private String orderBizType;
 
+    private String invtNo;
+
+    private String logisticsNo;
+
+    public String getInvtNo() {
+        return invtNo;
+    }
+
+    public void setInvtNo(String invtNo) {
+        this.invtNo = invtNo;
+    }
+
+    public String getLogisticsNo() {
+        return logisticsNo;
+    }
+
+    public void setLogisticsNo(String logisticsNo) {
+        this.logisticsNo = logisticsNo;
+    }
+
     public String getOrderBizType() {
         return orderBizType;
     }

+ 12 - 2
kmall-api/src/main/java/com/kmall/api/entity/OrderVo.java

@@ -167,6 +167,16 @@ public class OrderVo implements Serializable {
 
     private String approvalRemark;
 
+    private String stockNum;
+
+    public String getStockNum() {
+        return stockNum;
+    }
+
+    public void setStockNum(String stockNum) {
+        this.stockNum = stockNum;
+    }
+
     public String getApprovalRemark() {
         return approvalRemark;
     }
@@ -187,8 +197,8 @@ public class OrderVo implements Serializable {
         return isRefundStatus;
     }
 
-    public void setIsRefundStatus(Boolean refundStatus) {
-        isRefundStatus = refundStatus;
+    public void setIsRefundStatus(Boolean isRefundStatus) {
+        this.isRefundStatus = isRefundStatus;
     }
 
     public String getStoreName() {

+ 14 - 8
kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java

@@ -39,6 +39,9 @@ public class ApiCartService {
         return cartDao.queryList(map);
     }
 
+    public List<CartVo> queryValidCartList(Map<String, Object> map) {
+        return cartDao.queryValidCartList(map);
+    }
 
     public int queryTotal(Map<String, Object> map) {
         return cartDao.queryTotal(map);
@@ -56,14 +59,18 @@ public class ApiCartService {
         Map crashParam = new HashMap();
         List<Long> goods_ids = new ArrayList();
         List<CartVo> cartUpdateList = new ArrayList();
-        for (CartVo cartItem : cartInfoList) {
-            if (null != cartItem.getChecked() && 1 == cartItem.getChecked()) {
-                goods_ids.add(cartItem.getGoods_id());
-            }
-            if (!cartItem.getRetail_price().equals(cartItem.getRetail_product_price())) {
-                cartItem.setRetail_price(cartItem.getRetail_product_price());
-                cartUpdateList.add(cartItem);
+        if(cartInfoList != null && cartInfoList.size() > 0) {
+            for (CartVo cartItem : cartInfoList) {
+                if (null != cartItem.getChecked() && 1 == cartItem.getChecked()) {
+                    goods_ids.add(cartItem.getGoods_id());
+                }
+                if (!cartItem.getRetail_price().equals(cartItem.getRetail_product_price())) {
+                    cartItem.setRetail_price(cartItem.getRetail_product_price());
+                    cartUpdateList.add(cartItem);
+                }
             }
+        }else{
+            goods_ids.add(cart.getGoods_id());
         }
         crashParam.put("store_id", cart.getStore_id());
         crashParam.put("goods_ids", goods_ids);
@@ -102,7 +109,6 @@ public class ApiCartService {
         cartDao.delete(id);
     }
 
-
     public void deleteBatch(Integer[] ids) {
         cartDao.deleteBatch(ids);
     }

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

@@ -10,9 +10,12 @@ import com.kmall.common.dao.TemplateConfDao;
 import com.kmall.common.entity.FormIdsEntity;
 import com.kmall.common.entity.TemplateConfVo;
 import com.kmall.common.service.FormIdsService;
+import com.kmall.common.service.print.ticket.PrintTicketPropertiesBuilder;
 import com.kmall.common.utils.DateUtils;
 import com.kmall.common.utils.RRException;
 import com.kmall.common.utils.StringUtils;
+import com.kmall.common.utils.print.ticket.TicketPrintUtil;
+import com.kmall.common.utils.print.ticket.item.*;
 import com.kmall.common.utils.printer.FeiGeUtils;
 import com.kmall.common.utils.wxtemplate.TemplateData;
 import com.kmall.common.utils.wxtemplate.WxTemplate;
@@ -57,6 +60,8 @@ public class ApiOrderService {
     private ApiFreightService apiFreightService;
     @Autowired
     private ApiOrderProcessRecordMapper orderProcessRecordMapper;
+    @Autowired
+    private ApiStoreMapper apiStoreMapper;
 
     public OrderVo queryObject(Long id) {
         return apiOrderMapper.queryObject(id);
@@ -163,7 +168,7 @@ public class ApiOrderService {
         List<ProductVo> productVos = new ArrayList();
         for (CartVo goodsItem : checkedGoodsList) {
             //取得规格的信息,判断规格库存
-            ProductVo productInfo = apiProductMapper.queryObjectByStoreId(goodsItem.getProduct_id(), storeId);
+            ProductVo productInfo = apiProductMapper.queryByStoreId(goodsItem.getProduct_id(), storeId);
             if (null == productInfo || null == productInfo.getStock_num() || productInfo.getStock_num() < goodsItem.getNumber()) {
                 resultObj.put("errno", 400);
                 resultObj.put("errmsg", "库存不足,仅剩余" + productInfo.getStock_num());
@@ -623,7 +628,7 @@ public class ApiOrderService {
         apiOrderMapper.update(orderVo);
     }
 
-    public String printMsg(Long orderId) {
+    /*public String printMsgs(Long orderId) {
         OrderVo orderEntity = queryObject(orderId);
         Map<String, Object> map = new HashMap<String, Object>();
 
@@ -668,6 +673,67 @@ public class ApiOrderService {
             sn = printerEntities.get(0).getSn();
         }
         return FeiGeUtils.printMsg(sn, content, "1");
+    }*/
+    public Ticket printMsg(Long orderId) {
+        OrderVo orderEntity = queryObject(orderId);
+        if(orderEntity != null) {
+            if (orderEntity.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())
+                    || orderEntity.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem())) {
+                Map<String, Object> map = new HashMap<String, Object>();
+                map.put("order_id", orderEntity.getId());
+                List<OrderGoodsVo> orderGoodsEntityList = apiOrderGoodsMapper.queryList(map);
+                // 获取门店
+                StoreVo storeEntity = apiStoreMapper.queryObject(orderEntity.getStore_id());
+                // 获取清关信息
+                OrderProcessRecordEntity orderProcessRecordEntity = orderProcessRecordMapper.queryObjectByOrderSn(orderEntity.getOrder_sn());
+
+                UserVo userVo = apiUserMapper.queryObject(orderEntity.getUser_id());
+                // 小票头
+                TicketHead head = new TicketHead();
+                head.setTitle(OmsMerchPropertiesBuilder.instance().getMerchName() + storeEntity.getStoreName());
+                head.setMemberId(userVo.getUsername().toString());
+                head.setOrderId(orderEntity.getOrder_sn());
+                head.setTradeTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss EEE").format(new Date()));
+
+                // 商品信息
+                Integer goodsTotal = 0; // 商品总个数
+                BigDecimal total = new BigDecimal(0); // 商品总计
+                List<Goods> goodsList = new ArrayList<>();
+                for (OrderGoodsVo orderGoods : orderGoodsEntityList) {
+                    goodsTotal += orderGoods.getNumber();
+                    total = total.add(orderGoods.getRetail_price().subtract(new BigDecimal(orderGoods.getNumber()))).setScale(2, BigDecimal.ROUND_HALF_UP);
+                    Goods goods = new Goods(orderGoods.getGoods_name(), orderGoods.getRetail_price().toString(), orderGoods.getNumber().toString(),
+                            orderGoods.getRetail_price().multiply(new BigDecimal(orderGoods.getNumber()).setScale(2, BigDecimal.ROUND_HALF_UP)).toString());
+                    goodsList.add(goods);
+                }
+
+                // 收银信息
+                CashInfo cashInfo = new CashInfo();
+                cashInfo.setGoodsTotal(goodsTotal.toString());
+                cashInfo.setTotal(total.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
+                cashInfo.setReceipts(orderEntity.getActual_price().setScale(2, BigDecimal.ROUND_HALF_UP).toString());
+                cashInfo.setOddChange("0.00");
+                cashInfo.setCoupon(orderEntity.getCoupon_price().setScale(2, BigDecimal.ROUND_HALF_UP).toString());
+                cashInfo.setFreight(new BigDecimal(orderEntity.getFreight_price()).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
+                cashInfo.setPaymentMode("微信支付");
+
+                // 海关清单
+                CusListing cusListing = new CusListing();
+                cusListing.setOrderId(orderEntity.getOrder_sn());
+                cusListing.setWaybillId(orderProcessRecordEntity.getLogisticsNo());
+                cusListing.setInvtNo(orderProcessRecordEntity.getInvtNo());
+                cusListing.setConsignee(orderEntity.getConsignee());
+                cusListing.setConsigneeTel(orderEntity.getMobile());
+                cusListing.setOriginAddress(PrintTicketPropertiesBuilder.instance().getAddress());
+                cusListing.setDeliveryAddress(storeEntity.getStoreAddress());
+
+                return TicketPrintUtil.print(head, goodsList, cashInfo, cusListing);
+            }else{
+                return null;
+            }
+        }else{
+            return null;
+        }
     }
 
     public List<OrderVo> queryObjectByIdList(List<Long> orderIdList){
@@ -676,6 +742,5 @@ public class ApiOrderService {
 
     public List<OrderVo> queryObjectByMerchOrderSn(String merchOrderSn){
         return apiOrderMapper.queryObjectByMerchOrderSn(merchOrderSn);
-
     }
 }

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

@@ -180,12 +180,12 @@ public class ApiPayService {
                     // 微信支付成功通知
                     orderService.notifyPaySuccess(orderInfo);
 
-                    // 打印机打印 todo 等待实现调用
-//                    try {
-//                        orderService.printMsg(orderInfo.getId());
-//                    } catch (Exception e) {
-//                        logger.error("打印机打印异常【" + e.getMessage() + "】");
-//                    }
+                    // 打印机打印
+                    try {
+                        orderService.printMsg(orderInfo.getId());
+                    } catch (Exception e) {
+                        logger.error("打印机打印异常【" + e.getMessage() + "】");
+                    }
                 }
             }
         }

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

@@ -23,6 +23,9 @@ public class ApiProductService {
         return productDao.queryObjectByStoreId(productId, storeId);
     }
 
+    public ProductVo queryByStoreId(Long productId, Long storeId) {
+        return productDao.queryByStoreId(productId, storeId);
+    }
 
     public List<ProductVo> queryList(Map<String, Object> map) {
         return productDao.queryList(map);

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

@@ -26,7 +26,7 @@
         <result column="moder_sn" property="moderSn" jdbcType="VARCHAR" />
         <result column="mod_time" property="modTime" jdbcType="TIMESTAMP" />
         <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
-        <result property="stockNum" column="stock_num"/>
+        <result property="stockNum" column="productStockNum"/>
     </resultMap>
 
     <sql id="Base_Column_List" >
@@ -45,12 +45,52 @@
     <select id="queryList" resultMap="cartMap">
         select a.*,
         b.list_pic_url as list_pic_url,
-        psr.retail_price as retail_product_price
+        psr.retail_price as retail_product_price,psr.stock_num 'productStockNum'
         from mall_cart a
         left join mall_goods b on a.goods_id = b.id
         left join mall_product c on c.goods_id = a.goods_id and c.id = a.product_id
         left join mall_product_store_rela psr on psr.product_id = c.id and psr.store_id = #{store_id}
         where 1 = 1
+        and psr.stock_num > 0
+        <if test="user_id != null">
+            AND a.user_id = #{user_id}
+        </if>
+        <if test="goods_id != null">
+            AND a.goods_id = #{goods_id}
+        </if>
+        <if test="product_id != null">
+            AND a.product_id = #{product_id}
+        </if>
+        <if test="store_id != null">
+            AND psr.store_id = #{store_id}
+        </if>
+        <if test="checked != null">
+            AND a.checked = #{checked}
+        </if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+            <otherwise>
+                order by a.id desc
+            </otherwise>
+        </choose>
+        <if test="offset != null and limit != null">
+            limit #{offset}, #{limit}
+        </if>
+    </select>
+
+
+    <select id="queryValidCartList" resultMap="cartMap">
+        select a.*,
+        b.list_pic_url as list_pic_url,
+        psr.retail_price as retail_product_price,psr.stock_num 'productStockNum'
+        from mall_cart a
+        left join mall_goods b on a.goods_id = b.id
+        left join mall_product c on c.goods_id = a.goods_id and c.id = a.product_id
+        left join mall_product_store_rela psr on psr.product_id = c.id and psr.store_id = #{store_id}
+        where 1 = 1
+        and psr.stock_num = 0
         <if test="user_id != null">
             AND a.user_id = #{user_id}
         </if>
@@ -333,5 +373,4 @@
         delete from mall_cart
         where  user_id = #{user_id} and store_id = #{store_id} and  checked = #{checked}
     </delete>
-
 </mapper>

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

@@ -26,7 +26,7 @@
         select c.*,g.name, g.list_pic_url as list_pic_url, g.goods_brief as goods_brief, psr1.retail_price as retail_price
         from mall_collect c
         left join mall_goods g on c.value_id = g.id
-        LEFT JOIN mall_product_store_rela psr1 ON g.id = psr1.goods_id AND g.primary_product_id = psr1.product_id
+        LEFT JOIN mall_product_store_rela psr1 ON g.id = psr1.goods_id
         where 1 = 1 and psr1.id is not null
         <if test="user_id != null and user_id != ''">
             and c.user_id = #{user_id}
@@ -57,7 +57,7 @@
         select count(*)
         from mall_collect c
         left join mall_goods g on c.value_id = g.id
-        LEFT JOIN mall_product_store_rela psr1 ON g.id = psr1.goods_id AND g.primary_product_id = psr1.product_id
+        LEFT JOIN mall_product_store_rela psr1 ON g.id = psr1.goods_id
         where 1 = 1 and psr1.id is not null
         <if test="user_id != null and user_id != ''">
             and c.user_id = #{user_id}

+ 3 - 2
kmall-api/src/main/resources/mybatis/mapper/ApiFootprintMapper.xml

@@ -32,8 +32,9 @@
             and max.add_time > f.add_time
         </if>
         left join mall_goods g on f.goods_id = g.id
-        LEFT JOIN mall_product_store_rela psr ON psr.product_id = g.primary_product_id
+        LEFT JOIN mall_product_store_rela psr ON psr.goods_id = g.id
         <where>
+            1=1 and psr.stock_num >0
             <if test="user_id != null">
                 and f.user_id = #{user_id}
             </if>
@@ -129,7 +130,7 @@
         from mall_footprint f
         left join mall_goods g on f.goods_id = g.id
         left join mall_user u on u.id = f.user_id
-        LEFT JOIN mall_product_store_rela psr ON psr.product_id = g.primary_product_id
+        LEFT JOIN mall_product_store_rela psr ON psr.goods_id = g.id
         <where>
             u.id is not null
             <if test="user_id != null">

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

@@ -98,7 +98,7 @@
         psr1.stock_num,
         a.goods_desc,a.goods_biz_type,a.goods_rate
         from mall_goods a
-        LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id AND a.primary_product_id = psr1.product_id
+        LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id
         where a.id = #{id} and psr1.store_id = #{storeId}
     </select>
 
@@ -179,7 +179,7 @@
             a.*,b.id as product_id
         </if>
         from mall_goods a
-        LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id AND a.primary_product_id = psr1.product_id
+        LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id
         LEFT JOIN mall_product b ON b.id = psr1.product_id
         where 1 = 1 and b.id is not null and psr1.stock_num > 0 and a.is_delete != 1 and psr1.retail_price is not null and a.is_on_sale = 1
         <if test="is_new != null and is_new != ''">
@@ -235,7 +235,7 @@
         </if>
         FROM
         mall_goods a
-        LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id AND a.primary_product_id = psr1.product_id
+        LEFT JOIN mall_product_store_rela psr1 ON a.id = psr1.goods_id
         LEFT JOIN mall_product b ON b.id = psr1.product_id
         <if test="is_group != null and is_group == true">
             left join mall_goods_group gg on gg.goods_id = a.id

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

@@ -26,6 +26,8 @@
         <result property="processContent" column="process_content"/>
         <result property="tstm" column="tstm"/>
 		<result column="order_biz_type" property="orderBizType"/>
+		<result column="invt_no" property="invtNo"/>
+		<result column="logistics_no" property="logisticsNo"/>
     </resultMap>
 
 	<select id="queryObject" resultType="com.kmall.api.entity.OrderProcessRecordEntity">
@@ -215,7 +217,9 @@
 		`shipment_start_time`,
 		`shipment_succ_time`,
 		`process_content`,
-		`tstm`
+		`tstm`,
+		`logistics_no`,
+		`invt_no`
 		from mall_order_process_record
 		where order_sn = #{orderSn}
 	</select>

+ 19 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiProductMapper.xml

@@ -45,6 +45,25 @@
         where b.stock_num is not null and b.stock_num > 0 and a.id = #{id} and b.store_id = #{store_id}
     </select>
 
+    <select id="queryByStoreId" resultMap="productMap">
+        SELECT
+        a.id,
+        a.goods_id,
+        a.goods_specification_ids,
+        a.goods_specification_name_value,
+        a.goods_sn,
+        a.goods_default,
+        b.sell_volume,
+        b.market_price,
+        b.retail_price,
+        b.store_id,
+        b.stock_num
+        FROM
+        mall_product a
+        LEFT JOIN mall_product_store_rela b ON a.id = b.product_id
+        where a.id = #{id} and b.store_id = #{store_id}
+    </select>
+
     <select id="queryOneByGoodsId" resultMap="productMap">
         SELECT
             a.id,

+ 8 - 1
kmall-common/src/main/java/com/kmall/common/utils/print/ticket/TicketPrintUtil.java

@@ -1,5 +1,6 @@
 package com.kmall.common.utils.print.ticket;
 
+import com.kmall.common.service.print.ticket.PrintTicketPropertiesBuilder;
 import com.kmall.common.utils.print.ticket.item.*;
 import com.kmall.common.utils.print.ticket.item.font.TicketCommonFont;
 import com.kmall.common.utils.print.ticket.item.font.TicketGoodsTitleFont;
@@ -10,7 +11,7 @@ import java.util.List;
 
 public class TicketPrintUtil {
 
-    public static Ticket print(TicketHead head, List<Goods> goods, CashInfo cashInfo, CusListing cusListing, TicketFoot foot) {
+    public static Ticket print(TicketHead head, List<Goods> goods, CashInfo cashInfo, CusListing cusListing) {
         //---------- 小票字体 ----------
         TicketHeadFont headFont = new TicketHeadFont();
         headFont.setFamily("宋体");
@@ -27,6 +28,12 @@ public class TicketPrintUtil {
         commonFont.setWeight(Font.PLAIN);
         commonFont.setSize(8);
 
+        // 小票脚
+        TicketFoot foot = new TicketFoot();
+        foot.setSummary(PrintTicketPropertiesBuilder.instance().getSummary());
+        foot.setServiceTel(PrintTicketPropertiesBuilder.instance().getServiceTel());
+        foot.setUrl1(PrintTicketPropertiesBuilder.instance().getUrl1());
+
         //---------- 组装小票 ----------
         Ticket ticket = new Ticket();
         ticket.setTicketHead(head);

+ 1 - 1
kmall-schedule/src/main/resources/mybatis/mapper/QzOrderMapper.xml

@@ -50,7 +50,7 @@
     <select id="queryRefundOrderList" resultType="map">
         select a.pay_transaction_id,a.merch_order_sn,a.order_sn,a.order_status,a.pay_status,f.out_refund_no,f.refund_id,f.order_id,f.id 'orderRefundId'
         from mall_order a
-        inner join mall_order_refund f on a.id = f.order_id	where (f.out_refund_no is null or f.refund_id is null) and a.order_status != '101' and f.refund_status != 3
+        inner join mall_order_refund f on a.id = f.order_id	where (f.out_refund_no is null or f.refund_id is null) and a.order_status != '101' and f.refund_status not in (1,3)
     </select>
 
     <select id="queryPayingOrderList" resultType="map">

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

@@ -2,7 +2,7 @@
 //开发环境
 //var NewApiRootUrl = 'http://localhost:8080/api/';
 //var NewApiRootUrl = 'http://192.168.1.138:8080/api/';
-//var NewApiRootUrl = 'http://qhdswl.f3322.net:9001/platform-framework/api/';//hyq
+// var NewApiRootUrl = 'http://qhdswl.f3322.net:9001/platform-framework/api/';//hyq
 var NewApiRootUrl = 'http://qhdswl.f3322.net:9000/api/';
 
 //测试环境
@@ -53,6 +53,7 @@ module.exports = {
     CartCheckout: NewApiRootUrl + 'cart/checkout', // 下单前信息确认
     CartCouponList: NewApiRootUrl + 'cart/checkedCouponList', // 选择用户可用优惠券
     GetFootCart: NewApiRootUrl + 'cart/getFootCart', // 底部购物车显示
+    deleteValidCart: NewApiRootUrl + 'cart/deleteValidCart', //清空购物车失效商品
 
     OrderSubmit: NewApiRootUrl + 'order/submit', // 提交订单
     PayPrepayId: NewApiRootUrl + 'pay/pay_prepay', //获取微信统一下单prepay_id

+ 22 - 2
wx-mall/pages/cart/cart.js

@@ -11,6 +11,7 @@ Page({
     cartGoods10: [],//现场速递数据
     cartGoods11: [],//普通商品
     cartGoods: [],
+    validCartList: [],
     goodsBizTypeList: ['保税仓','保税展示','现场速递','普通商品'],
     goodsBizType: '',//货品业务类型
     footprintList: [],
@@ -61,6 +62,7 @@ Page({
       cartGoods02: res.data.cart02List,
       cartGoods10: res.data.cart10List,
       cartGoods11: res.data.cart11List,
+      validCartList: res.data.validCartList,
       cartTotal: res.data.cartTotal,
       couponInfoList: res.data.couponInfoList
     });
@@ -297,7 +299,7 @@ Page({
     }, 'POST').then(function (res) {
       if (res.errno === 0) {
         console.log('that.data.mobile:' + res.data.mobile);
-        if (res.data.mobile == '') {
+        if (res.data.mobile == '' || res.data.mobile == null) {
           wx.showModal({
             title: '',
             confirmColor: '#b4282d',
@@ -353,7 +355,7 @@ Page({
           console.log('用户点击确定')
         }
       }
-    })
+    });
   },
   getFootprintList() {
     let that = this;
@@ -475,5 +477,23 @@ Page({
         util.showErrorToast(res.errmsg)
       }
     });
+  },
+  deleteValidCart: function () {//获取购物车数据
+    let that = this;
+    wx.showModal({
+      title: '',
+      content: '确定要清空所有失效商品?',
+      success: function (res) {
+        if (res.confirm) {
+          util.request(api.deleteValidCart).then(function (res) {
+            if (res.errno === 0) {
+              that.setCommonData(res);
+            } else {
+              util.showErrorToast(res.errmsg);
+            }
+          });
+        }
+      }
+    });
   }
 })

+ 34 - 1
wx-mall/pages/cart/cart.wxml

@@ -186,7 +186,40 @@
             </view>
           </view>
 
-          
+          </view>
+      </view>
+    </view>
+
+    <view class="list" wx:if="{{validCartList.length > 0}}">
+      <view class="group-item">
+        <view style='margin-left: 8rpx;margin-top: 8rpx;float:left;width:166px;'>
+          <text style='font-size:24rpx;color:rgba(87, 86, 86, 0.63);'>失效宝贝{{validCartList.length}}件</text>
+        </view>
+        <view style='float:right;width:90px;margin-top: 8rpx;' bindtap='deleteValidCart'>
+          <text style='font-size:24rpx;color:red;'>清空失效宝贝</text>
+        </view>
+        <view class="goods">
+          <view class="item" wx:for="{{validCartList}}" wx:key="{{item.id}}">
+            <view class="shixiao">失效</view>
+            <view class="cart-goods">
+              <navigator url="/pages/goods/goods?id={{item.goods_id}}">
+                <image class="img" src="{{item.list_pic_url}}"></image>
+              </navigator>
+              <view class="info">
+                <view class="t">
+                  <navigator url="/pages/goods/goods?id={{item.goods_id}}">
+                    <text class="name" style='color:rgba(87, 86, 86, 0.63);'>{{item.goods_name}} {{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}</text>
+                  </navigator>
+                </view>
+                <view class="number-item-text">
+                  商品已不能购买,请联系卖家
+                </view>
+                <!-- <view class="handle">
+                  找相似
+                </view> -->
+              </view>
+            </view>
+          </view>
           </view>
       </view>
     </view>

+ 30 - 3
wx-mall/pages/cart/cart.wxss

@@ -98,9 +98,10 @@ page {
 }
 
 .cart-view {
-  width: 100%;
+  width: 96%;
   height: auto;
   overflow: hidden;
+  margin-left: 14rpx;
 }
 
 .cart-view .list {
@@ -118,7 +119,7 @@ page {
 }
 
 .cart-view .item {
-  height: 240rpx;
+  height: 230rpx;
   width: 100%;
   overflow: hidden;
 }
@@ -652,6 +653,7 @@ page {
   margin-left: 24rpx;
   background: url(http://image.meiping123.com/upload/20180104/105653607bcb4b.png) no-repeat;
   background-size: 30rpx;
+  vertical-align: middle;
 }
 
 .checkbox-biz-type.checked {
@@ -665,7 +667,9 @@ page {
   /* margin-left: 15rpx;
   margin-top: 20rpx; 
   margin-bottom:-18rpx;*/
-  margin-left:60rpx;
+  margin-bottom:9rpx;
+  margin-left:40rpx;
+  vertical-align: middle;
 
 }
 
@@ -680,4 +684,27 @@ page {
   margin-left: 10rpx;
   font-weight: bolder;
   padding-bottom: 10rpx;
+  vertical-align: middle;
+}
+.number-item-text {
+  display: inline-flex;
+  -webkit-box-pack: justify;
+  align-items: center;
+  position: absolute;
+  /* right: 0; */
+  margin-right: 17rpx;
+  font-size: 26rpx;
+  color: black;
+}
+.shixiao {
+  float: left;
+  height: 34rpx;
+  margin: 65rpx 6rpx 65rpx 4rpx;
+  background-size: 34rpx;
+  background-color: rgba(87, 86, 86, 0.63);
+  border-radius:30rpx;
+  color: #fff;
+  font-size: 22rpx;
+  width: 70rpx;
+  padding-left: 10rpx;
 }

+ 2 - 0
wx-mall/pages/catalog/catalog.js

@@ -220,6 +220,8 @@ Page({
         that.getFootCart();
         goodsList.forEach(function (val, index, arr) {
           res.data.cartList.forEach(function (cartVal, cartIndex, cartArr) {
+            console.log(val.product_id);
+            console.log(cartVal.product_id);
             if (val.product_id == cartVal.product_id) {
               val.cart_num = cartVal.number;
               goodsList[index] = val;

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

@@ -82,11 +82,11 @@
     <scroll-view class="cate" scroll-y="true">
       <navigator url="url" class="banner">
         <image class="image" wx:if="{{currentCategory.wap_banner_url}}" src="{{currentCategory.wap_banner_url}}"></image>
-        <view class="txt">{{currentCategory.front_name}}</view>
+        <view class="txt">{{currentCategory.front_name?currentCategory.front_name:""}}</view>
       </navigator>
       <view class="hd" wx:if="{{currentCategory}}">
         <text class="line"></text>
-        <text class="txt">{{currentCategory.name}}分类</text>
+        <text class="txt">{{currentCategory.name?currentCategory.name:""}}分类</text>
         <text class="line"></text>
       </view>
       <view class="bd">
@@ -128,8 +128,8 @@
 
           <view class="goods-do">
             <navigator url="/pages/goods/goods?id='+{{item.id}}">
-              <text class="price">{{item.retail_price}}</text>
-              <text class="org-price line-through">{{item.market_price}}</text>
+              <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">

+ 17 - 8
wx-mall/pages/goods/goods.wxml

@@ -50,8 +50,8 @@
     <view class="goods-info">
       <view class="c" bindtap="hideSwitchAttrPop">
         <view class="goods-do">
-          <text class="price">{{goods.retail_price}}</text>
-          <text class="org-price line-through">{{goods.market_price}}</text>
+          <text class="price">{{goods.retail_price?"¥"+goods.retail_price:"¥0"}}</text>
+          <text class="org-price line-through">{{goods.market_price?"¥"+goods.market_price:""}}</text>
         </view>
         <text class="name">{{goods.name?goods.name:""}}</text>
         <text class="desc">{{goods.goods_brief?goods.goods_brief:""}}</text>
@@ -65,7 +65,7 @@
         </view>
       </view>
     </view>
-    <view class="section-nav section-attr" bindtap="switchAttrPop">
+    <view class="section-nav section-attr" bindtap="switchAttrPop"  wx:if="{{stockNum >0}}">
       <view class="t">{{checkedSpecText=="请选择规格数量"?"请选择规格数量":"已选:【"+checkedSpecText+"】"}}</view>
       <image class="i" src="../../static/images/address_right.png" background-size="cover"></image>
     </view>
@@ -99,15 +99,20 @@
       </view>
       <image class="i" src="../../static/images/address_right.png" background-size="cover"></image>
     </view>-->
-    <view class="comments" wx:if="{{comment.count > 0}}"  bindtap="hideSwitchAttrPop">
+    <view class="comments" bindtap="hideSwitchAttrPop">
       <view class="h">
-        <navigator url="../comment/comment?valueId={{goods.id}}&typeId=0">
+        <navigator url='{{comment.count > 0?"../comment/comment?valueId={{goods.id}}&typeId=0":""}}'>
           <text class="t">评价({{comment.count > 999 ? '999+' : comment.count}})</text>
           <text class="i">查看全部</text>
         </navigator>
       </view>
       <view class="b">
-        <view class="item">
+        <view class="item" wx:if="{{comment.count == 0}}">
+          <view class="info">
+            暂无评论
+          </view>
+        </view>
+        <view class="item" wx:if="{{comment.count > 0}}">
           <view class="info">
             <view class="user">
               <image src="{{comment.data.avatar}}"></image>
@@ -210,6 +215,11 @@
     </view>
   </view>
 </scroll-view>
+  <view class='shelves-view' wx:if="{{stockNum ==0}}">
+    <view class="shelves">
+      <text class='shelves-text'>已下架</text>
+    </view>
+  </view>
   <view class="bottom-btn">
     <view class="l l-home" bindtap="switchNav">
       <image class="icon" src="/static/images/nav-1.png"></image>
@@ -221,9 +231,8 @@
       <view class="box">
         <text class="cart-count">{{cartGoodsCount}}</text>
         <image bindtap="openCartPage" class="icon" src="/static/images/ic_menu_shoping_nor.png"></image>
-
       </view>
     </view>
     <!-- <view class="c">立即购买</view> -->
-    <view class="r" bindtap="addToCart">加入购物车</view>
+    <view class='{{stockNum ==0?"r-disable":"r"}}' bindtap='{{stockNum ==0?"":"addToCart"}}'>加入购物车</view>
   </view>

+ 38 - 0
wx-mall/pages/goods/goods.wxss

@@ -616,6 +616,16 @@
 }
 @import "../../lib/wxParse/wxParse.wxss";
 
+.bottom-btn .r-disable {
+  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;
@@ -867,3 +877,31 @@
   line-height: 65rpx;
    display: inline;
 }
+
+.shelves-view {
+  position: fixed;
+  left: 0;
+  bottom: 100rpx;
+  z-index: 10;
+  width: 100%;
+  height: 60rpx;
+  display: flex;
+  background: #fff;
+}
+.shelves-view .shelves {
+  border: 1px solid #7c7b7b;
+  background: #7c7b7b;
+  float: left;
+  height: 60rpx;
+  line-height: 60rpx;
+  flex: 1;
+  text-align: center;
+  color: #fff;
+  width: 100%;
+}
+.shelves-view .shelves .shelves-text {
+  font-size: 28rpx;
+  flex: 1;
+  text-align: center;
+  color: #fff;
+}

+ 5 - 2
wx-mall/pages/hotGoods/hotGoods.js

@@ -23,7 +23,8 @@ Page({
     productList: {},
     specificationList: {},
     checkedSpecText: '请选择规格数量',
-    number: 1
+    number: 1,
+    retailPrice:''
   },
   toggleNav() {
     this.setData({
@@ -154,6 +155,7 @@ Page({
   addCart: function (e) {
     let that = this;
     var goodsId = e.currentTarget.dataset.goodsId;
+    var retailPrice = e.currentTarget.dataset.retailPrice; 
     util.request(api.GoodsSku, {
       goodsId: goodsId
     }).then(function (res) {
@@ -162,7 +164,8 @@ Page({
           goodsVo: res.data.goodsVo,
           specificationList: res.data.specificationList,
           productList: res.data.productList,
-          openAttr: !that.data.openAttr
+          openAttr: !that.data.openAttr,
+          retailPrice: retailPrice
         });
         //
         let _specificationList = res.data.specificationList;

+ 2 - 2
wx-mall/pages/hotGoods/hotGoods.wxml

@@ -87,7 +87,7 @@
           </navigator>
 
           <view class="price">¥{{iitem.retail_price}}
-            <image class="cart" src="/static/images/cart.png" data-goods-id="{{iitem.id}}" bindtap='addCart' background-size="cover"></image>
+            <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>
         </view>
       </block>
@@ -100,7 +100,7 @@
       <image class="img" src="{{goodsVo.list_pic_url}}"></image>
       <view class="info">
         <view class="c">
-          <view class="p">价格:¥{{checkedProduct[0].retail_price}}</view>
+          <view class="p">价格:¥{{retailPrice}}</view>
           <view class="a" wx:if="{{productList.length>0}}">已选择:{{checkedSpecText}}</view>
         </view>
       </view>

+ 3 - 3
wx-mall/pages/index/index.wxml

@@ -153,7 +153,7 @@
     <view class="h">
       <view>
         <navigator url="../hotGoods/hotGoods">
-          <text class="txt">今日折扣</text>
+          <text class="txt">今日热销</text>
         </navigator>
       </view>
     </view>
@@ -169,8 +169,8 @@
               <text class="desc">{{item.goods_brief?item.goods_brief:""}}</text>
             </navigator>
             <view class="goods-do">
-              <text class="price">{{item.retail_price}}</text>
-              <text class="org-price line-through">{{item.market_price}}</text>
+              <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">

+ 3 - 3
wx-mall/pages/ucenter/footprint/footprint.wxml

@@ -6,9 +6,9 @@
         <view class="item" data-footprint="{{iitem}}" bindtouchstart="touchStart" bindtouchend="touchEnd" bindtap="deleteItem" wx:for="{{item}}"  wx:for-item="iitem" wx:key="{{iitem.id}}">
           <image class="img" src="{{iitem.list_pic_url}}"></image>
           <view class="info">
-            <view class="name">{{iitem.name}}</view>
-            <view class="subtitle">{{iitem.goods_brief}}</view>
-            <view class="price">{{iitem.retail_price}}</view>
+            <view class="name">{{iitem.name?iitem.name:""}}</view>
+            <view class="subtitle">{{iitem.goods_brief?iitem.goods_brief:""}}</view>
+            <view class="price">{{iitem.retail_price?"¥"+iitem.retail_price:""}}</view>
           </view>
         </view>
       </view>

+ 18 - 17
wx-mall/pages/ucenter/order/order.js

@@ -109,7 +109,7 @@ Page({
                 wx.switchTab({
                     url: '/pages/cart/cart',
                 });
-            } else if (res.errno === 0) {
+            } else {
                 wx.showToast({
                     title: res.errmsg,
                     image: '/static/images/icon_error.png',
@@ -119,22 +119,23 @@ Page({
         });
   },
   againBuyDisabel(event) {
-      let goodType = event.target.dataset.goodType;
-      let isStore = event.target.dataset.isStore;
-      if (goodType != '00' && isStore) {
-        wx.showModal({
-          title: '提示信息',
-          content: '非保税仓商品不允许再来一单,需门店扫描二维码进行购买',
-          showCancel: false
-        });
-      }
-      if (!isStore){
-        wx.showModal({
-          title: '',
-          content: '该订单非当前门店订单,不允许再来一单,需切换门店进行购买',
-          showCancel: false
-        });
-      }
+    let goodsType = event.target.dataset.goodsType;
+    let isStore = event.target.dataset.isStore;
+    console.log(goodsType);
+    if (goodsType != '00' && isStore) {
+      wx.showModal({
+        title: '提示信息',
+        content: '非保税仓商品不允许再来一单,需门店扫描二维码进行购买',
+        showCancel: false
+      });
+    }
+    if (!isStore) {
+      wx.showModal({
+        title: '',
+        content: '该订单非当前门店订单,不允许再来一单,需切换门店进行购买',
+        showCancel: false
+      });
+    }
   },  
     switchOrderType(tabIndex) {
         let that = this;