Example #1
0
        public ActionResult Index()
        {
            // 新品推荐
            var recommendProducts = jlService.GetProductsRecommends();

            ViewBag.RecommendProducts = recommendProducts;

            // 产品中心
            ProductFilter filter = new ProductFilter();

            filter.Status = 0;
            var productCenter = jlService.ProductPage(PageReq <ProductFilter> .Create(filter, pageSize: 6));

            ViewBag.ProductCenter = productCenter.Data;

            // 套装系列
            var pager = PageReq.Create(pageSize: 5);

            jlService.ProductCategoryPage(pager);

            // members
            MemberFilter mf      = new MemberFilter();
            var          members = jlService.MemberPage(PageReq <MemberFilter> .Create(mf, pageSize: 5));

            ViewBag.Members = members.Data;

            // 资讯中心
            ArticleFilter af = new ArticleFilter();

            af.Status = Consts.ArticleStatus_Published;
            var articlePager = PageReq <ArticleFilter> .Create(af, pageSize : 8);

            articlePager.OrderBy = " order by addtime desc ";
            var articles = jlService.ArticlePage(articlePager);

            ViewBag.Articles = articles.Data;

            return(View());
        }