export function canComputedPackFee(v) {
  return v.pack && v.status != "return" && v.status != "refund" && v.status != "refunding";
}
export function returnCanComputedGoodsArr(arr) {
  return arr.filter((v) => canComputedPackFee(v));
}
export function returnPackFee(arr) {
  return arr
    .reduce((prve, cur) => {
      return prve + cur.packAmount;
    }, 0)
    .toFixed(2);
}

export function canTuicai(orderInfo, item) {
  return orderInfo.status == "unpaid" && item.num - item.returnNum > 0;
}
export function canTuiKuan(orderInfo, item) {
  return (orderInfo.status != "refund" && orderInfo.status != "unpaid") || item.status != "refund";
}
export function isTui(item) {
  return item.status == "return" || item.status == "refund" || item.status == "refunding";
}
export function numSum(arr) {
  const sum = arr.reduce((a, b) => {
    return a + b * 100;
  }, 0);
  return (sum / 100).toFixed(2);
}
//是否使用计算的会员价
export function isUseCalcPrice(order, item) {
  console.log(order);
  if (order.fullCouponDiscountAmount > 0 || order.pointsDiscountAmount > 0) {
    return true;
  } else {
    return false;
  }
}
//商品列表是否展示会员价
export function isShowGoodsVipPrice(item) {
  return item.isMember == 1 && item.memberPrice && item.memberPrice != item.price;
}
