Ticket #94 (closed 总结: fixed)
intel超极本推广方案的实现
| Reported by: | yuanhuoqing | Owned by: | yuanhuoqing, |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | 报价库 | Version: | 报价库4.0 |
| Keywords: | Cc: | ||
| Due Date: | 09/03/2012 |
Description
前提:超极本的产品必须都要在笔记本小类下,每个产品有唯一的url,区别于zol等有两个url,有利于seo和方便编辑维护。
实现方案
1、超极本的产品在笔记本小类下,并为笔记本的产品的配置产品定位增加一个超极本的属性值:Ultrabook(超极本)
2、为超极本建一个小类,并为这个小类加上需要用到的配置项和自定义查询项,超极本有个独立索引页,查询走lucene索引;
代码:
long sId = ju.param("smallTypeId", 0); //小类id
long lsId = 0;
if(sId==95585){// 95585为超级本
lsId = sId;
sId = 20807;
}
request.setAttribute("lsId", lsId);
if(lsId>0){ //如果是超级本 走索引查询
pager = service.searchIndexProduct(keyword, sId, bId, vId, pId, ps, pe, cIds, aId, history, hasPrice, order, pageNo,lsId);
}else{
pager = service.searchProduct(keyword, sId, bId, vId, pId, ps, pe, cIds, aId, history, hasPrice, order, pageNo);
}
3、 超级本样式显示是做特殊处理,如果是超级本就露出相应的样式,报价索引页的超级本参数露出由后台特殊处理后生成,产品终端页的超级本参数判断是否是超级本后特殊处理。
代码:
报价索引页参数处理:
产品库的DbProduct类的方法
public String genPriceConfig(ConfigProfile cp) throws AppException {
StringBuffer buf = new StringBuffer();
if (cp == null)
cp = ConfigProfileManager.getInstance().getAncestorConfigProfile(
this.getTypeId());
List items = this.getProductItemWEB(cp);
//判断产品是否是超级本
boolean isUltrabook = this.isUltrabook(items);
int ultrabookCount = 0;
for (int i = 0, c = items.size(); i < c; ++i) {
ProductItemWEB item = (ProductItemWEB) items.get(i);
if(isUltrabook){
boolean isUltrabookItem =item.getTitle().equals( "处理器" )||item.getTitle().equals( "内存容量" )
||item.getTitle().equals( "硬盘容量" )||item.getTitle().equals( "屏幕尺寸" )||item.getTitle().equals( "硬盘类型" )
||item.getTitle().equals( "厚度" )||item.getTitle().equals( "重量" )||item.getTitle().equals( "产品定位" );
if(isUltrabookItem){
ultrabookCount++;
if (buf.length() != 0)
buf.append(SPLIT_CHAR);
buf.append(item.getTitle()).append(':').append(
item.getDisplayValue());
}
if(ultrabookCount>8){
break;
}
}else{
if ((item.getConfigType() == ProductItemWEB.CONFIG_TYPE_NORMAL || item
.getConfigType() == ProductItemWEB.CONFIG_TYPE_MODIFY)
&& item.isPriceSystemUse()
&& !item.getDisplayValue().equals("")) {
if (buf.length() != 0)
buf.append(SPLIT_CHAR);
buf.append(item.getTitle()).append(':').append(
item.getDisplayValue());
}
}
}
if (buf.length() > ITEM_SUMMARY_LENGTH)
return buf.substring(0, ITEM_SUMMARY_LENGTH);
else
return buf.toString();
}
产品终端页超级本参数处理:
Product_1.jsp下
<c:if test="${isUltrabook&&iiRun < itemCount}">
<c:if test="${item.title.equals('处理器')||item.title.equals('内存容量')||item.title.equals('屏幕尺寸')||item.title.equals('硬盘类型')||item.title.equals('厚度')||item.title.equals('重量')}">
<li title="${item.displayValue}"><i class="tit">${fn:substring(item.title, 0, 4)}:</i>${item.displayValueEx2011}
<c:set var="iiRun" value="${iiRun + 1}"></c:set>
</c:if>
</c:if>
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
![(please configure the [header_logo] section in trac.ini)](http://www1.pconline.com.cn/hr/2009/global/images/logo.gif)
