开放文档-SiC B2B2C Shop v2.0 : 示例-推荐位标签的使用
Created by
管理员
, last modified by
赵磊
on 2019-12-29
1.以大首页“特卖惠”为例(推荐商品)
<ul class="pic-list clearfix">
<% var r=site.recommend({number:'tmh'});%>
<% for(ri in r.siteRecommendItemList!){
var product=product.one({pid:ri.pId!});%>
<li>
<div class="p-picture">
<a target="_blank" href="${ri.url!}">
<img src="${ctxfs}${ri.path!}@160x160" onerror="fdp.defaultImage('${ctxStatic}/images/default_goods.png');"/>
</a>
</div>
<div class="text">
<a target="_blank" href="${ri.url!}">
<p class="p-name">${isNotEmpty(product.brandName!)?product.brandName!+'-':''}${product.name!}</p>
<p class="p-price">
<% if((product.type!)=='1'){%>
¥${product.minPrice1!}<span class="price-type"></span>
<%}%>
<% if((product.type!)=='2'){%>
¥${product.minPrice2!}<span class="price-type2"></span>
<%}%>
<% if((product.type!)=='3'){%>
¥${product.minPrice1!}<span class="price-type"></span>
<%}%>
<% if(isNotEmpty(product.marketPrice!)){%>
<span class="p-prom">¥${product.marketPrice!}</span>
<%}%>
</p>
</a>
</div>
</li>
<%}%>
<div class="clear"></div>
</ul>
2.以大首页“品牌商城”为例(推荐图片)
<div id="dos1" class="tab-pane active">
<ul class="piclink-list">
<% var recommend1=site.recommend({number:'ppsc'});%>
<% for(ri in recommend1.siteRecommendItemList){%>
<li>
<a target="_blank" href="${ri.url!}">
<img src="${ctxfs}${ri.path!}@!120X60" onerror="fdp.defaultImage('${ctxfs}/shop_init/store_logo.png');"/>
</a>
</li>
<%}%>
<div class="clear"></div>
</ul>
</div>