...
|
...
|
@@ -273,9 +273,14 @@ const filterCartData = (result, uid) => { |
|
|
if (result.data && result.data.ordinary_cart_data) {
|
|
|
ordinaryCartData = result.data.ordinary_cart_data;
|
|
|
totalOrdinaryMoney = ordinaryCartData.shopping_cart_data.last_order_amount;
|
|
|
ordinaryGoods = _.concat(ordinaryGoods, ordinaryCartData.goods_list);
|
|
|
invalidGoods = _.concat(invalidGoods, ordinaryCartData.off_shelves_goods_list);
|
|
|
ordinarySoldOutGoods = _.concat(ordinarySoldOutGoods, ordinaryCartData.sold_out_goods_list);
|
|
|
|
|
|
ordinarySoldOutGoods = ordinaryCartData.sold_out_goods_list; // 库存不足商品
|
|
|
|
|
|
let soldOutWithoutStorage = _.filter(ordinarySoldOutGoods, {storage_number: '0'}); // 库存为0的商品失效
|
|
|
let soldOutWithStorage = _.reject(ordinarySoldOutGoods, {storage_number: '0'}); // 库存不为0的商品归为普通商品并显示库存不足
|
|
|
|
|
|
ordinaryGoods = _.concat(ordinaryGoods, ordinaryCartData.goods_list, soldOutWithStorage); // 正常商品
|
|
|
invalidGoods = _.concat(invalidGoods, ordinaryCartData.off_shelves_goods_list, soldOutWithoutStorage); // 失效商品
|
|
|
|
|
|
_.forEach(ordinaryGoods, function(good) {
|
|
|
buyNumber = parseInt(good.buy_number, 10);
|
...
|
...
|
@@ -299,8 +304,7 @@ const filterCartData = (result, uid) => { |
|
|
hasGoods: advancedGoods.length || ordinaryGoods.length || invalidGoods.length,
|
|
|
preSalePros: (advancedSoldOutGoods.length || advancedGoods.length) ?
|
|
|
_.concat(advancedGoods, advancedSoldOutGoods) : [],
|
|
|
commonPros: (ordinarySoldOutGoods.length || ordinaryGoods.length) ?
|
|
|
_.concat(ordinaryGoods, ordinarySoldOutGoods) : [],
|
|
|
commonPros: ordinaryGoods,
|
|
|
invalidPros: invalidGoods,
|
|
|
selectedNum: selectedAdvanceNum + selectedOrdinaryNum,
|
|
|
checkAll: totalNum === (selectedAdvanceNum + selectedOrdinaryNum),
|
...
|
...
|
|