From a86ec8b650180d7c8894bc29f2e55f3459d80f13 Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Thu, 5 Jul 2018 22:43:16 +0800 Subject: [PATCH] =?UTF-8?q?[litemall-wx,=20litemall-wx-api]:=20=E5=B0=8F?= =?UTF-8?q?=E5=95=86=E5=9C=BA=E7=B3=BB=E7=BB=9F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../litemall/wx/web/WxAuthController.java | 14 +++-- .../litemall/wx/web/WxCartController.java | 60 +++++-------------- .../litemall/wx/web/WxCollectController.java | 24 ++++---- .../litemall/wx/web/WxCommentController.java | 22 +++---- .../wx/web/WxFootprintController.java | 4 +- .../litemall/wx/web/WxGoodsController.java | 6 +- .../litemall/wx/web/WxHomeController.java | 2 +- .../litemall/wx/web/WxOrderController.java | 19 +++--- litemall-wx/app.json | 6 +- litemall-wx/pages/brand/brand.wxml | 2 +- .../pages/brandDetail/brandDetail.wxml | 6 +- litemall-wx/pages/cart/cart.wxml | 2 +- litemall-wx/pages/catalog/catalog.wxml | 4 +- litemall-wx/pages/category/category.wxml | 2 +- litemall-wx/pages/comment/comment.js | 8 +-- litemall-wx/pages/commentPost/commentPost.js | 6 +- litemall-wx/pages/goods/goods.js | 18 +++--- litemall-wx/pages/goods/goods.wxml | 6 +- litemall-wx/pages/hotGoods/hotGoods.wxml | 2 +- litemall-wx/pages/index/index.wxml | 12 ++-- litemall-wx/pages/index/index.wxss | 4 +- litemall-wx/pages/newGoods/newGoods.wxml | 2 +- litemall-wx/pages/topic/topic.wxml | 4 +- .../pages/topicComment/topicComment.js | 8 +-- .../topicCommentPost/topicCommentPost.js | 4 +- .../topicCommentPost/topicCommentPost.wxml | 2 +- litemall-wx/pages/topicDetail/topicDetail.js | 4 +- .../pages/topicDetail/topicDetail.wxml | 4 +- litemall-wx/pages/ucenter/collect/collect.js | 6 +- .../pages/ucenter/collect/collect.wxml | 4 +- .../pages/ucenter/footprint/footprint.wxml | 4 +- .../ucenter/orderDetail/orderDetail.wxml | 2 +- litemall-wx/project.config.json | 16 ++--- 33 files changed, 129 insertions(+), 160 deletions(-) diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java index 52ef9f03..84a72398 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java @@ -147,11 +147,13 @@ public class WxAuthController { user.setWeixinOpenid(openId); user.setAvatar(userInfo.getAvatarUrl()); user.setNickname(userInfo.getNickName()); - user.setGender(userInfo.getGender() == 1 ? "男" : "女"); - user.setUserLevel("普通用户"); - user.setStatus("可用"); + user.setGender(userInfo.getGender()); + user.setUserLevel((byte)0); + user.setStatus((byte)0); user.setLastLoginTime(LocalDateTime.now()); user.setLastLoginIp(IpUtil.client(request)); + user.setAddTime(LocalDateTime.now()); + userService.add(user); } else{ @@ -232,9 +234,9 @@ public class WxAuthController { user.setWeixinOpenid(""); user.setAvatar("https://yanxuan.nosdn.127.net/80841d741d7fa3073e0ae27bf487339f.jpg?imageView&quality=90&thumbnail=64x64"); user.setNickname(username); - user.setGender("未知"); - user.setUserLevel("普通用户"); - user.setStatus("可用"); + user.setGender((byte)0); + user.setUserLevel((byte)0); + user.setStatus((byte)0); user.setLastLoginTime(LocalDateTime.now()); user.setLastLoginIp(IpUtil.client(request)); user.setAddTime(LocalDateTime.now()); diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java index 482ad9c6..22c3175a 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java @@ -65,10 +65,10 @@ public class WxCartController { BigDecimal checkedGoodsAmount = new BigDecimal(0.00); for (LitemallCart cart : cartList) { goodsCount += cart.getNumber(); - goodsAmount = goodsAmount.add(cart.getRetailPrice().multiply(new BigDecimal(cart.getNumber()))); + goodsAmount = goodsAmount.add(cart.getPrice().multiply(new BigDecimal(cart.getNumber()))); if (cart.getChecked()) { checkedGoodsCount += cart.getNumber(); - checkedGoodsAmount = checkedGoodsAmount.add(cart.getRetailPrice().multiply(new BigDecimal(cart.getNumber()))); + checkedGoodsAmount = checkedGoodsAmount.add(cart.getPrice().multiply(new BigDecimal(cart.getNumber()))); } } Map cartTotal = new HashMap<>(); @@ -127,32 +127,16 @@ public class WxCartController { LitemallCart existCart = cartService.queryExist(goodsId, productId, userId); if(existCart == null){ //取得规格的信息,判断规格库存 - if(product == null || number > product.getGoodsNumber() ){ + if(product == null || number > product.getNumber() ){ return ResponseUtil.fail(400, "库存不足"); } - Integer[] ids = product.getGoodsSpecificationIds(); - String goodsSpecificationValue = null; - for(Integer id : ids){ - LitemallGoodsSpecification goodsSpecification = goodsSpecificationService.findById(id); - if(goodsSpecification == null || !goodsSpecification.getGoodsId().equals(goodsId)){ - return ResponseUtil.badArgument(); - } - if(goodsSpecificationValue == null){ - goodsSpecificationValue = goodsSpecification.getValue(); - } - else { - goodsSpecificationValue = goodsSpecificationValue + " " + goodsSpecification.getValue(); - } - } - cart.setId(null); cart.setGoodsSn(goods.getGoodsSn()); cart.setGoodsName((goods.getName())); - cart.setPicUrl(goods.getPrimaryPicUrl()); - cart.setRetailPrice(product.getRetailPrice()); - cart.setGoodsSpecificationIds(product.getGoodsSpecificationIds()); - cart.setGoodsSpecificationValues(goodsSpecificationValue); + cart.setPicUrl(goods.getPicUrl()); + cart.setPrice(product.getPrice()); + cart.setSpecifications(product.getSpecifications()); cart.setUserId(userId); cart.setChecked(true); cartService.add(cart); @@ -160,7 +144,7 @@ public class WxCartController { else{ //取得规格的信息,判断规格库存 int num = existCart.getNumber() + number; - if(num > product.getGoodsNumber()){ + if(num > product.getNumber()){ return ResponseUtil.fail(400, "库存不足"); } existCart.setNumber((short)num); @@ -215,32 +199,16 @@ public class WxCartController { LitemallCart existCart = cartService.queryExist(goodsId, productId, userId); if(existCart == null){ //取得规格的信息,判断规格库存 - if(product == null || number > product.getGoodsNumber() ){ + if(product == null || number > product.getNumber() ){ return ResponseUtil.fail(400, "库存不足"); } - Integer[] ids = product.getGoodsSpecificationIds(); - String goodsSpecificationValue = null; - for(Integer id : ids){ - LitemallGoodsSpecification goodsSpecification = goodsSpecificationService.findById(id); - if(goodsSpecification == null || !goodsSpecification.getGoodsId().equals(goodsId)){ - return ResponseUtil.badArgument(); - } - if(goodsSpecificationValue == null){ - goodsSpecificationValue = goodsSpecification.getValue(); - } - else { - goodsSpecificationValue = goodsSpecificationValue + " " + goodsSpecification.getValue(); - } - } - cart.setId(null); cart.setGoodsSn(goods.getGoodsSn()); cart.setGoodsName((goods.getName())); - cart.setPicUrl(goods.getPrimaryPicUrl()); - cart.setRetailPrice(product.getRetailPrice()); - cart.setGoodsSpecificationIds(product.getGoodsSpecificationIds()); - cart.setGoodsSpecificationValues(goodsSpecificationValue); + cart.setPicUrl(goods.getPicUrl()); + cart.setPrice(product.getPrice()); + cart.setSpecifications(product.getSpecifications()); cart.setUserId(userId); cart.setChecked(true); cartService.add(cart); @@ -248,7 +216,7 @@ public class WxCartController { else{ //取得规格的信息,判断规格库存 int num = number; - if(num > product.getGoodsNumber()){ + if(num > product.getNumber()){ return ResponseUtil.fail(400, "库存不足"); } existCart.setNumber((short)num); @@ -307,7 +275,7 @@ public class WxCartController { //取得规格的信息,判断规格库存 LitemallProduct product = productService.findById(productId); - if(product == null || product.getGoodsNumber() < number){ + if(product == null || product.getNumber() < number){ return ResponseUtil.fail(403, "库存不足"); } @@ -498,7 +466,7 @@ public class WxCartController { } BigDecimal checkedGoodsPrice = new BigDecimal(0.00); for (LitemallCart cart : checkedGoodsList) { - checkedGoodsPrice = checkedGoodsPrice.add(cart.getRetailPrice().multiply(new BigDecimal(cart.getNumber()))); + checkedGoodsPrice = checkedGoodsPrice.add(cart.getPrice().multiply(new BigDecimal(cart.getNumber()))); } // 根据订单商品总价计算运费,满88则免运费,否则8元; diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCollectController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCollectController.java index 0e04d0fc..1d82afa7 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCollectController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCollectController.java @@ -29,7 +29,7 @@ public class WxCollectController { * 用户收藏列表 * * @param userId 用户ID - * @param typeId 类型ID + * @param type 类型,如果是0则是商品收藏,如果是1则是专题收藏 * 目前没有使用 * @param page 分页页数 * @param size 分页大小 @@ -47,31 +47,31 @@ public class WxCollectController { * 失败则 { errno: XXX, errmsg: XXX } */ @GetMapping("list") - public Object list(@LoginUser Integer userId, Integer typeId, + public Object list(@LoginUser Integer userId, Byte type, @RequestParam(value = "page", defaultValue = "1") Integer page, @RequestParam(value = "size", defaultValue = "10") Integer size) { if(userId == null){ return ResponseUtil.unlogin(); } - if(typeId == null){ + if(type == null){ return ResponseUtil.badArgument(); } - List collectList = collectService.queryByType(userId, typeId, page, size); - int count = collectService.countByType(userId, typeId); + List collectList = collectService.queryByType(userId, type, page, size); + int count = collectService.countByType(userId, type); int totalPages = (int) Math.ceil((double) count / size); List collects = new ArrayList<>(collectList.size()); for(LitemallCollect collect : collectList){ Map c = new HashMap(); c.put("id", collect.getId()); - c.put("typeId", collect.getTypeId()); + c.put("type", collect.getType()); c.put("valueId", collect.getValueId()); LitemallGoods goods = goodsService.findById(collect.getValueId()); c.put("name", goods.getName()); - c.put("goodsBrief", goods.getGoodsBrief()); - c.put("listPicUrl", goods.getListPicUrl()); + c.put("brief", goods.getBrief()); + c.put("picUrl", goods.getPicUrl()); c.put("retailPrice", goods.getRetailPrice()); collects.add(c); @@ -109,13 +109,13 @@ public class WxCollectController { return ResponseUtil.badArgument(); } - Integer typeId = JacksonUtil.parseInteger(body, "typeId"); + Byte type = JacksonUtil.parseByte(body, "type"); Integer valueId = JacksonUtil.parseInteger(body, "valueId"); - if(!ObjectUtils.allNotNull(typeId, valueId)){ + if(!ObjectUtils.allNotNull(type, valueId)){ return ResponseUtil.badArgument(); } - LitemallCollect collect = collectService.queryByTypeAndValue(userId, typeId, valueId); + LitemallCollect collect = collectService.queryByTypeAndValue(userId, type, valueId); String handleType = null; if(collect != null){ @@ -127,7 +127,7 @@ public class WxCollectController { collect = new LitemallCollect(); collect.setUserId(userId); collect.setValueId(valueId); - collect.setTypeId(typeId); + collect.setType(type); collect.setAddTime(LocalDateTime.now()); collectService.add(collect); } diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCommentController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCommentController.java index 5d7d1c66..e28ff839 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCommentController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCommentController.java @@ -66,8 +66,8 @@ public class WxCommentController { /** * 评论数量 * - * @param typeId 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。 - * @param valueId 商品或专题ID。如果typeId是0,则是商品ID;如果typeId是1,则是专题ID。 + * @param type 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。 + * @param valueId 商品或专题ID。如果type是0,则是商品ID;如果type是1,则是专题ID。 * @return 评论数量 * 成功则 * { @@ -82,9 +82,9 @@ public class WxCommentController { * 失败则 { errno: XXX, errmsg: XXX } */ @GetMapping("count") - public Object count(Byte typeId, Integer valueId) { - int allCount = commentService.count(typeId, valueId, 0, 0, 0); - int hasPicCount = commentService.count(typeId, valueId, 1, 0, 0); + public Object count(Byte type, Integer valueId) { + int allCount = commentService.count(type, valueId, 0, 0, 0); + int hasPicCount = commentService.count(type, valueId, 1, 0, 0); Map data = new HashMap(); data.put("allCount", allCount); data.put("hasPicCount", hasPicCount); @@ -94,8 +94,8 @@ public class WxCommentController { /** * 评论列表 * - * @param typeId 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。 - * @param valueId 商品或专题ID。如果typeId是0,则是商品ID;如果typeId是1,则是专题ID。 + * @param type 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。 + * @param valueId 商品或专题ID。如果type是0,则是商品ID;如果type是1,则是专题ID。 * @param showType 显示类型。如果是0,则查询全部;如果是1,则查询有图片的评论。 * @param page 分页页数 * @param size 分页大小 @@ -114,15 +114,15 @@ public class WxCommentController { * 失败则 { errno: XXX, errmsg: XXX } */ @GetMapping("list") - public Object list(Byte typeId, Integer valueId, Integer showType, + public Object list(Byte type, Integer valueId, Integer showType, @RequestParam(value = "page", defaultValue = "1") Integer page, @RequestParam(value = "size", defaultValue = "10") Integer size) { - if(!ObjectUtils.allNotNull(typeId, valueId, showType)){ + if(!ObjectUtils.allNotNull(type, valueId, showType)){ return ResponseUtil.badArgument(); } - List commentList = commentService.query(typeId, valueId, showType, page, size); - int count = commentService.count(typeId, valueId, showType, page, size); + List commentList = commentService.query(type, valueId, showType, page, size); + int count = commentService.count(type, valueId, showType, page, size); List> commentVoList = new ArrayList<>(commentList.size()); for(LitemallComment comment : commentList){ diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxFootprintController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxFootprintController.java index 5f7561f2..9b087c46 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxFootprintController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxFootprintController.java @@ -97,8 +97,8 @@ public class WxFootprintController { LitemallGoods goods = goodsService.findById(footprint.getGoodsId()); c.put("name", goods.getName()); - c.put("goodsBrief", goods.getGoodsBrief()); - c.put("listPicUrl", goods.getListPicUrl()); + c.put("brief", goods.getBrief()); + c.put("picUrl", goods.getPicUrl()); c.put("retailPrice", goods.getRetailPrice()); footprintVoList.add(c); diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxGoodsController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxGoodsController.java index 7ee7ec4f..2d51da89 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxGoodsController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxGoodsController.java @@ -182,14 +182,14 @@ public class WxGoodsController { LitemallCategory parent = null; List children = null; - if(cur.getParentId() == 0){ + if(cur.getPid() == 0){ parent = cur; children = categoryService.queryByPid(cur.getId()); cur = children.get(0); } else{ - parent = categoryService.findById(cur.getParentId()); - children = categoryService.queryByPid(cur.getParentId()); + parent = categoryService.findById(cur.getPid()); + children = categoryService.queryByPid(cur.getPid()); } Map data = new HashMap<>(); data.put("currentCategory", cur); diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxHomeController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxHomeController.java index 4b640030..59de8562 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxHomeController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxHomeController.java @@ -57,7 +57,7 @@ public class WxHomeController { public Object index() { Map data = new HashMap<>(); - List banner = adService.queryByApid(1); + List banner = adService.queryIndex(); data.put("banner", banner); List channel = categoryService.queryChannel(); diff --git a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxOrderController.java b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxOrderController.java index 451603ae..d6d78032 100644 --- a/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxOrderController.java +++ b/litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxOrderController.java @@ -222,9 +222,9 @@ public class WxOrderController { orderGoodsVo.put("goodsId", orderGoods.getGoodsId()); orderGoodsVo.put("goodsName", orderGoods.getGoodsName()); orderGoodsVo.put("number", orderGoods.getNumber()); - orderGoodsVo.put("retailPrice", orderGoods.getRetailPrice()); + orderGoodsVo.put("retailPrice", orderGoods.getPrice()); orderGoodsVo.put("picUrl", orderGoods.getPicUrl()); - orderGoodsVo.put("goodsSpecificationValues", orderGoods.getGoodsSpecificationValues()); + orderGoodsVo.put("goodsSpecificationValues", orderGoods.getSpecifications()); orderGoodsVoList.add(orderGoodsVo); } @@ -284,7 +284,7 @@ public class WxOrderController { } BigDecimal checkedGoodsPrice = new BigDecimal(0.00); for (LitemallCart checkGoods : checkedGoodsList) { - checkedGoodsPrice = checkedGoodsPrice.add(checkGoods.getRetailPrice().multiply(new BigDecimal(checkGoods.getNumber()))); + checkedGoodsPrice = checkedGoodsPrice.add(checkGoods.getPrice().multiply(new BigDecimal(checkGoods.getNumber()))); } // 根据订单商品总价计算运费,满88则免运费,否则8元; @@ -337,10 +337,9 @@ public class WxOrderController { orderGoods.setProductId(cartGoods.getProductId()); orderGoods.setGoodsName(cartGoods.getGoodsName()); orderGoods.setPicUrl(cartGoods.getPicUrl()); - orderGoods.setRetailPrice(cartGoods.getRetailPrice()); + orderGoods.setPrice(cartGoods.getPrice()); orderGoods.setNumber(cartGoods.getNumber()); - orderGoods.setGoodsSpecificationIds(cartGoods.getGoodsSpecificationIds()); - orderGoods.setGoodsSpecificationValues(cartGoods.getGoodsSpecificationValues()); + orderGoods.setSpecifications(cartGoods.getSpecifications()); orderGoods.setAddTime(LocalDateTime.now()); // 添加订单商品表项 @@ -355,11 +354,11 @@ public class WxOrderController { Integer productId = checkGoods.getProductId(); LitemallProduct product = productService.findById(productId); - Integer remainNumber = product.getGoodsNumber() - checkGoods.getNumber(); + Integer remainNumber = product.getNumber() - checkGoods.getNumber(); if (remainNumber < 0) { throw new RuntimeException("下单的商品货品数量大于库存量"); } - product.setGoodsNumber(remainNumber); + product.setNumber(remainNumber); productService.updateById(product); } } catch (Exception ex) { @@ -425,8 +424,8 @@ public class WxOrderController { for (LitemallOrderGoods orderGoods : orderGoodsList) { Integer productId = orderGoods.getProductId(); LitemallProduct product = productService.findById(productId); - Integer number = product.getGoodsNumber() + orderGoods.getNumber(); - product.setGoodsNumber(number); + Integer number = product.getNumber() + orderGoods.getNumber(); + product.setNumber(number); productService.updateById(product); } } catch (Exception ex) { diff --git a/litemall-wx/app.json b/litemall-wx/app.json index d7d5dd56..2d6ba73c 100644 --- a/litemall-wx/app.json +++ b/litemall-wx/app.json @@ -4,7 +4,7 @@ "pages/catalog/catalog", "pages/newGoods/newGoods", "pages/hotGoods/hotGoods", - "pages/ucenter/index/index", + "pages/ucenter/index/index", "pages/ucenter/address/address", "pages/ucenter/addressAdd/addressAdd", "pages/ucenter/footprint/footprint", @@ -18,10 +18,10 @@ "pages/payResult/payResult", "pages/comment/comment", "pages/commentPost/commentPost", - "pages/topic/topic", + "pages/topic/topic", "pages/topicComment/topicComment", "pages/topicDetail/topicDetail", - "pages/topicCommentPost/topicCommentPost", + "pages/topicCommentPost/topicCommentPost", "pages/brand/brand", "pages/brandDetail/brandDetail", "pages/search/search", diff --git a/litemall-wx/pages/brand/brand.wxml b/litemall-wx/pages/brand/brand.wxml index 8d61e9de..9cce1491 100644 --- a/litemall-wx/pages/brand/brand.wxml +++ b/litemall-wx/pages/brand/brand.wxml @@ -2,7 +2,7 @@ - + diff --git a/litemall-wx/pages/brandDetail/brandDetail.wxml b/litemall-wx/pages/brandDetail/brandDetail.wxml index 1965dd95..ba2f0c7f 100644 --- a/litemall-wx/pages/brandDetail/brandDetail.wxml +++ b/litemall-wx/pages/brandDetail/brandDetail.wxml @@ -1,7 +1,7 @@ - + {{brand.name}} @@ -10,7 +10,7 @@ - {{brand.simpleDesc}} + {{brand.desc}} @@ -18,7 +18,7 @@ - + {{iitem.name}} ¥{{iitem.retailPrice}} diff --git a/litemall-wx/pages/cart/cart.wxml b/litemall-wx/pages/cart/cart.wxml index 452244d2..18d923cd 100644 --- a/litemall-wx/pages/cart/cart.wxml +++ b/litemall-wx/pages/cart/cart.wxml @@ -33,7 +33,7 @@ {{ isEditCart ? '已选择:' : ''}}{{item.goodsSpecificationValues||''}} - ¥{{item.retailPrice}} + ¥{{item.price}} - diff --git a/litemall-wx/pages/catalog/catalog.wxml b/litemall-wx/pages/catalog/catalog.wxml index 4054ae55..28bf44c8 100644 --- a/litemall-wx/pages/catalog/catalog.wxml +++ b/litemall-wx/pages/catalog/catalog.wxml @@ -11,7 +11,7 @@ @@ -21,7 +21,7 @@ - + {{item.name}} diff --git a/litemall-wx/pages/category/category.wxml b/litemall-wx/pages/category/category.wxml index 4e7d8002..b0f6d18f 100644 --- a/litemall-wx/pages/category/category.wxml +++ b/litemall-wx/pages/category/category.wxml @@ -15,7 +15,7 @@ - + {{iitem.name}} ¥{{iitem.retailPrice}} diff --git a/litemall-wx/pages/comment/comment.js b/litemall-wx/pages/comment/comment.js index ce186715..a0f2d019 100644 --- a/litemall-wx/pages/comment/comment.js +++ b/litemall-wx/pages/comment/comment.js @@ -7,7 +7,7 @@ Page({ comments: [], allCommentList: [], picCommentList: [], - typeId: 0, + type: 0, valueId: 0, showType: 0, allCount: 0, @@ -18,7 +18,7 @@ Page({ }, getCommentCount: function () { let that = this; - util.request(api.CommentCount, { valueId: that.data.valueId, typeId: that.data.typeId}).then(function (res) { + util.request(api.CommentCount, { valueId: that.data.valueId, type: that.data.type}).then(function (res) { if (res.errno === 0) { that.setData({ allCount: res.data.allCount, @@ -31,7 +31,7 @@ Page({ let that = this; util.request(api.CommentList, { valueId: that.data.valueId, - typeId: that.data.typeId, + type: that.data.type, size: that.data.size, page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage), showType: that.data.showType @@ -57,7 +57,7 @@ Page({ onLoad: function (options) { // 页面初始化 options为页面跳转所带来的参数 this.setData({ - typeId: options.typeId, + type: options.type, valueId: options.valueId }); this.getCommentCount(); diff --git a/litemall-wx/pages/commentPost/commentPost.js b/litemall-wx/pages/commentPost/commentPost.js index a159fb4a..27fd9fd7 100644 --- a/litemall-wx/pages/commentPost/commentPost.js +++ b/litemall-wx/pages/commentPost/commentPost.js @@ -5,7 +5,7 @@ var api = require('../../config/api.js'); Page({ data: { orderId: 0, - typeId: 0, + type: 0, valueId: 0, orderGoods: {}, content: '', @@ -102,7 +102,7 @@ Page({ var that = this; that.setData({ orderId: options.orderId, - typeId: options.typeId, + type: options.type, valueId: options.valueId }); this.getOrderComment(); @@ -131,7 +131,7 @@ Page({ } util.request(api.CommentPost, { - typeId: that.data.typeId, + type: that.data.type, valueId: that.data.valueId, content: that.data.content, star: that.data.star, diff --git a/litemall-wx/pages/goods/goods.js b/litemall-wx/pages/goods/goods.js index 99e52e3f..e4fa61ce 100644 --- a/litemall-wx/pages/goods/goods.js +++ b/litemall-wx/pages/goods/goods.js @@ -40,7 +40,7 @@ Page({ // 如果仅仅存在一种货品,那么商品价格应该和货品价格一致 // 这里检测一下 - let _productPrice = res.data.productList[0].retailPrice; + let _productPrice = res.data.productList[0].price; let _goodsPrice = res.data.info.retailPrice; if (_productPrice != _goodsPrice){ console.error('商品数量价格和货品不一致'); @@ -75,7 +75,7 @@ Page({ }); } - WxParse.wxParse('goodsDetail', 'html', res.data.info.goodsDesc, that); + WxParse.wxParse('goodsDetail', 'html', res.data.info.desc, that); that.getGoodsRelated(); } @@ -161,7 +161,7 @@ Page({ }, getCheckedSpecKey: function () { let checkedValue = this.getCheckedSpecValue().map(function (v) { - return v.valueId; + return v.valueText; }); return checkedValue; @@ -206,9 +206,9 @@ Page({ } let checkedProduct = checkedProductArray[0]; - if (checkedProduct.goodsNumber > 0){ + if (checkedProduct.number > 0){ this.setData({ - checkedSpecPrice: checkedProduct.retailPrice, + checkedSpecPrice: checkedProduct.price, soldout: false }); } @@ -231,7 +231,7 @@ Page({ }, getCheckedProductItem: function (key) { return this.data.productList.filter(function (v) { - if (v.goodsSpecificationIds.toString() == key.toString()) { + if (v.specifications.toString() == key.toString()) { return true; } else { return false; @@ -293,7 +293,7 @@ Page({ } } else { //添加或是取消收藏 - util.request(api.CollectAddOrDelete, { typeId: 0, valueId: this.data.id }, "POST") + util.request(api.CollectAddOrDelete, { type: 0, valueId: this.data.id }, "POST") .then(function (res) { let _res = res; if (_res.errno == 0) { @@ -354,7 +354,7 @@ Page({ let checkedProduct = checkedProductArray[0]; //验证库存 - if (checkedProduct.goodsNumber <= 0) { + if (checkedProduct.number <= 0) { wx.showToast({ image: '/static/images/icon_error.png', title: '没有库存' @@ -420,7 +420,7 @@ Page({ let checkedProduct = checkedProductArray[0]; //验证库存 - if (checkedProduct.goodsNumber <= 0) { + if (checkedProduct.number <= 0) { wx.showToast({ image: '/static/images/icon_error.png', title: '没有库存' diff --git a/litemall-wx/pages/goods/goods.wxml b/litemall-wx/pages/goods/goods.wxml index e085e587..69728868 100644 --- a/litemall-wx/pages/goods/goods.wxml +++ b/litemall-wx/pages/goods/goods.wxml @@ -28,7 +28,7 @@ - + 评价({{comment.count > 999 ? '999+' : comment.count}}) 查看全部 @@ -92,7 +92,7 @@ - + {{item.name}} ¥{{item.retailPrice}} @@ -102,7 +102,7 @@ - + 价格:¥{{checkedSpecPrice}} diff --git a/litemall-wx/pages/hotGoods/hotGoods.wxml b/litemall-wx/pages/hotGoods/hotGoods.wxml index deeb03a4..f54f5bcf 100644 --- a/litemall-wx/pages/hotGoods/hotGoods.wxml +++ b/litemall-wx/pages/hotGoods/hotGoods.wxml @@ -30,7 +30,7 @@ - + {{iitem.name}} ¥{{iitem.retailPrice}} diff --git a/litemall-wx/pages/index/index.wxml b/litemall-wx/pages/index/index.wxml index 876ff73a..facf3f92 100644 --- a/litemall-wx/pages/index/index.wxml +++ b/litemall-wx/pages/index/index.wxml @@ -46,7 +46,7 @@ - + {{item.name}} ¥{{item.retailPrice}} @@ -64,11 +64,11 @@ - + {{item.name}} - {{item.goods_brief}} + {{item.brief}} ¥{{item.retailPrice}} @@ -88,10 +88,10 @@ - + {{item.title}} - ¥{{item.priceInfo}}元起 + ¥{{item.price}}元起 {{item.subtitle}} @@ -109,7 +109,7 @@ - + {{iitem.name}} ¥{{iitem.retailPrice}} diff --git a/litemall-wx/pages/index/index.wxss b/litemall-wx/pages/index/index.wxss index 592c297d..b8346745 100644 --- a/litemall-wx/pages/index/index.wxss +++ b/litemall-wx/pages/index/index.wxss @@ -96,12 +96,12 @@ display: block; font-size: 33rpx; height: 43rpx; - color: #333; + color: #fff; } .a-brand .mt .price, .a-brand .mt .unit { font-size: 25rpx; - color: #999; + color: #fff; } .a-brand .item-1 { diff --git a/litemall-wx/pages/newGoods/newGoods.wxml b/litemall-wx/pages/newGoods/newGoods.wxml index deeb03a4..f54f5bcf 100644 --- a/litemall-wx/pages/newGoods/newGoods.wxml +++ b/litemall-wx/pages/newGoods/newGoods.wxml @@ -30,7 +30,7 @@ - + {{iitem.name}} ¥{{iitem.retailPrice}} diff --git a/litemall-wx/pages/topic/topic.wxml b/litemall-wx/pages/topic/topic.wxml index bf33970f..423e4f7e 100644 --- a/litemall-wx/pages/topic/topic.wxml +++ b/litemall-wx/pages/topic/topic.wxml @@ -1,11 +1,11 @@ - + {{item.title}} {{item.subtitle}} - {{item.priceInfo}}元起 + {{item.price}}元起 diff --git a/litemall-wx/pages/topicComment/topicComment.js b/litemall-wx/pages/topicComment/topicComment.js index c87f5baf..d03cf5c8 100644 --- a/litemall-wx/pages/topicComment/topicComment.js +++ b/litemall-wx/pages/topicComment/topicComment.js @@ -8,7 +8,7 @@ Page({ comments: [], allCommentList: [], picCommentList: [], - typeId: 0, + type: 0, valueId: 0, showType: 0, allCount: 0, @@ -19,7 +19,7 @@ Page({ }, getCommentCount: function () { let that = this; - util.request(api.CommentCount, { valueId: that.data.valueId, typeId: that.data.typeId}).then(function (res) { + util.request(api.CommentCount, { valueId: that.data.valueId, type: that.data.type}).then(function (res) { if (res.errno === 0) { that.setData({ @@ -33,7 +33,7 @@ Page({ let that = this; util.request(api.CommentList, { valueId: that.data.valueId, - typeId: that.data.typeId, + type: that.data.type, size: that.data.size, page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage), showType: that.data.showType @@ -59,7 +59,7 @@ Page({ onLoad: function (options) { // 页面初始化 options为页面跳转所带来的参数 this.setData({ - typeId: options.typeId, + type: options.type, valueId: options.valueId }); this.getCommentCount(); diff --git a/litemall-wx/pages/topicCommentPost/topicCommentPost.js b/litemall-wx/pages/topicCommentPost/topicCommentPost.js index 610f22d2..d463749e 100644 --- a/litemall-wx/pages/topicCommentPost/topicCommentPost.js +++ b/litemall-wx/pages/topicCommentPost/topicCommentPost.js @@ -97,7 +97,7 @@ Page({ }, onLoad: function (options) { - if (parseInt(options.typeId) !== 1){ + if (parseInt(options.type) !== 1){ return; } @@ -131,7 +131,7 @@ Page({ } util.request(api.CommentPost, { - typeId: 1, + type: 1, valueId: that.data.valueId, content: that.data.content, star: that.data.star, diff --git a/litemall-wx/pages/topicCommentPost/topicCommentPost.wxml b/litemall-wx/pages/topicCommentPost/topicCommentPost.wxml index f1f0802c..db6f2acb 100644 --- a/litemall-wx/pages/topicCommentPost/topicCommentPost.wxml +++ b/litemall-wx/pages/topicCommentPost/topicCommentPost.wxml @@ -2,7 +2,7 @@ - + diff --git a/litemall-wx/pages/topicDetail/topicDetail.js b/litemall-wx/pages/topicDetail/topicDetail.js index 375dc0f1..a5a1d1a9 100644 --- a/litemall-wx/pages/topicDetail/topicDetail.js +++ b/litemall-wx/pages/topicDetail/topicDetail.js @@ -39,7 +39,7 @@ Page({ }, getCommentList() { let that = this; - util.request(api.CommentList, { valueId: that.data.id, typeId: 1, showType: 0, page: 1, size: 5 }).then(function (res) { + util.request(api.CommentList, { valueId: that.data.id, type: 1, showType: 0, page: 1, size: 5 }).then(function (res) { if (res.errno === 0) { that.setData({ @@ -55,7 +55,7 @@ Page({ } else { wx.navigateTo({ - url: '/pages/topicCommentPost/topicCommentPost?valueId=' + this.data.id + '&typeId=1', + url: '/pages/topicCommentPost/topicCommentPost?valueId=' + this.data.id + '&type=1', }) } }, diff --git a/litemall-wx/pages/topicDetail/topicDetail.wxml b/litemall-wx/pages/topicDetail/topicDetail.wxml index 8222c9cb..da0123b6 100644 --- a/litemall-wx/pages/topicDetail/topicDetail.wxml +++ b/litemall-wx/pages/topicDetail/topicDetail.wxml @@ -26,7 +26,7 @@ - 查看更多 + 查看更多 @@ -42,7 +42,7 @@ - + {{item.title}} diff --git a/litemall-wx/pages/ucenter/collect/collect.js b/litemall-wx/pages/ucenter/collect/collect.js index 2b325c3f..83efff10 100644 --- a/litemall-wx/pages/ucenter/collect/collect.js +++ b/litemall-wx/pages/ucenter/collect/collect.js @@ -5,7 +5,7 @@ var app = getApp(); Page({ data: { - typeId: 0, + type: 0, collectList: [], page: 1, size: 10, @@ -16,7 +16,7 @@ Page({ title: '加载中...', }); let that = this; - util.request(api.CollectList, { typeId: that.data.typeId, page: that.data.page, size: that.data.size }).then(function (res) { + util.request(api.CollectList, { type: that.data.type, page: that.data.page, size: that.data.size }).then(function (res) { if (res.errno === 0) { that.setData({ collectList: that.data.collectList.concat(res.data.collectList), @@ -74,7 +74,7 @@ Page({ success: function (res) { if (res.confirm) { - util.request(api.CollectAddOrDelete, { typeId: that.data.typeId, valueId: goodsId}, 'POST').then(function (res) { + util.request(api.CollectAddOrDelete, { type: that.data.type, valueId: goodsId}, 'POST').then(function (res) { if (res.errno === 0) { console.log(res.data); wx.showToast({ diff --git a/litemall-wx/pages/ucenter/collect/collect.wxml b/litemall-wx/pages/ucenter/collect/collect.wxml index 5a426855..6774e615 100644 --- a/litemall-wx/pages/ucenter/collect/collect.wxml +++ b/litemall-wx/pages/ucenter/collect/collect.wxml @@ -7,10 +7,10 @@ - + {{item.name}} - {{item.goodsBrief}} + {{item.brief}} ¥{{item.retailPrice}} diff --git a/litemall-wx/pages/ucenter/footprint/footprint.wxml b/litemall-wx/pages/ucenter/footprint/footprint.wxml index 925a473f..dd9f0a90 100644 --- a/litemall-wx/pages/ucenter/footprint/footprint.wxml +++ b/litemall-wx/pages/ucenter/footprint/footprint.wxml @@ -10,10 +10,10 @@ {{item[0].addTime}} - + {{iitem.name}} - {{iitem.goodsBrief}} + {{iitem.brief}} ¥{{iitem.retailPrice}} diff --git a/litemall-wx/pages/ucenter/orderDetail/orderDetail.wxml b/litemall-wx/pages/ucenter/orderDetail/orderDetail.wxml index 5e972ac1..e5fe058c 100644 --- a/litemall-wx/pages/ucenter/orderDetail/orderDetail.wxml +++ b/litemall-wx/pages/ucenter/orderDetail/orderDetail.wxml @@ -32,7 +32,7 @@ {{item.goodsSpecificationValues}} ¥{{item.retailPrice}} - 去评价 + 去评价 再次购买 diff --git a/litemall-wx/project.config.json b/litemall-wx/project.config.json index 354012c5..b8e5b887 100644 --- a/litemall-wx/project.config.json +++ b/litemall-wx/project.config.json @@ -9,8 +9,8 @@ }, "compileType": "miniprogram", "libVersion": "1.9.93", - "appid": "wxa5b486c6b918ecfb", - "projectname": "litemall-wx", + "appid": "wxa5b486c6b918ecfb", + "projectname": "litemall-wx", "condition": { "search": { "current": -1, @@ -52,13 +52,13 @@ "id": -1, "name": "专题评论列表", "pathName": "pages/topicComment/topicComment", - "query": "valueId=314&typeId=1" + "query": "valueId=314&type=1" }, { "id": -1, "name": "专题评论添加", "pathName": "pages/topicCommentPost/topicCommentPost", - "query": "valueId=314&typeId=1" + "query": "valueId=314&type=1" }, { "id": -1, @@ -112,7 +112,7 @@ "id": -1, "name": "商品评论列表", "pathName": "pages/comment/comment", - "query": "valueId=1181000&typeId=0" + "query": "valueId=1181000&type=0" }, { "id": -1, @@ -163,16 +163,16 @@ "query": "id=1" }, { - "id": -1, + "id": 22, "name": "待评价的订单详情", "pathName": "pages/ucenter/orderDetail/orderDetail", - "query": "id=24" + "query": "id=1" }, { "id": -1, "name": "购买商品评价", "pathName": "pages/commentPost/commentPost", - "query": "orderId=2&typeId=0&valueId=1116011" + "query": "orderId=2&type=0&valueId=1116011" }, { "id": -1,