private ProductContentModel TransformDescInfo(List <ProductContent> contentList) { contentList = contentList ?? new List <ProductContent>(); ProductContentModel result = new ProductContentModel(); result.Detail = GetContent(contentList, ProductContentType.Detail); string xmPerformance = GetContent(contentList, ProductContentType.Performance); result.Performance = ProductFacade.BuildProductPerformanceToHtml(xmPerformance); //购买须知移除html tag string attention = GetContent(contentList, ProductContentType.Attention); result.Attention = StringUtility.RemoveHtmlTag(attention); result.Warranty = GetContent(contentList, ProductContentType.Warranty); //包装html内容 MobileAppConfig config = AppSettings.GetCachedConfig(); if (config != null) { result.Detail = (config.ProductDescTemplate ?? "").Replace("${content}", result.Detail); result.Performance = (config.ProductSpecTemplate ?? "").Replace("${content}", result.Performance); } return(result); }
public void Configuration(IAppBuilder app) { HttpConfiguration config = new HttpConfiguration(); CreateContainer(config); MobileAppConfig.Configure(app, config); app.UseWebApi(config); }
public List <CategoryModel> GetCategoryList() { var allInfo = CategoryFacade.QueryCategoryInfosForHomePage(); List <CategoryModel> result = new List <CategoryModel>(); ClientType clientType = HeaderHelper.GetClientType(); string subFoler = "h"; if (clientType == ClientType.Android) { if (HeaderHelper.IsAndroidXHigh()) { subFoler = "xh"; } } else { subFoler = "ios"; } string baseUrl = ""; MobileAppConfig config = AppSettings.GetCachedConfig(); if (config != null && config.MobileAppServiceHost != null) { config.MobileAppServiceHost = config.MobileAppServiceHost.Trim(); if (!config.MobileAppServiceHost.EndsWith("/")) { config.MobileAppServiceHost += "/"; } baseUrl = config.MobileAppServiceHost; } foreach (var c1 in allInfo) { var m1 = Transform(c1); //获取一级分类图标 m1.ICon = BuildCatIcon(baseUrl, "c1", subFoler, c1.CategoryID.ToString(), "png");//CatHelper.GetIcon(c1.CategoryID); result.Add(m1); foreach (var c2 in c1.SubCategories) { var m2 = Transform(c2); //获取二级分类图标 m2.ICon = BuildCatIcon(baseUrl, "c2", subFoler, c2.CategoryID.ToString(), "jpg");//CatHelper.GetSubIcon(c1.CategoryID, c2.CategoryID); m1.SubCategories.Add(m2); foreach (var c3 in c2.SubCategories) { var m3 = Transform(c3); m2.SubCategories.Add(m3); } } } return(result); }
public MobileConfigurationsSelectionViewModel( MobileAppConfig appConfig, bool isSelected, ISettingsDataService settingsDataService, Action deselectAction, Action closePopupAction) { _appConfig = appConfig; IsSelected = isSelected; _settingsDataService = settingsDataService; _deselectAction = deselectAction; _closePopupAction = closePopupAction; }
private static ButtonConfigurationDTO GetButtonConfiguration(MobileAppConfig mobileApp, Func <string, string> getImage) { int opacityInt; var opacity = int.TryParse(mobileApp.ButtonTextAlpha, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out opacityInt) ? opacityInt / 100.0 : 1.0; return(new ButtonConfigurationDTO() { Image = getImage(mobileApp.ButtonDefaultAttachmentId), SelectedImage = getImage(mobileApp.ButtonHighlightAttachmentId), TextColor = ColorUtil.FromString(mobileApp.ButtonTextColor), Opacity = opacity, HighlightTextColor = ColorUtil.FromString(mobileApp.ButtonHighlightTextColor) }); }
/// <summary> /// 添加崩溃报告 /// </summary> /// <param name="content"></param> public void AddCrashLog(string content) { ClientType clientType = HeaderHelper.GetClientType(); List <KeyValuePair <string, object> > extList = new List <KeyValuePair <string, object> >(); extList.Add(new KeyValuePair <string, object>("X-OSVersion", HeaderHelper.GetOSVersion())); extList.Add(new KeyValuePair <string, object>("X-HighResolution", HeaderHelper.GetHighResolution())); Logger.WriteLog(content, clientType.ToString(), "", extList); MobileAppConfig config = AppSettings.GetCachedConfig(); content = content.Replace("\r\n", "<br/>"); content = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "<br/>" + content; EmailFacade.SendEmail(clientType.ToString() + "-app-crash-log", content, config.CrashLogEmailTo, "*****@*****.**"); }
private async Task <List <AttachmentMetadata> > GetAttachments(MobileAppConfig mobileApp, List <CategoryInfo> categoryInfos) { var categoriesAttachments = categoryInfos .SelectMany(ci => new[] { ci.Category.ThumbnailAttachmentId, ci.Config.LandscapeAttachmentId, ci.Config.PortraitAttachmentId, ci.Config.ContentAttachmentId, ci.Config.ContentOverAttachmentId, ci.Category.GalleryAttachmentId }) .ToList(); var attachmentsIDs = mobileApp .GetAllAttachmentIds() .ToList() .AppendList(categoriesAttachments) .Distinct() .Where(id => string.IsNullOrWhiteSpace(id) == false); return(await _attachmentDataService.GetAttachmentsMetadata(attachmentsIDs)); }
/// <summary> /// 获取赠品 /// </summary> /// <param name="info"></param> /// <param name="packageNo">套餐编号</param> /// <param name="ParentProductSysNo"></param> /// <param name="isGiftPool">0获取全部,1赠品池 2非赠品池</param> /// <returns></returns> private static List <OrderGiftItem> GetGiftItem(OrderInfo info, int packageNo, int parentProductSysNo, int isGiftPool) { List <OrderGiftItem> list = new List <OrderGiftItem>(); if (info.GiftItemList != null && info.GiftItemList.Count > 0) { MobileAppConfig config = AppSettings.GetCachedConfig(); ImageSize imageSize = ImageUrlHelper.GetImageSize(ImageType.Middle); string path = config.MobileAppServiceHost; foreach (OrderGiftItem item in info.GiftItemList) { if (string.IsNullOrEmpty(item.DefaultImage)) { item.DefaultImage = path.TrimEnd('/').TrimEnd('\\') + "/Resources/Images/shoppingcart" + (item.ProductSysNo % 4 + 1) + ".jpg"; } else { item.DefaultImage = ProductFacade.BuildProductImage(imageSize, item.DefaultImage); } if (isGiftPool == 0 && item.ParentProductSysNo == parentProductSysNo && item.ParentPackageNo == packageNo) { list.Add(item); } else if (isGiftPool == 1 && item.ParentProductSysNo == parentProductSysNo && item.ParentPackageNo == packageNo && item.IsGiftPool == true) { list.Add(item); } else if (isGiftPool == 2 && item.ParentProductSysNo == parentProductSysNo && item.ParentPackageNo == packageNo && item.IsGiftPool == false) { list.Add(item); } } } return(list); }