Authored by yyq

global filter brand

... ... @@ -175,6 +175,11 @@ const getGlobalProductListData = (params, yoho) => {
latestWalk: 6 // 最近浏览记录
};
if (resData.list.filters && resData.list.filters.brand) {
_.set(resData.list, 'filters.brand.showAllBrands', true); // 设置首次展示品牌筛选所有品牌
}
// pathNav brand
let pathInfo = {};
if (dps.brand) {
... ... @@ -189,6 +194,7 @@ const getGlobalProductListData = (params, yoho) => {
}
}
// psthNav sort
let selectedSort = _.get(resData.list, 'leftContent.selectSort', {});
if (!_.isEmpty(selectedSort)) {
... ...
... ... @@ -122,7 +122,11 @@
<span id="brand-multi" class="multi-select">多选 +</span>
{{/if}}
</div>
<div data-role="all-brand"></div>
<div data-role="all-brand">
{{#if showAllBrands}}
{{> product/filter-brands-sync}}
{{/if}}
</div>
</div>
</div>
{{/ brand}}
... ...
<div class="brand-panel hide">
<div class="panel-head clearfix">
<p class="brands-index">
{{#each brandIndex}}
<span data-index="{{index}}">{{name}}</span>
{{/each}}
</p>
<div class="brand-search">
<input id="brand-search-input" type="text">
<span class="btn">
<i class="iconfont">&#xe60f;</i>
</span>
</div>
</div>
<div class="panel-body">
<div class="ul-scroll">
<ul class="check-container clearfix">
{{# brandsShow}}
<li class="attr {{#if checked}}checked{{/if}}" data-index="{{index}}" data-key="{{key}}">
<a href="{{href}}">
<span class="iconfont checkbox {{#if checked}}checked{{/if}}" data-id="{{id}}">
{{#if checked}}
&#xe613;
{{else}}
&#xe612;
{{/if}}
</span>
<span title="{{name}}">{{name}}</span>
</a>
</li>
{{/ brandsShow}}
</ul>
</div>
</div>
<div class="btns">
<button id="brand-multi-ok" class="multi-select-ok dis">确定</button>
<button class="multi-select-cancel">取消</button>
</div>
</div>
... ...
... ... @@ -162,7 +162,6 @@ if ($brandMore.length > 0) {
// 【品牌】加载更多品牌数据
function checkMoreBrands(callback) {
var squery = window.location.search;
// /product/search/filter/brands?callback=?
... ... @@ -170,6 +169,17 @@ function checkMoreBrands(callback) {
var brandsHtml;
var params = (location.search || '').substr(1);
// 直出brands list取消异步加载,目前只用于5.6全球购商品列表
if (!moreBrandLoaded && $filterBrands.find('.brand-panel').length) {
moreBrandLoaded = true;
// init brand vars
$brandInput = $filterBrands.find('#brand-search-input');
$brandPanel = $filterBrands.find('.brand-panel');
$brandAttrs = $brandPanel.find('.attr');
$brandsIndex = $('.brands-index');
}
if (squery && squery.length > 0) {
url += squery + '&callback=?';
} else {
... ...