@Autowired
private RedisTemplate redisTemplate;
/**
*查询品牌和规格列表
*@param category 分类名称
*@return
*/
private Map searchBrandAndSpecList(String category){ Map map=new HashMap();
Long typeId = (Long) redisTemplate.boundHashOps("itemCat").get(category);//
获取模板 ID
if(typeId!=null){
//根据模板 ID 查询品牌列表
List brandList = (List) redisTemplate.boundHashOps("brandList").get(typeId);
map.put("brandList", brandList);//返回值添加品牌列表
//根据模板 ID 查询规格列表
List specList = (List) redisTemplate.boundHashOps("specList").get(typeId);
map.put("specList", specList);
}
return map;
}
@Override
public Map<String, Object> search(Map searchMap) { Map<String,Object> map=new HashMap<>();
//1.按关键字查询(高亮显示)
//2.根据关键字查询商品分类
//3.查询品牌和规格列表
if(categoryList.size()>0){ map.putAll(searchBrandAndSpecList(categoryList.get(0)));
}
return map;
}
< div class="type-wrap logo" ng-if="resultMap.brandList!=null">
<div class="fl key brand">品牌</div>
<div class="value logos">
<ul class="logo-list">
<li ng-repeat="brand in resultMap.brandList">
{{brand.text}}
</li>
</ul>
</div>
<div class="ext">
<a href="javascript:void(0);" class="sui-btn">多选</a>
<a href="javascript:void(0);">更多</a>
</div>
</div>
< div class="type-wrap" ng-repeat="spec in resultMap.specList">
<div class="fl key">{{spec.text}}</div>
<div class="fl value">
<ul class="type-list">
<li ng-repeat="pojo in spec.options">
<a>{{pojo.optionName}}</a>
</li>
</ul>
</div>
<div class="fl ext"></div>
</div>
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |