Exemplo n.º 1
0
        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);
        }