|
|
@@ -329,12 +329,17 @@
|
|
|
return false
|
|
|
}
|
|
|
if (item.num + pass * type > 0) {
|
|
|
- item.num += pass * type;
|
|
|
+
|
|
|
//修改商品数量
|
|
|
that.changeCartShop(item.cartId, item.num).then(function (data) {
|
|
|
- console.log(data);
|
|
|
+ if (data.data.status === 200) {
|
|
|
+ item.num += pass * type;
|
|
|
+ layer.msg('成功' + (type > 0 ? '添加' : '减少') + pass + '件商品')
|
|
|
+ } else {
|
|
|
+ layer.msg(data.data.msg);
|
|
|
+ }
|
|
|
})
|
|
|
- layer.msg('成功' + (type > 0 ? '添加' : '减少') + pass + '件商品')
|
|
|
+
|
|
|
} else {
|
|
|
layer.msg('商品数量不可小于0')
|
|
|
}
|