public ActionResult AppManage() { Admin.Models.GiftsAppManageModel model = new GiftsAppManageModel(); var robj = _iGiftService.GetAdInfo(IntegralMallAdInfo.AdActivityType.Roulette, IntegralMallAdInfo.AdShowPlatform.APP); var cobj = _iGiftService.GetAdInfo(IntegralMallAdInfo.AdActivityType.ScratchCard, IntegralMallAdInfo.AdShowPlatform.APP); if (robj != null) { model.RouletteId = robj.ActivityId; } if (cobj != null) { model.ScratchCardId = cobj.ActivityId; } return(View(model)); }
public List <IntegralMallAdInfo> GetIntegralMallAd() { List <IntegralMallAdInfo> result = new List <IntegralMallAdInfo>(); var robj = _iGiftService.GetAdInfo(IntegralMallAdInfo.AdActivityType.Roulette, IntegralMallAdInfo.AdShowPlatform.APP); if (robj != null) { robj.LinkUrl = Request.RequestUri.Scheme + "://" + Request.RequestUri.Authority + "/m-app/BigWheel/index/" + robj.ActivityId; result.Add(robj); } var cobj = _iGiftService.GetAdInfo(IntegralMallAdInfo.AdActivityType.ScratchCard, IntegralMallAdInfo.AdShowPlatform.APP); if (cobj != null) { cobj.LinkUrl = Request.RequestUri.Scheme + "://" + Request.RequestUri.Authority + "/m-app/ScratchCard/index/" + cobj.ActivityId; result.Add(cobj); } return(result); }
/// <summary> /// 首页 /// </summary> /// <returns></returns> public ActionResult Index() { //轮播图 GiftsIndexModel result = new GiftsIndexModel(); var slidads = SlideApplication.GetSlidAds(0, Entities.SlideAdInfo.SlideAdType.AppGifts).ToList(); foreach (var item in slidads) { item.ImageUrl = HimallIO.GetRomoteImagePath(item.ImageUrl); } result.SlideAds = slidads; //大转盘刮刮卡 var robj = _iGiftService.GetAdInfo(IntegralMallAdInfo.AdActivityType.Roulette, IntegralMallAdInfo.AdShowPlatform.APP); if (robj != null) { robj.LinkUrl = "/m-wap/BigWheel/index/" + robj.ActivityId; result.WeiActives.Add(robj); } var cobj = _iGiftService.GetAdInfo(IntegralMallAdInfo.AdActivityType.ScratchCard, IntegralMallAdInfo.AdShowPlatform.APP); if (cobj != null) { cobj.LinkUrl = "/m-wap/ScratchCard/index/" + cobj.ActivityId; result.WeiActives.Add(cobj); } //首页礼品 GiftQuery query = new GiftQuery(); query.skey = ""; query.status = GiftInfo.GiftSalesStatus.Normal; query.PageSize = 4; query.PageNo = 1; QueryPageModel <GiftModel> gifts = _iGiftService.GetGifts(query); result.HomeGiftses = gifts.Models.ToList(); result.HasMoreGifts = gifts.Total > 4; foreach (var item in result.HomeGiftses) { item.DefaultShowImage = HimallIO.GetRomoteImagePath(item.GetImage(ImageSize.Size_350)); } //积分优惠券 var coupons = _iCouponService.GetIntegralCoupons(1, 3); Mapper.CreateMap <CouponInfo, CouponGetIntegralCouponModel>(); if (coupons.Models.Count > 0) { var datalist = coupons.Models.ToList(); var objlist = new List <CouponGetIntegralCouponModel>(); foreach (var item in datalist) { var tmp = Mapper.Map <CouponGetIntegralCouponModel>(item); tmp.ShowIntegralCover = HimallIO.GetRomoteImagePath(item.IntegralCover); var vshopobj = _iVShopService.GetVShopByShopId(tmp.ShopId); if (vshopobj != null) { tmp.VShopId = vshopobj.Id; //优惠价封面为空时,取微店Logo,微店Logo为空时,取商城微信Logo if (string.IsNullOrWhiteSpace(tmp.ShowIntegralCover)) { if (!string.IsNullOrWhiteSpace(vshopobj.WXLogo)) { tmp.ShowIntegralCover = HimallIO.GetRomoteImagePath(vshopobj.WXLogo); } } } if (string.IsNullOrWhiteSpace(tmp.ShowIntegralCover)) { var siteset = SiteSettingApplication.SiteSettings; tmp.ShowIntegralCover = HimallIO.GetRomoteImagePath(siteset.WXLogo); } objlist.Add(tmp); } result.IntegralCoupons = objlist.ToList(); result.HasMoreIntegralCoupons = coupons.Total > 3; } result.HasLogined = false; //用户积分与等级 if (CurrentUser != null) { //登录后处理会员积分 var userInte = MemberIntegralApplication.GetMemberIntegral(CurrentUser.Id); var userGrade = MemberGradeApplication.GetMemberGradeByUserIntegral(userInte.HistoryIntegrals); result.MemberAvailableIntegrals = userInte.AvailableIntegrals; result.MemberGradeName = userGrade.GradeName; result.HasLogined = true; } return(View(result)); }