Authored by 邱骏

购物车结算时选择预售商品给予提示

... ... @@ -282,6 +282,7 @@ const selectProduct = (req, res, next) => {
req.ctx(service).selectGoods(uid, productId, shoppingKey, hasPromotion, cartDelList)
.then(ret => {
console.log(ret);
res.send(ret);
}).catch(next);
};
... ...
... ... @@ -570,6 +570,10 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => {
// 移除的商品列表
result.deleteShop = cartDelList;
if (cartDataRet.code === 500) {
result.message = cartDataRet.message;
}
// 接口异常时,购物车置为空
if (!cartData) {
result.isEmpty = true;
... ... @@ -578,7 +582,6 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => {
return result;
}
// 预售购物车,普通购物车 凑单链接
result.moreGoodsLink = '//list.yohobuy.com/new';
... ...
... ... @@ -166,6 +166,8 @@ function choiceOut(items) {
}).then(function(d) {
if (d.code === 200) {
refreshCart(d.data);
} else if (d.code === 500) {
new Alert(d.data.message || '操作失败!').show();
}
}).always(function() {
$('.loading').hide();
... ...