public JsonResult UpdateImageAd(long id, string pic, string url) { var image = SlideApplication.GetImageAd(0, id); if (!string.IsNullOrWhiteSpace(pic) && (!image.ImageUrl.Equals(pic))) { //转移图片 if (pic.Contains("/temp/")) { string source = pic.Substring(pic.LastIndexOf("/temp")); string dest = @"/Storage/Plat/ImageAd/"; pic = Path.Combine(dest, Path.GetFileName(source)); Core.MallIO.CopyFile(source, pic, true); } else if (pic.Contains("/Storage/")) { pic = pic.Substring(pic.LastIndexOf("/Storage")); } } var imageAd = new Entities.ImageAdInfo { ShopId = 0, Url = url, ImageUrl = pic, Id = id }; SlideApplication.UpdateImageAd(imageAd); return(Json(new Result { success = true })); }
public JsonResult AppIconChangeSequence(int oriRowNumber, int newRowNumber) { SlideApplication.UpdateWeixinSlideSequence(0, oriRowNumber, newRowNumber, Entities.SlideAdInfo.SlideAdType.APPIcon); return(Json(new Result { success = true })); }
public JsonResult APPGuidePages(List <string> pics) { List <Himall.DTO.SlideAdModel> list = new List <Himall.DTO.SlideAdModel>(); foreach (string str in pics) { if (!string.IsNullOrWhiteSpace(str)) { Himall.DTO.SlideAdModel item = new Himall.DTO.SlideAdModel { ImageUrl = str }; list.Add(item); } } if (list.Count == 0) { throw new HimallException("至少上传一张引导页图"); } SlideApplication.AddGuidePages(list); BaseController.Result data = new BaseController.Result { success = true }; return(base.Json(data)); }
public JsonResult DeleteSlideImage(string id) { Result result = new Result(); SlideApplication.DeleteSlidAd(0, Convert.ToInt64(id)); result.success = true; return(Json(result)); }
public JsonResult SlideImageChangeSequence(int oriRowNumber, int newRowNumber) { SlideApplication.UpdateWeixinSlideSequence(0, oriRowNumber, newRowNumber, Entities.SlideAdInfo.SlideAdType.IOSShopHome); return(Json(new Result { success = true })); }
/// <summary> /// 获取App引导页图片 /// </summary> /// <returns></returns> public List <Himall.DTO.SlideAdModel> GetAppGuidePages() { var result = SlideApplication.GetGuidePages(); foreach (var item in result) { item.ImageUrl = HimallIO.GetRomoteImagePath(item.ImageUrl); } return(result); }
public ActionResult APPGuidePages() { var slideImage = SlideApplication.GetSlidAds(0, Entities.SlideAdInfo.SlideAdType.AppGuide).OrderBy(a => a.DisplaySequence).ToList(); var model = slideImage.Select(a => new Mall.DTO.SlideAdModel() { Id = a.Id, DisplaySequence = a.DisplaySequence, ImageUrl = a.ImageUrl }).ToList(); return(View(model)); }
// GET: SellerAdmin/PageSettings public ActionResult Management() { var images = _iSlideAdsService.GetImageAds(CurrentSellerManager.ShopId).OrderBy(item => item.Id); var shop = _iShopService.GetShop(CurrentSellerManager.ShopId); ViewBag.Logo = shop.Logo; ViewBag.Logo = ViewBag.Logo == null ? "" : ViewBag.Logo; ViewBag.TransverseAD = images.FirstOrDefault(p => p.IsTransverseAD); ViewBag.SlidAds = SlideApplication.GetSlidAds(CurrentSellerManager.ShopId, Entities.SlideAdInfo.SlideAdType.ShopHome); ViewBag.IsOpenTopImageAd = shop.IsOpenTopImageAd; return(View(images.Where(p => !p.IsTransverseAD))); }
public List <Mall.DTO.SlideAdModel> GetAppGuidePages() { var result = SlideApplication.GetGuidePages(); foreach (var item in result) { item.ImageUrl = MallIO.GetRomoteImagePath(item.ImageUrl); } if (result == null) { result = new List <DTO.SlideAdModel>(); } return(result); }
public JsonResult GetAPPIcons() { //轮播图 var slideImageSettings = SlideApplication.GetSlidAds(0, Entities.SlideAdInfo.SlideAdType.APPIcon).ToArray(); var slideModel = slideImageSettings.Select(item => { var slideImage = SlideApplication.GetSlidAd(0, item.Id); return(new { id = item.Id, imgUrl = Core.MallIO.GetImagePath(item.ImageUrl), displaySequence = item.DisplaySequence, url = item.Url, description = item.Description }); }); return(Json(new { rows = slideModel, total = 100 })); }
public JsonResult APPGuidePages(List <string> pics) { List <Himall.DTO.SlideAdModel> list = new List <DTO.SlideAdModel>(); foreach (var p in pics) { if (!string.IsNullOrWhiteSpace(p)) { list.Add(new DTO.SlideAdModel() { ImageUrl = p }); } } if (list.Count == 0) { throw new HimallException("至少上传一张引导页图"); } SlideApplication.AddGuidePages(list); return(Json(new { success = true })); }
public JsonResult SaveSlideAds(List <SlideAdsModel> slideads) { //每次都重新保存序号 if (slideads != null && slideads.Count > 0) { List <SlideAdInfo> list = new List <SlideAdInfo>(); foreach (var item in slideads) { var slide = new Entities.SlideAdInfo() { ImageUrl = item.Pic, Url = item.Url, ShopId = CurrentSellerManager.ShopId, DisplaySequence = slideads.IndexOf(item) + 1, Id = item.Id, TypeId = Entities.SlideAdInfo.SlideAdType.ShopHome }; if (!string.IsNullOrWhiteSpace(item.Pic) && item.Pic.Contains("/temp/")) { string dest = string.Format(@"/Storage/Shop/{0}/ImageAd/", CurrentSellerManager.ShopId); var destimg = slide.ImageUrl = Path.Combine(dest, Path.GetFileName(item.Pic)); var source = item.Pic.Substring(item.Pic.LastIndexOf("/temp/")); Core.HimallIO.CopyFile(source, destimg, true); slide.ImageUrl = destimg; } else if (item.Pic.Contains("/Storage/")) { slide.ImageUrl = item.Pic.Substring(item.Pic.LastIndexOf("/Storage/")); } else { slide.ImageUrl = ""; } list.Add(slide); } SlideApplication.BatchAddShopHome(list, CurrentSellerManager.ShopId); ClearCache(); } return(Json(new { success = true })); }
public JsonResult AddSlideImage(string id, string description, string imageUrl, string url) { Result result = new Result(); var slideAdInfo = new Entities.SlideAdInfo(); slideAdInfo.Id = Convert.ToInt64(id); slideAdInfo.ImageUrl = imageUrl; slideAdInfo.TypeId = Entities.SlideAdInfo.SlideAdType.IOSShopHome; slideAdInfo.Url = url.ToLower(); slideAdInfo.Description = description; slideAdInfo.ShopId = 0; if (slideAdInfo.Id > 0) { SlideApplication.UpdateSlidAd(slideAdInfo); } else { SlideApplication.AddSlidAd(slideAdInfo); } result.success = true; return(Json(result)); }
/// <summary> /// 多门店首页 /// </summary> /// <returns></returns> public JsonResult <Result <dynamic> > GetShopsIndexData() { CheckOpenStore(); var model = SlideApplication.GetShopBranchListSlide(); var defaultImage = new Himall.DTO.SlideAdModel { }; var adimgs = model.Where(e => e.TypeId == Entities.SlideAdInfo.SlideAdType.NearShopBranchSpecial); var siteinfo = SiteSettingApplication.SiteSettings; dynamic result = new ExpandoObject(); result.QQMapKey = CommonConst.QQMapKey; result.TopSlide = model.Where(e => e.TypeId == Entities.SlideAdInfo.SlideAdType.NearShopBranchHome).ToList(); //顶部轮播图 result.Menu = model.Where(e => e.TypeId == Entities.SlideAdInfo.SlideAdType.NearShopBranchIcon).ToList(); //菜单图 result.ADImg1 = adimgs.Count() > 0 ? adimgs.ElementAt(0) : defaultImage; //广告图1 result.ADImg2 = adimgs.Count() > 1 ? adimgs.ElementAt(1) : defaultImage; //广告图2 result.ADImg3 = adimgs.Count() > 2 ? adimgs.ElementAt(2) : defaultImage; //广告图3 result.ADImg4 = adimgs.Count() > 3 ? adimgs.ElementAt(3) : defaultImage; //广告图4 result.ADImg5 = adimgs.Count() > 4 ? adimgs.ElementAt(4) : defaultImage; //广告图5 result.MiddleSlide = model.Where(e => e.TypeId == Entities.SlideAdInfo.SlideAdType.NearShopBranchHome2).ToList(); //中间轮播图 return(JsonResult <dynamic>(result)); }
// GET: Admin/APPShop //APP首页配置共用于安卓和IOS,这里的平台类型写的为IOS,安卓调用首页接口数据时平台类型也选IOS public ActionResult HomePageSetting() { var homeTopicInfos = MobileHomeTopicApplication.GetMobileHomeTopicInfos(PlatformType.IOS); //专题 ViewBag.imageAds = SlideApplication.GetImageAds(0).Where(p => p.TypeId == ImageAdsType.APPSpecial).ToList(); //门店授权 ViewBag.IsOpenStore = SiteSettingApplication.SiteSettings.IsOpenStore; var topics = TopicApplication.GetTopics(homeTopicInfos.Select(p => p.TopicId).ToList()); var models = homeTopicInfos.Select(item => { var topic = topics.FirstOrDefault(p => p.Id == item.TopicId); return(new TopicModel() { FrontCoverImage = topic.FrontCoverImage, Id = item.Id, Name = topic.Name, Tags = topic.Tags, Sequence = item.Sequence }); }); return(View(models)); }
public JsonResult GetImageAd(long id) { var models = SlideApplication.GetImageAd(0, id); return(Json(new { success = true, imageUrl = Core.HimallIO.GetImagePath(models.ImageUrl), url = models.Url }, JsonRequestBehavior.AllowGet)); }
/// <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)); }
public JsonResult GetImageAd(long id) { var models = SlideApplication.GetImageAd(0, id); return(Json(new { success = true, imageUrl = Core.MallIO.GetImagePath(models.ImageUrl), url = models.Url })); }