private string GetFreightStr(long productId, decimal discount, string skuId, int addressId) { string freightStr = "免运费"; //if (addressId <= 0)//如果用户的默认收货地址为空,则运费没法计算 // return freightStr; bool isFree = false; if (addressId > 0) { isFree = ProductManagerApplication.IsFreeRegion(productId, discount, addressId, 1, skuId);//默认取第一个规格 } if (isFree) { freightStr = "免运费";//卖家承担运费 } else { decimal freight = ServiceApplication.Create <IProductService>().GetFreight(new List <long>() { productId }, new List <int>() { 1 }, addressId); freightStr = freight <= 0 ? "免运费" : string.Format("运费 {0}元", freight.ToString("f2")); } return(freightStr); }