/// <summary> /// 获取在商品吧详细页的用户浏览历史 /// </summary> /// <returns></returns> public static string GetProductDetailBrowserHistoryProductsHTML() { string productDetailBroswerHistoryHTML = String.Empty; string cookie = CookieUtil.GetDESEncryptedCookieValue(CookieUtil.Cookie_BrowseHistory); ArrayList al = CustomerBrowserHistoryProductService.GetBrowseHistoryList(cookie); if (al != null) { StringBuilder strb = new StringBuilder("<ul class='group'>"); string liHTML = @"<li><a class='photo' href='{0}'> <img alt='{1}' src='{2}' width='60' height='60'></a> <div> <a class='name' title='{3}' href='{4}'>{5}</a> <span class='adText'>{6}</span> </div> <p class='price'> <b>¥{7}</b><span>¥{8}</span></p> </li>"; var products = al.ToArray().Take(4); foreach (CustomerBrowserHistoryProduct product in products) { string thumbImg = YoeJoyConfig.ImgVirtualPathBase + product.SmallImg; string deeplink = YoeJoyConfig.SiteBaseURL + "Pages/Product.aspx?c1=" + product.C1SysNo + "&c2=" + product.C2SysNo + "&c3=" + product.C3SysNo + "&pid=" + product.ProductSysNo; strb.Append(String.Format(liHTML, deeplink, product.ProductBriefName, thumbImg, product.ProductBriefName, deeplink, product.ProductBriefName, product.PromotionWord, product.CurrentPrice, product.StandardPrice)); } strb.Append("</ul>"); productDetailBroswerHistoryHTML = strb.ToString(); } return(productDetailBroswerHistoryHTML); }
/// <summary> /// 获得用户的所有浏览商品记录 /// </summary> /// <returns></returns> public static string GetCustomerBrowserHistoryProductsAllHTML() { string productDetailBroswerHistoryHTML = String.Empty; string cookie = CookieUtil.GetDESEncryptedCookieValue(CookieUtil.Cookie_BrowseHistory); ArrayList al = CustomerBrowserHistoryProductService.GetBrowseHistoryList(cookie); if (al != null) { StringBuilder strb = new StringBuilder(); string liHTML = @"<tr> <td> <span>2012-09-09 21:30</span> </td> <td> <a href='{0}'> <img src='{1}'></a> <em><b>{2}</b><br> <span>攸怡价:<strong>¥{3}</strong> 市场价:<i>¥{4}</i> </span></em> </td> <td style='text-align: left;'> <a href='#'> <img src='../static/images/history.jpg'></a><br> <a href='#'> <img src='../static/images/adda.jpg'></a><br> <a href='#'>清除浏览历史</a> </td> </tr>"; var products = al.ToArray(); foreach (CustomerBrowserHistoryProduct product in products) { string thumbImg = YoeJoyConfig.ImgVirtualPathBase + product.LargeImg; string deeplink = YoeJoyConfig.SiteBaseURL + "Pages/Product.aspx?c1=" + product.C1SysNo + "&c2=" + product.C2SysNo + "&c3=" + product.C3SysNo + "&pid=" + product.ProductSysNo; strb.Append(String.Format(liHTML, deeplink, thumbImg, product.ProductBriefName, product.CurrentPrice, product.StandardPrice)); } productDetailBroswerHistoryHTML = strb.ToString(); } return(productDetailBroswerHistoryHTML); }