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 {
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());
......
......@@ -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<String, Object> 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元;
......
......@@ -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<LitemallCollect> collectList = collectService.queryByType(userId, typeId, page, size);
int count = collectService.countByType(userId, typeId);
List<LitemallCollect> collectList = collectService.queryByType(userId, type, page, size);
int count = collectService.countByType(userId, type);
int totalPages = (int) Math.ceil((double) count / size);
List<Object> collects = new ArrayList<>(collectList.size());
for(LitemallCollect collect : collectList){
Map<String, Object> 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);
}
......
......@@ -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<String, Object> 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<LitemallComment> commentList = commentService.query(typeId, valueId, showType, page, size);
int count = commentService.count(typeId, valueId, showType, page, size);
List<LitemallComment> commentList = commentService.query(type, valueId, showType, page, size);
int count = commentService.count(type, valueId, showType, page, size);
List<Map<String, Object>> commentVoList = new ArrayList<>(commentList.size());
for(LitemallComment comment : commentList){
......
......@@ -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);
......
......@@ -182,14 +182,14 @@ public class WxGoodsController {
LitemallCategory parent = null;
List<LitemallCategory> 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<String, Object> data = new HashMap<>();
data.put("currentCategory", cur);
......
......@@ -57,7 +57,7 @@ public class WxHomeController {
public Object index() {
Map<String, Object> data = new HashMap<>();
List<LitemallAd> banner = adService.queryByApid(1);
List<LitemallAd> banner = adService.queryIndex();
data.put("banner", banner);
List<LitemallCategory> channel = categoryService.queryChannel();
......
......@@ -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) {
......
......@@ -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",
......
......@@ -2,7 +2,7 @@
<view class="brand-list" >
<navigator url="../brandDetail/brandDetail?id={{item.id}}" class="item" wx:for="{{brandList}}" wx:key="id">
<view class="img-bg">
<image src="{{item.appListPicUrl}}" background-size="cover"></image>
<image src="{{item.picUrl}}" background-size="cover"></image>
</view>
<view class="txt-box">
<view class="line">
......
<view class="container">
<view class="brand-info">
<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">
<text class="txt">{{brand.name}}</text>
......@@ -10,7 +10,7 @@
</view>
</view>
<view class="desc">
{{brand.simpleDesc}}
{{brand.desc}}
</view>
</view>
......@@ -18,7 +18,7 @@
<view class="b">
<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}}">
<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="price">¥{{iitem.retailPrice}}</text>
</navigator>
......
......@@ -33,7 +33,7 @@
</view>
<view class="attr">{{ isEditCart ? '已选择:' : ''}}{{item.goodsSpecificationValues||''}}</view>
<view class="b">
<text class="price">¥{{item.retailPrice}}</text>
<text class="price">¥{{item.price}}</text>
<view class="selnum">
<view class="cut" bindtap="cutNumber" data-item-index="{{index}}">-</view>
<input value="{{item.number}}" class="number" disabled="true" type="number" />
......
......@@ -11,7 +11,7 @@
</scroll-view>
<scroll-view class="cate" scroll-y="true">
<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>
</navigator>
<view class="hd">
......@@ -21,7 +21,7 @@
</view>
<view class="bd">
<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>
</navigator>
</view>
......
......@@ -15,7 +15,7 @@
</view>
<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" >
<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="price">¥{{iitem.retailPrice}}</text>
</navigator>
......
......@@ -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();
......
......@@ -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,
......
......@@ -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: '没有库存'
......
......@@ -28,7 +28,7 @@
</view>
<view class="comments" wx:if="{{comment.count > 0}}">
<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="i">查看全部</text>
</navigator>
......@@ -92,7 +92,7 @@
<view class="b">
<view class="item" wx:for="{{relatedGoods}}" wx:key="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="price">¥{{item.retailPrice}}</text>
</navigator>
......@@ -102,7 +102,7 @@
</view>
<view wx:if="{{openAttr}}" class="attr-pop">
<view class="img-info">
<image class="img" src="{{goods.primaryPicUrl}}"></image>
<image class="img" src="{{goods.picUrl}}"></image>
<view class="info">
<view class="c">
<view class="p">价格:¥{{checkedSpecPrice}}</view>
......
......@@ -30,7 +30,7 @@
<view class="b">
<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}}">
<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="price">¥{{iitem.retailPrice}}</text>
</navigator>
......
......@@ -46,7 +46,7 @@
<view class="b">
<view class="item" wx:for="{{newGoods}}" wx:for-index="index" wx:for-item="item" wx:key="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="price">¥{{item.retailPrice}}</text>
</navigator>
......@@ -64,11 +64,11 @@
<view class="b">
<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}}">
<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="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>
</view>
</view>
......@@ -88,10 +88,10 @@
<scroll-view scroll-x class="list">
<view class="item" wx:for="{{topics}}" wx:for-index="index" wx:for-item="item" wx:key="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">
<text class="name">{{item.title}}</text>
<text class="price">¥{{item.priceInfo}}元起</text>
<text class="price">¥{{item.price}}元起</text>
</view>
<text class="desc">{{item.subtitle}}</text>
</navigator>
......@@ -109,7 +109,7 @@
<block wx:for="{{item.goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<view class="item {{iindex % 2 == 0 ? '' : 'item-b'}}">
<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="price">¥{{iitem.retailPrice}}</text>
</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