Commit a86ec8b6 authored by Junling Bu's avatar Junling Bu
Browse files

[litemall-wx, litemall-wx-api]: 小商场系统调整

parent 936b5511
...@@ -147,11 +147,13 @@ public class WxAuthController { ...@@ -147,11 +147,13 @@ public class WxAuthController {
user.setWeixinOpenid(openId); user.setWeixinOpenid(openId);
user.setAvatar(userInfo.getAvatarUrl()); user.setAvatar(userInfo.getAvatarUrl());
user.setNickname(userInfo.getNickName()); user.setNickname(userInfo.getNickName());
user.setGender(userInfo.getGender() == 1 ? "男" : "女"); user.setGender(userInfo.getGender());
user.setUserLevel("普通用户"); user.setUserLevel((byte)0);
user.setStatus("可用"); user.setStatus((byte)0);
user.setLastLoginTime(LocalDateTime.now()); user.setLastLoginTime(LocalDateTime.now());
user.setLastLoginIp(IpUtil.client(request)); user.setLastLoginIp(IpUtil.client(request));
user.setAddTime(LocalDateTime.now());
userService.add(user); userService.add(user);
} }
else{ else{
...@@ -232,9 +234,9 @@ public class WxAuthController { ...@@ -232,9 +234,9 @@ public class WxAuthController {
user.setWeixinOpenid(""); user.setWeixinOpenid("");
user.setAvatar("https://yanxuan.nosdn.127.net/80841d741d7fa3073e0ae27bf487339f.jpg?imageView&quality=90&thumbnail=64x64"); user.setAvatar("https://yanxuan.nosdn.127.net/80841d741d7fa3073e0ae27bf487339f.jpg?imageView&quality=90&thumbnail=64x64");
user.setNickname(username); user.setNickname(username);
user.setGender("未知"); user.setGender((byte)0);
user.setUserLevel("普通用户"); user.setUserLevel((byte)0);
user.setStatus("可用"); user.setStatus((byte)0);
user.setLastLoginTime(LocalDateTime.now()); user.setLastLoginTime(LocalDateTime.now());
user.setLastLoginIp(IpUtil.client(request)); user.setLastLoginIp(IpUtil.client(request));
user.setAddTime(LocalDateTime.now()); user.setAddTime(LocalDateTime.now());
......
...@@ -65,10 +65,10 @@ public class WxCartController { ...@@ -65,10 +65,10 @@ public class WxCartController {
BigDecimal checkedGoodsAmount = new BigDecimal(0.00); BigDecimal checkedGoodsAmount = new BigDecimal(0.00);
for (LitemallCart cart : cartList) { for (LitemallCart cart : cartList) {
goodsCount += cart.getNumber(); 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()) { if (cart.getChecked()) {
checkedGoodsCount += cart.getNumber(); checkedGoodsCount += cart.getNumber();
checkedGoodsAmount = checkedGoodsAmount.add(cart.getRetailPrice().multiply(new BigDecimal(cart.getNumber()))); checkedGoodsAmount = checkedGoodsAmount.add(cart.getPrice().multiply(new BigDecimal(cart.getNumber())));
} }
} }
Map<String, Object> cartTotal = new HashMap<>(); Map<String, Object> cartTotal = new HashMap<>();
...@@ -127,32 +127,16 @@ public class WxCartController { ...@@ -127,32 +127,16 @@ public class WxCartController {
LitemallCart existCart = cartService.queryExist(goodsId, productId, userId); LitemallCart existCart = cartService.queryExist(goodsId, productId, userId);
if(existCart == null){ if(existCart == null){
//取得规格的信息,判断规格库存 //取得规格的信息,判断规格库存
if(product == null || number > product.getGoodsNumber() ){ if(product == null || number > product.getNumber() ){
return ResponseUtil.fail(400, "库存不足"); 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.setId(null);
cart.setGoodsSn(goods.getGoodsSn()); cart.setGoodsSn(goods.getGoodsSn());
cart.setGoodsName((goods.getName())); cart.setGoodsName((goods.getName()));
cart.setPicUrl(goods.getPrimaryPicUrl()); cart.setPicUrl(goods.getPicUrl());
cart.setRetailPrice(product.getRetailPrice()); cart.setPrice(product.getPrice());
cart.setGoodsSpecificationIds(product.getGoodsSpecificationIds()); cart.setSpecifications(product.getSpecifications());
cart.setGoodsSpecificationValues(goodsSpecificationValue);
cart.setUserId(userId); cart.setUserId(userId);
cart.setChecked(true); cart.setChecked(true);
cartService.add(cart); cartService.add(cart);
...@@ -160,7 +144,7 @@ public class WxCartController { ...@@ -160,7 +144,7 @@ public class WxCartController {
else{ else{
//取得规格的信息,判断规格库存 //取得规格的信息,判断规格库存
int num = existCart.getNumber() + number; int num = existCart.getNumber() + number;
if(num > product.getGoodsNumber()){ if(num > product.getNumber()){
return ResponseUtil.fail(400, "库存不足"); return ResponseUtil.fail(400, "库存不足");
} }
existCart.setNumber((short)num); existCart.setNumber((short)num);
...@@ -215,32 +199,16 @@ public class WxCartController { ...@@ -215,32 +199,16 @@ public class WxCartController {
LitemallCart existCart = cartService.queryExist(goodsId, productId, userId); LitemallCart existCart = cartService.queryExist(goodsId, productId, userId);
if(existCart == null){ if(existCart == null){
//取得规格的信息,判断规格库存 //取得规格的信息,判断规格库存
if(product == null || number > product.getGoodsNumber() ){ if(product == null || number > product.getNumber() ){
return ResponseUtil.fail(400, "库存不足"); 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.setId(null);
cart.setGoodsSn(goods.getGoodsSn()); cart.setGoodsSn(goods.getGoodsSn());
cart.setGoodsName((goods.getName())); cart.setGoodsName((goods.getName()));
cart.setPicUrl(goods.getPrimaryPicUrl()); cart.setPicUrl(goods.getPicUrl());
cart.setRetailPrice(product.getRetailPrice()); cart.setPrice(product.getPrice());
cart.setGoodsSpecificationIds(product.getGoodsSpecificationIds()); cart.setSpecifications(product.getSpecifications());
cart.setGoodsSpecificationValues(goodsSpecificationValue);
cart.setUserId(userId); cart.setUserId(userId);
cart.setChecked(true); cart.setChecked(true);
cartService.add(cart); cartService.add(cart);
...@@ -248,7 +216,7 @@ public class WxCartController { ...@@ -248,7 +216,7 @@ public class WxCartController {
else{ else{
//取得规格的信息,判断规格库存 //取得规格的信息,判断规格库存
int num = number; int num = number;
if(num > product.getGoodsNumber()){ if(num > product.getNumber()){
return ResponseUtil.fail(400, "库存不足"); return ResponseUtil.fail(400, "库存不足");
} }
existCart.setNumber((short)num); existCart.setNumber((short)num);
...@@ -307,7 +275,7 @@ public class WxCartController { ...@@ -307,7 +275,7 @@ public class WxCartController {
//取得规格的信息,判断规格库存 //取得规格的信息,判断规格库存
LitemallProduct product = productService.findById(productId); LitemallProduct product = productService.findById(productId);
if(product == null || product.getGoodsNumber() < number){ if(product == null || product.getNumber() < number){
return ResponseUtil.fail(403, "库存不足"); return ResponseUtil.fail(403, "库存不足");
} }
...@@ -498,7 +466,7 @@ public class WxCartController { ...@@ -498,7 +466,7 @@ public class WxCartController {
} }
BigDecimal checkedGoodsPrice = new BigDecimal(0.00); BigDecimal checkedGoodsPrice = new BigDecimal(0.00);
for (LitemallCart cart : checkedGoodsList) { 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元; // 根据订单商品总价计算运费,满88则免运费,否则8元;
......
...@@ -29,7 +29,7 @@ public class WxCollectController { ...@@ -29,7 +29,7 @@ public class WxCollectController {
* 用户收藏列表 * 用户收藏列表
* *
* @param userId 用户ID * @param userId 用户ID
* @param typeId 类型ID * @param type 类型,如果是0则是商品收藏,如果是1则是专题收藏
* 目前没有使用 * 目前没有使用
* @param page 分页页数 * @param page 分页页数
* @param size 分页大小 * @param size 分页大小
...@@ -47,31 +47,31 @@ public class WxCollectController { ...@@ -47,31 +47,31 @@ public class WxCollectController {
* 失败则 { errno: XXX, errmsg: XXX } * 失败则 { errno: XXX, errmsg: XXX }
*/ */
@GetMapping("list") @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 = "page", defaultValue = "1") Integer page,
@RequestParam(value = "size", defaultValue = "10") Integer size) { @RequestParam(value = "size", defaultValue = "10") Integer size) {
if(userId == null){ if(userId == null){
return ResponseUtil.unlogin(); return ResponseUtil.unlogin();
} }
if(typeId == null){ if(type == null){
return ResponseUtil.badArgument(); return ResponseUtil.badArgument();
} }
List<LitemallCollect> collectList = collectService.queryByType(userId, typeId, page, size); List<LitemallCollect> collectList = collectService.queryByType(userId, type, page, size);
int count = collectService.countByType(userId, typeId); int count = collectService.countByType(userId, type);
int totalPages = (int) Math.ceil((double) count / size); int totalPages = (int) Math.ceil((double) count / size);
List<Object> collects = new ArrayList<>(collectList.size()); List<Object> collects = new ArrayList<>(collectList.size());
for(LitemallCollect collect : collectList){ for(LitemallCollect collect : collectList){
Map<String, Object> c = new HashMap(); Map<String, Object> c = new HashMap();
c.put("id", collect.getId()); c.put("id", collect.getId());
c.put("typeId", collect.getTypeId()); c.put("type", collect.getType());
c.put("valueId", collect.getValueId()); c.put("valueId", collect.getValueId());
LitemallGoods goods = goodsService.findById(collect.getValueId()); LitemallGoods goods = goodsService.findById(collect.getValueId());
c.put("name", goods.getName()); c.put("name", goods.getName());
c.put("goodsBrief", goods.getGoodsBrief()); c.put("brief", goods.getBrief());
c.put("listPicUrl", goods.getListPicUrl()); c.put("picUrl", goods.getPicUrl());
c.put("retailPrice", goods.getRetailPrice()); c.put("retailPrice", goods.getRetailPrice());
collects.add(c); collects.add(c);
...@@ -109,13 +109,13 @@ public class WxCollectController { ...@@ -109,13 +109,13 @@ public class WxCollectController {
return ResponseUtil.badArgument(); return ResponseUtil.badArgument();
} }
Integer typeId = JacksonUtil.parseInteger(body, "typeId"); Byte type = JacksonUtil.parseByte(body, "type");
Integer valueId = JacksonUtil.parseInteger(body, "valueId"); Integer valueId = JacksonUtil.parseInteger(body, "valueId");
if(!ObjectUtils.allNotNull(typeId, valueId)){ if(!ObjectUtils.allNotNull(type, valueId)){
return ResponseUtil.badArgument(); return ResponseUtil.badArgument();
} }
LitemallCollect collect = collectService.queryByTypeAndValue(userId, typeId, valueId); LitemallCollect collect = collectService.queryByTypeAndValue(userId, type, valueId);
String handleType = null; String handleType = null;
if(collect != null){ if(collect != null){
...@@ -127,7 +127,7 @@ public class WxCollectController { ...@@ -127,7 +127,7 @@ public class WxCollectController {
collect = new LitemallCollect(); collect = new LitemallCollect();
collect.setUserId(userId); collect.setUserId(userId);
collect.setValueId(valueId); collect.setValueId(valueId);
collect.setTypeId(typeId); collect.setType(type);
collect.setAddTime(LocalDateTime.now()); collect.setAddTime(LocalDateTime.now());
collectService.add(collect); collectService.add(collect);
} }
......
...@@ -66,8 +66,8 @@ public class WxCommentController { ...@@ -66,8 +66,8 @@ public class WxCommentController {
/** /**
* 评论数量 * 评论数量
* *
* @param typeId 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。 * @param type 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。
* @param valueId 商品或专题ID。如果typeId是0,则是商品ID;如果typeId是1,则是专题ID。 * @param valueId 商品或专题ID。如果type是0,则是商品ID;如果type是1,则是专题ID。
* @return 评论数量 * @return 评论数量
* 成功则 * 成功则
* { * {
...@@ -82,9 +82,9 @@ public class WxCommentController { ...@@ -82,9 +82,9 @@ public class WxCommentController {
* 失败则 { errno: XXX, errmsg: XXX } * 失败则 { errno: XXX, errmsg: XXX }
*/ */
@GetMapping("count") @GetMapping("count")
public Object count(Byte typeId, Integer valueId) { public Object count(Byte type, Integer valueId) {
int allCount = commentService.count(typeId, valueId, 0, 0, 0); int allCount = commentService.count(type, valueId, 0, 0, 0);
int hasPicCount = commentService.count(typeId, valueId, 1, 0, 0); int hasPicCount = commentService.count(type, valueId, 1, 0, 0);
Map<String, Object> data = new HashMap(); Map<String, Object> data = new HashMap();
data.put("allCount", allCount); data.put("allCount", allCount);
data.put("hasPicCount", hasPicCount); data.put("hasPicCount", hasPicCount);
...@@ -94,8 +94,8 @@ public class WxCommentController { ...@@ -94,8 +94,8 @@ public class WxCommentController {
/** /**
* 评论列表 * 评论列表
* *
* @param typeId 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。 * @param type 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。
* @param valueId 商品或专题ID。如果typeId是0,则是商品ID;如果typeId是1,则是专题ID。 * @param valueId 商品或专题ID。如果type是0,则是商品ID;如果type是1,则是专题ID。
* @param showType 显示类型。如果是0,则查询全部;如果是1,则查询有图片的评论。 * @param showType 显示类型。如果是0,则查询全部;如果是1,则查询有图片的评论。
* @param page 分页页数 * @param page 分页页数
* @param size 分页大小 * @param size 分页大小
...@@ -114,15 +114,15 @@ public class WxCommentController { ...@@ -114,15 +114,15 @@ public class WxCommentController {
* 失败则 { errno: XXX, errmsg: XXX } * 失败则 { errno: XXX, errmsg: XXX }
*/ */
@GetMapping("list") @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 = "page", defaultValue = "1") Integer page,
@RequestParam(value = "size", defaultValue = "10") Integer size) { @RequestParam(value = "size", defaultValue = "10") Integer size) {
if(!ObjectUtils.allNotNull(typeId, valueId, showType)){ if(!ObjectUtils.allNotNull(type, valueId, showType)){
return ResponseUtil.badArgument(); return ResponseUtil.badArgument();
} }
List<LitemallComment> commentList = commentService.query(typeId, valueId, showType, page, size); List<LitemallComment> commentList = commentService.query(type, valueId, showType, page, size);
int count = commentService.count(typeId, valueId, showType, page, size); int count = commentService.count(type, valueId, showType, page, size);
List<Map<String, Object>> commentVoList = new ArrayList<>(commentList.size()); List<Map<String, Object>> commentVoList = new ArrayList<>(commentList.size());
for(LitemallComment comment : commentList){ for(LitemallComment comment : commentList){
......
...@@ -97,8 +97,8 @@ public class WxFootprintController { ...@@ -97,8 +97,8 @@ public class WxFootprintController {
LitemallGoods goods = goodsService.findById(footprint.getGoodsId()); LitemallGoods goods = goodsService.findById(footprint.getGoodsId());
c.put("name", goods.getName()); c.put("name", goods.getName());
c.put("goodsBrief", goods.getGoodsBrief()); c.put("brief", goods.getBrief());
c.put("listPicUrl", goods.getListPicUrl()); c.put("picUrl", goods.getPicUrl());
c.put("retailPrice", goods.getRetailPrice()); c.put("retailPrice", goods.getRetailPrice());
footprintVoList.add(c); footprintVoList.add(c);
......
...@@ -182,14 +182,14 @@ public class WxGoodsController { ...@@ -182,14 +182,14 @@ public class WxGoodsController {
LitemallCategory parent = null; LitemallCategory parent = null;
List<LitemallCategory> children = null; List<LitemallCategory> children = null;
if(cur.getParentId() == 0){ if(cur.getPid() == 0){
parent = cur; parent = cur;
children = categoryService.queryByPid(cur.getId()); children = categoryService.queryByPid(cur.getId());
cur = children.get(0); cur = children.get(0);
} }
else{ else{
parent = categoryService.findById(cur.getParentId()); parent = categoryService.findById(cur.getPid());
children = categoryService.queryByPid(cur.getParentId()); children = categoryService.queryByPid(cur.getPid());
} }
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
data.put("currentCategory", cur); data.put("currentCategory", cur);
......
...@@ -57,7 +57,7 @@ public class WxHomeController { ...@@ -57,7 +57,7 @@ public class WxHomeController {
public Object index() { public Object index() {
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
List<LitemallAd> banner = adService.queryByApid(1); List<LitemallAd> banner = adService.queryIndex();
data.put("banner", banner); data.put("banner", banner);
List<LitemallCategory> channel = categoryService.queryChannel(); List<LitemallCategory> channel = categoryService.queryChannel();
......
...@@ -222,9 +222,9 @@ public class WxOrderController { ...@@ -222,9 +222,9 @@ public class WxOrderController {
orderGoodsVo.put("goodsId", orderGoods.getGoodsId()); orderGoodsVo.put("goodsId", orderGoods.getGoodsId());
orderGoodsVo.put("goodsName", orderGoods.getGoodsName()); orderGoodsVo.put("goodsName", orderGoods.getGoodsName());
orderGoodsVo.put("number", orderGoods.getNumber()); orderGoodsVo.put("number", orderGoods.getNumber());
orderGoodsVo.put("retailPrice", orderGoods.getRetailPrice()); orderGoodsVo.put("retailPrice", orderGoods.getPrice());
orderGoodsVo.put("picUrl", orderGoods.getPicUrl()); orderGoodsVo.put("picUrl", orderGoods.getPicUrl());
orderGoodsVo.put("goodsSpecificationValues", orderGoods.getGoodsSpecificationValues()); orderGoodsVo.put("goodsSpecificationValues", orderGoods.getSpecifications());
orderGoodsVoList.add(orderGoodsVo); orderGoodsVoList.add(orderGoodsVo);
} }
...@@ -284,7 +284,7 @@ public class WxOrderController { ...@@ -284,7 +284,7 @@ public class WxOrderController {
} }
BigDecimal checkedGoodsPrice = new BigDecimal(0.00); BigDecimal checkedGoodsPrice = new BigDecimal(0.00);
for (LitemallCart checkGoods : checkedGoodsList) { 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元; // 根据订单商品总价计算运费,满88则免运费,否则8元;
...@@ -337,10 +337,9 @@ public class WxOrderController { ...@@ -337,10 +337,9 @@ public class WxOrderController {
orderGoods.setProductId(cartGoods.getProductId()); orderGoods.setProductId(cartGoods.getProductId());
orderGoods.setGoodsName(cartGoods.getGoodsName()); orderGoods.setGoodsName(cartGoods.getGoodsName());
orderGoods.setPicUrl(cartGoods.getPicUrl()); orderGoods.setPicUrl(cartGoods.getPicUrl());
orderGoods.setRetailPrice(cartGoods.getRetailPrice()); orderGoods.setPrice(cartGoods.getPrice());
orderGoods.setNumber(cartGoods.getNumber()); orderGoods.setNumber(cartGoods.getNumber());
orderGoods.setGoodsSpecificationIds(cartGoods.getGoodsSpecificationIds()); orderGoods.setSpecifications(cartGoods.getSpecifications());
orderGoods.setGoodsSpecificationValues(cartGoods.getGoodsSpecificationValues());
orderGoods.setAddTime(LocalDateTime.now()); orderGoods.setAddTime(LocalDateTime.now());
// 添加订单商品表项 // 添加订单商品表项
...@@ -355,11 +354,11 @@ public class WxOrderController { ...@@ -355,11 +354,11 @@ public class WxOrderController {
Integer productId = checkGoods.getProductId(); Integer productId = checkGoods.getProductId();
LitemallProduct product = productService.findById(productId); LitemallProduct product = productService.findById(productId);
Integer remainNumber = product.getGoodsNumber() - checkGoods.getNumber(); Integer remainNumber = product.getNumber() - checkGoods.getNumber();
if (remainNumber < 0) { if (remainNumber < 0) {
throw new RuntimeException("下单的商品货品数量大于库存量"); throw new RuntimeException("下单的商品货品数量大于库存量");
} }
product.setGoodsNumber(remainNumber); product.setNumber(remainNumber);
productService.updateById(product); productService.updateById(product);
} }
} catch (Exception ex) { } catch (Exception ex) {
...@@ -425,8 +424,8 @@ public class WxOrderController { ...@@ -425,8 +424,8 @@ public class WxOrderController {
for (LitemallOrderGoods orderGoods : orderGoodsList) { for (LitemallOrderGoods orderGoods : orderGoodsList) {
Integer productId = orderGoods.getProductId(); Integer productId = orderGoods.getProductId();
LitemallProduct product = productService.findById(productId); LitemallProduct product = productService.findById(productId);
Integer number = product.getGoodsNumber() + orderGoods.getNumber(); Integer number = product.getNumber() + orderGoods.getNumber();
product.setGoodsNumber(number); product.setNumber(number);
productService.updateById(product); productService.updateById(product);
} }
} catch (Exception ex) { } catch (Exception ex) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="brand-list" > <view class="brand-list" >
<navigator url="../brandDetail/brandDetail?id={{item.id}}" class="item" wx:for="{{brandList}}" wx:key="id"> <navigator url="../brandDetail/brandDetail?id={{item.id}}" class="item" wx:for="{{brandList}}" wx:key="id">
<view class="img-bg"> <view class="img-bg">
<image src="{{item.appListPicUrl}}" background-size="cover"></image> <image src="{{item.picUrl}}" background-size="cover"></image>
</view> </view>
<view class="txt-box"> <view class="txt-box">
<view class="line"> <view class="line">
......
<view class="container"> <view class="container">
<view class="brand-info"> <view class="brand-info">
<view class="name"> <view class="name">
<image class="img" src="{{brand.appListPicUrl}}" background-size="cover"></image> <image class="img" src="{{brand.picUrl}}" background-size="cover"></image>
<view class="info-box"> <view class="info-box">
<view class="info"> <view class="info">
<text class="txt">{{brand.name}}</text> <text class="txt">{{brand.name}}</text>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</view> </view>
</view> </view>
<view class="desc"> <view class="desc">
{{brand.simpleDesc}} {{brand.desc}}
</view> </view>
</view> </view>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<view class="b"> <view class="b">
<block wx:for="{{goodsList}}" wx:key="id" wx:for-index="iindex" wx:for-item="iitem"> <block wx:for="{{goodsList}}" wx:key="id" wx:for-index="iindex" wx:for-item="iitem">
<navigator class="item {{iindex % 2 == 0 ? 'item-b' : ''}}" url="../goods/goods?id={{iitem.id}}"> <navigator class="item {{iindex % 2 == 0 ? 'item-b' : ''}}" url="../goods/goods?id={{iitem.id}}">
<image class="img" src="{{iitem.listPicUrl}}" background-size="cover"></image> <image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text> <text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text> <text class="price">¥{{iitem.retailPrice}}</text>
</navigator> </navigator>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</view> </view>
<view class="attr">{{ isEditCart ? '已选择:' : ''}}{{item.goodsSpecificationValues||''}}</view> <view class="attr">{{ isEditCart ? '已选择:' : ''}}{{item.goodsSpecificationValues||''}}</view>
<view class="b"> <view class="b">
<text class="price">¥{{item.retailPrice}}</text> <text class="price">¥{{item.price}}</text>
<view class="selnum"> <view class="selnum">
<view class="cut" bindtap="cutNumber" data-item-index="{{index}}">-</view> <view class="cut" bindtap="cutNumber" data-item-index="{{index}}">-</view>
<input value="{{item.number}}" class="number" disabled="true" type="number" /> <input value="{{item.number}}" class="number" disabled="true" type="number" />
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</scroll-view> </scroll-view>
<scroll-view class="cate" scroll-y="true"> <scroll-view class="cate" scroll-y="true">
<navigator url="url" class="banner"> <navigator url="url" class="banner">
<image class="image" src="{{currentCategory.wapBannerUrl}}"></image> <image class="image" src="{{currentCategory.picUrl}}"></image>
<view class="txt">{{currentCategory.frontName}}</view> <view class="txt">{{currentCategory.frontName}}</view>
</navigator> </navigator>
<view class="hd"> <view class="hd">
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</view> </view>
<view class="bd"> <view class="bd">
<navigator url="/pages/category/category?id={{item.id}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:key="id" wx:for="{{currentSubCategoryList}}"> <navigator url="/pages/category/category?id={{item.id}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:key="id" wx:for="{{currentSubCategoryList}}">
<image class="icon" src="{{item.wapBannerUrl}}"></image> <image class="icon" src="{{item.picUrl}}"></image>
<text class="txt">{{item.name}}</text> <text class="txt">{{item.name}}</text>
</navigator> </navigator>
</view> </view>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</view> </view>
<view class="b"> <view class="b">
<navigator class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}" url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:key="id" wx:for-item="iitem" wx:for-index="iindex" > <navigator class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}" url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:key="id" wx:for-item="iitem" wx:for-index="iindex" >
<image class="img" src="{{iitem.listPicUrl}}" background-size="cover"></image> <image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text> <text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text> <text class="price">¥{{iitem.retailPrice}}</text>
</navigator> </navigator>
......
...@@ -7,7 +7,7 @@ Page({ ...@@ -7,7 +7,7 @@ Page({
comments: [], comments: [],
allCommentList: [], allCommentList: [],
picCommentList: [], picCommentList: [],
typeId: 0, type: 0,
valueId: 0, valueId: 0,
showType: 0, showType: 0,
allCount: 0, allCount: 0,
...@@ -18,7 +18,7 @@ Page({ ...@@ -18,7 +18,7 @@ Page({
}, },
getCommentCount: function () { getCommentCount: function () {
let that = this; 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) { if (res.errno === 0) {
that.setData({ that.setData({
allCount: res.data.allCount, allCount: res.data.allCount,
...@@ -31,7 +31,7 @@ Page({ ...@@ -31,7 +31,7 @@ Page({
let that = this; let that = this;
util.request(api.CommentList, { util.request(api.CommentList, {
valueId: that.data.valueId, valueId: that.data.valueId,
typeId: that.data.typeId, type: that.data.type,
size: that.data.size, size: that.data.size,
page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage), page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage),
showType: that.data.showType showType: that.data.showType
...@@ -57,7 +57,7 @@ Page({ ...@@ -57,7 +57,7 @@ Page({
onLoad: function (options) { onLoad: function (options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
this.setData({ this.setData({
typeId: options.typeId, type: options.type,
valueId: options.valueId valueId: options.valueId
}); });
this.getCommentCount(); this.getCommentCount();
......
...@@ -5,7 +5,7 @@ var api = require('../../config/api.js'); ...@@ -5,7 +5,7 @@ var api = require('../../config/api.js');
Page({ Page({
data: { data: {
orderId: 0, orderId: 0,
typeId: 0, type: 0,
valueId: 0, valueId: 0,
orderGoods: {}, orderGoods: {},
content: '', content: '',
...@@ -102,7 +102,7 @@ Page({ ...@@ -102,7 +102,7 @@ Page({
var that = this; var that = this;
that.setData({ that.setData({
orderId: options.orderId, orderId: options.orderId,
typeId: options.typeId, type: options.type,
valueId: options.valueId valueId: options.valueId
}); });
this.getOrderComment(); this.getOrderComment();
...@@ -131,7 +131,7 @@ Page({ ...@@ -131,7 +131,7 @@ Page({
} }
util.request(api.CommentPost, { util.request(api.CommentPost, {
typeId: that.data.typeId, type: that.data.type,
valueId: that.data.valueId, valueId: that.data.valueId,
content: that.data.content, content: that.data.content,
star: that.data.star, star: that.data.star,
......
...@@ -40,7 +40,7 @@ Page({ ...@@ -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; let _goodsPrice = res.data.info.retailPrice;
if (_productPrice != _goodsPrice){ if (_productPrice != _goodsPrice){
console.error('商品数量价格和货品不一致'); console.error('商品数量价格和货品不一致');
...@@ -75,7 +75,7 @@ Page({ ...@@ -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(); that.getGoodsRelated();
} }
...@@ -161,7 +161,7 @@ Page({ ...@@ -161,7 +161,7 @@ Page({
}, },
getCheckedSpecKey: function () { getCheckedSpecKey: function () {
let checkedValue = this.getCheckedSpecValue().map(function (v) { let checkedValue = this.getCheckedSpecValue().map(function (v) {
return v.valueId; return v.valueText;
}); });
return checkedValue; return checkedValue;
...@@ -206,9 +206,9 @@ Page({ ...@@ -206,9 +206,9 @@ Page({
} }
let checkedProduct = checkedProductArray[0]; let checkedProduct = checkedProductArray[0];
if (checkedProduct.goodsNumber > 0){ if (checkedProduct.number > 0){
this.setData({ this.setData({
checkedSpecPrice: checkedProduct.retailPrice, checkedSpecPrice: checkedProduct.price,
soldout: false soldout: false
}); });
} }
...@@ -231,7 +231,7 @@ Page({ ...@@ -231,7 +231,7 @@ Page({
}, },
getCheckedProductItem: function (key) { getCheckedProductItem: function (key) {
return this.data.productList.filter(function (v) { return this.data.productList.filter(function (v) {
if (v.goodsSpecificationIds.toString() == key.toString()) { if (v.specifications.toString() == key.toString()) {
return true; return true;
} else { } else {
return false; return false;
...@@ -293,7 +293,7 @@ Page({ ...@@ -293,7 +293,7 @@ Page({
} }
} else { } 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) { .then(function (res) {
let _res = res; let _res = res;
if (_res.errno == 0) { if (_res.errno == 0) {
...@@ -354,7 +354,7 @@ Page({ ...@@ -354,7 +354,7 @@ Page({
let checkedProduct = checkedProductArray[0]; let checkedProduct = checkedProductArray[0];
//验证库存 //验证库存
if (checkedProduct.goodsNumber <= 0) { if (checkedProduct.number <= 0) {
wx.showToast({ wx.showToast({
image: '/static/images/icon_error.png', image: '/static/images/icon_error.png',
title: '没有库存' title: '没有库存'
...@@ -420,7 +420,7 @@ Page({ ...@@ -420,7 +420,7 @@ Page({
let checkedProduct = checkedProductArray[0]; let checkedProduct = checkedProductArray[0];
//验证库存 //验证库存
if (checkedProduct.goodsNumber <= 0) { if (checkedProduct.number <= 0) {
wx.showToast({ wx.showToast({
image: '/static/images/icon_error.png', image: '/static/images/icon_error.png',
title: '没有库存' title: '没有库存'
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</view> </view>
<view class="comments" wx:if="{{comment.count > 0}}"> <view class="comments" wx:if="{{comment.count > 0}}">
<view class="h"> <view class="h">
<navigator url="/pages/comment/comment?valueId={{goods.id}}&typeId=0"> <navigator url="/pages/comment/comment?valueId={{goods.id}}&type=0">
<text class="t">评价({{comment.count > 999 ? '999+' : comment.count}})</text> <text class="t">评价({{comment.count > 999 ? '999+' : comment.count}})</text>
<text class="i">查看全部</text> <text class="i">查看全部</text>
</navigator> </navigator>
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<view class="b"> <view class="b">
<view class="item" wx:for="{{relatedGoods}}" wx:key="id"> <view class="item" wx:for="{{relatedGoods}}" wx:key="id">
<navigator url="/pages/goods/goods?id={{item.id}}"> <navigator url="/pages/goods/goods?id={{item.id}}">
<image class="img" src="{{item.listPicUrl}}" background-size="cover"></image> <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
<text class="name">{{item.name}}</text> <text class="name">{{item.name}}</text>
<text class="price">¥{{item.retailPrice}}</text> <text class="price">¥{{item.retailPrice}}</text>
</navigator> </navigator>
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
</view> </view>
<view wx:if="{{openAttr}}" class="attr-pop"> <view wx:if="{{openAttr}}" class="attr-pop">
<view class="img-info"> <view class="img-info">
<image class="img" src="{{goods.primaryPicUrl}}"></image> <image class="img" src="{{goods.picUrl}}"></image>
<view class="info"> <view class="info">
<view class="c"> <view class="c">
<view class="p">价格:¥{{checkedSpecPrice}}</view> <view class="p">价格:¥{{checkedSpecPrice}}</view>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<view class="b"> <view class="b">
<block wx:for="{{goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id"> <block wx:for="{{goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<navigator class="item {{iindex % 2 == 0 ? 'item-b' : '' }}" url="../goods/goods?id={{iitem.id}}"> <navigator class="item {{iindex % 2 == 0 ? 'item-b' : '' }}" url="../goods/goods?id={{iitem.id}}">
<image class="img" src="{{iitem.listPicUrl}}" background-size="cover"></image> <image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text> <text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text> <text class="price">¥{{iitem.retailPrice}}</text>
</navigator> </navigator>
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<view class="b"> <view class="b">
<view class="item" wx:for="{{newGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id"> <view class="item" wx:for="{{newGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="../goods/goods?id={{item.id}}"> <navigator url="../goods/goods?id={{item.id}}">
<image class="img" src="{{item.listPicUrl}}" background-size="cover"></image> <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
<text class="name">{{item.name}}</text> <text class="name">{{item.name}}</text>
<text class="price">¥{{item.retailPrice}}</text> <text class="price">¥{{item.retailPrice}}</text>
</navigator> </navigator>
...@@ -64,11 +64,11 @@ ...@@ -64,11 +64,11 @@
<view class="b"> <view class="b">
<view class="item" wx:for="{{hotGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id"> <view class="item" wx:for="{{hotGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="/pages/goods/goods?id={{item.id}}"> <navigator url="/pages/goods/goods?id={{item.id}}">
<image class="img" src="{{item.listPicUrl}}" background-size="cover"></image> <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
<view class="right"> <view class="right">
<view class="text"> <view class="text">
<text class="name">{{item.name}}</text> <text class="name">{{item.name}}</text>
<text class="desc">{{item.goods_brief}}</text> <text class="desc">{{item.brief}}</text>
<text class="price">¥{{item.retailPrice}}</text> <text class="price">¥{{item.retailPrice}}</text>
</view> </view>
</view> </view>
...@@ -88,10 +88,10 @@ ...@@ -88,10 +88,10 @@
<scroll-view scroll-x class="list"> <scroll-view scroll-x class="list">
<view class="item" wx:for="{{topics}}" wx:for-index="index" wx:for-item="item" wx:key="id"> <view class="item" wx:for="{{topics}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="../topicDetail/topicDetail?id={{item.id}}"> <navigator url="../topicDetail/topicDetail?id={{item.id}}">
<image class="img" src="{{item.scenePicUrl}}" background-size="cover"></image> <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
<view class="np"> <view class="np">
<text class="name">{{item.title}}</text> <text class="name">{{item.title}}</text>
<text class="price">¥{{item.priceInfo}}元起</text> <text class="price">¥{{item.price}}元起</text>
</view> </view>
<text class="desc">{{item.subtitle}}</text> <text class="desc">{{item.subtitle}}</text>
</navigator> </navigator>
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<block wx:for="{{item.goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id"> <block wx:for="{{item.goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<view class="item {{iindex % 2 == 0 ? '' : 'item-b'}}"> <view class="item {{iindex % 2 == 0 ? '' : 'item-b'}}">
<navigator url="../goods/goods?id={{iitem.id}}" class="a"> <navigator url="../goods/goods?id={{iitem.id}}" class="a">
<image class="img" src="{{iitem.listPicUrl}}" background-size="cover"></image> <image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text> <text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text> <text class="price">¥{{iitem.retailPrice}}</text>
</navigator> </navigator>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment