/// <summary> /// 获取首页新品上市商品列表 /// </summary> /// <returns></returns> public List <RecommendItemModel> GetHomeRecommendProductList() { var config = AppSettings.GetCachedConfig(); List <RecommendItemModel> res = new List <RecommendItemModel>(); List <RecommendProduct> resultList = RecommendFacade.QueryNewRecommendProduct(config.CountRecommendProductItemList, ConstValue.LanguageCode, ConstValue.CompanyCode); if (null != resultList && resultList.Count > 0) { foreach (var item in resultList) { RecommendItemModel model = new RecommendItemModel() { Code = item.ProductID, ID = item.SysNo, ImageUrl = ProductFacade.BuildProductImage(ImageUrlHelper.GetImageSize(ImageType.Middle), item.DefaultImage), Price = new SalesInfoModel() { CurrentPrice = item.RealPrice, BasicPrice = item.BasicPrice, TariffPrice = item.TariffPrice, CashRebate = item.CashRebate }, ProductTitle = item.ProductTitle, PromotionTitle = item.PromotionTitle }; res.Add(model); } } return(res); }
// // GET: /Brand/ /// <summary> /// 品牌街 /// </summary> /// <returns></returns> public ActionResult BrandStreet() { BrandStreetVM brandStreetVM = new BrandStreetVM() { TopBrands = RecommendFacade.GetBannerInfoByPositionID(-1, PageType.PageTypeAppHome, BannerPosition.PositionAppHomeBrandBig) .Take(4) .ToList() .ConvertAll <BrandItemVM>(banner => { return(new BrandItemVM() { ImageUrl = (banner.BannerResourceUrl ?? "").Trim(), BrandName = (banner.BannerTitle ?? "").Trim(), BrandID = banner.BannerLink.ExtractBrandSysNo() }); }), BrandGrid = RecommendFacade.GetBannerInfoByPositionID(-1, PageType.PageTypeAppHome, BannerPosition.PositionAppHomeBrandSmall) .Take(15) .ToList() .ConvertAll <BrandItemVM>(banner => { return(new BrandItemVM() { ImageUrl = (banner.BannerResourceUrl ?? "").Trim(), BrandName = (banner.BannerTitle ?? "").Trim(), BrandID = banner.BannerLink.ExtractBrandSysNo() }); }) }; return(View(brandStreetVM)); }
public List <RecommendItemModel> GetHomeRecommendItemList(int postionID, int count) { var recommendItemEntityList = RecommendFacade.QueryRecommendProduct(0, 0, postionID, count, ConstValue.LanguageCode, ConstValue.CompanyCode); List <RecommendItemModel> result = new List <RecommendItemModel>(); ImageSize imageSize = ImageUrlHelper.GetImageSize(ImageType.Middle); foreach (var itemEntity in recommendItemEntityList) { RecommendItemModel itemModel = new RecommendItemModel(); itemModel.ID = itemEntity.SysNo; itemModel.ProductTitle = itemEntity.BriefName; itemModel.PromotionTitle = itemEntity.PromotionTitle; itemModel.Code = itemEntity.ProductID; itemModel.ImageUrl = ProductFacade.BuildProductImage(imageSize, itemEntity.DefaultImage); var priceModel = new SalesInfoModel(); itemModel.Price = priceModel; priceModel.BasicPrice = itemEntity.BasicPrice; priceModel.CurrentPrice = itemEntity.RealPrice; priceModel.CashRebate = itemEntity.CashRebate; priceModel.TariffPrice = itemEntity.TariffPrice; priceModel.FreeEntryTax = itemEntity.TariffPrice <= ConstValue.TariffFreeLimit; decimal realTariffPrice = priceModel.TariffPrice; if (priceModel.FreeEntryTax) { realTariffPrice = 0; } priceModel.TotalPrice = itemEntity.CurrentPrice + itemEntity.CashRebate + realTariffPrice; result.Add(itemModel); } return(result); }
public List <BannerModel> GetHomeBanners() { var config = AppSettings.GetCachedConfig(); var homeBanner = RecommendFacade.GetBannerInfoByPositionID(config.PageIDAppHome, PageType.PageTypeAppHome, BannerPosition.PositionAppHomeTopBanner).Take(5); return(Transform(homeBanner)); }
/// <summary> /// 获取精选品牌列表 /// </summary> /// <returns></returns> public RecommendBrandModel GetRecommendBrands() { var config = AppSettings.GetCachedConfig(); List <BannerInfo> bannerBrandBigList = RecommendFacade.GetBannerInfoByPositionID(config.PageIDAppHome, PageType.PageTypeAppHome, BannerPosition.PositionAppHomeBrandBig).Take(4).ToList(); List <BannerInfo> bannerBrandSmallList = RecommendFacade.GetBannerInfoByPositionID(config.PageIDAppHome, PageType.PageTypeAppHome, BannerPosition.PositionAppHomeBrandSmall).Take(18).ToList(); RecommendBrandModel result = new RecommendBrandModel(); result.BigBrands = MapBrandItemList(bannerBrandBigList); result.SmallBrands = MapBrandItemList(bannerBrandSmallList); return(result); }
/// <summary> /// 取得品牌专区数据 /// </summary> /// <param name="queryInfo"></param> /// <returns></returns> public static BrandZoneVM QueryBrandZoneVM(BrandZoneQueryVM queryInfo) { BrandZoneVM result = new BrandZoneVM() { BrandSysNo = queryInfo.BrandSysNo }; result.ProductSearchResult = GetProductSearchResult(queryInfo); result.BannerList = RecommendFacade.GetBannerInfoByPositionID(queryInfo.BrandSysNo, PageType.BrandZone, BannerPosition.BrandZone_TopRight); result.HotProductList = GetBrandHotProductList(queryInfo); result.BrandInfo = GetBrandInfo(queryInfo); return(result); }
public List <FloorModel> GetHomeFloors() { var config = AppSettings.GetCachedConfig(); List <FloorEntity> floorList = RecommendFacade.GetFloorInfo((PageCodeType)config.PageCodeFloorAppHome, 1).ToList(); List <FloorModel> result = new List <FloorModel>(); foreach (var floor in floorList) { var model = MapFloor(floor); result.Add(model); } return(result); }