Authored by yyq

global filter brand

@@ -175,6 +175,11 @@ const getGlobalProductListData = (params, yoho) => { @@ -175,6 +175,11 @@ const getGlobalProductListData = (params, yoho) => {
175 latestWalk: 6 // 最近浏览记录 175 latestWalk: 6 // 最近浏览记录
176 }; 176 };
177 177
  178 + if (resData.list.filters && resData.list.filters.brand) {
  179 + _.set(resData.list, 'filters.brand.showAllBrands', true); // 设置首次展示品牌筛选所有品牌
  180 + }
  181 +
  182 + // pathNav brand
178 let pathInfo = {}; 183 let pathInfo = {};
179 184
180 if (dps.brand) { 185 if (dps.brand) {
@@ -189,6 +194,7 @@ const getGlobalProductListData = (params, yoho) => { @@ -189,6 +194,7 @@ const getGlobalProductListData = (params, yoho) => {
189 } 194 }
190 } 195 }
191 196
  197 + // psthNav sort
192 let selectedSort = _.get(resData.list, 'leftContent.selectSort', {}); 198 let selectedSort = _.get(resData.list, 'leftContent.selectSort', {});
193 199
194 if (!_.isEmpty(selectedSort)) { 200 if (!_.isEmpty(selectedSort)) {
@@ -122,7 +122,11 @@ @@ -122,7 +122,11 @@
122 <span id="brand-multi" class="multi-select">多选 +</span> 122 <span id="brand-multi" class="multi-select">多选 +</span>
123 {{/if}} 123 {{/if}}
124 </div> 124 </div>
125 - <div data-role="all-brand"></div> 125 + <div data-role="all-brand">
  126 + {{#if showAllBrands}}
  127 + {{> product/filter-brands-sync}}
  128 + {{/if}}
  129 + </div>
126 </div> 130 </div>
127 </div> 131 </div>
128 {{/ brand}} 132 {{/ brand}}
  1 +<div class="brand-panel hide">
  2 + <div class="panel-head clearfix">
  3 + <p class="brands-index">
  4 + {{#each brandIndex}}
  5 + <span data-index="{{index}}">{{name}}</span>
  6 + {{/each}}
  7 + </p>
  8 +
  9 + <div class="brand-search">
  10 + <input id="brand-search-input" type="text">
  11 + <span class="btn">
  12 + <i class="iconfont">&#xe60f;</i>
  13 + </span>
  14 + </div>
  15 + </div>
  16 +
  17 + <div class="panel-body">
  18 + <div class="ul-scroll">
  19 + <ul class="check-container clearfix">
  20 + {{# brandsShow}}
  21 + <li class="attr {{#if checked}}checked{{/if}}" data-index="{{index}}" data-key="{{key}}">
  22 + <a href="{{href}}">
  23 + <span class="iconfont checkbox {{#if checked}}checked{{/if}}" data-id="{{id}}">
  24 + {{#if checked}}
  25 + &#xe613;
  26 + {{else}}
  27 + &#xe612;
  28 + {{/if}}
  29 + </span>
  30 + <span title="{{name}}">{{name}}</span>
  31 + </a>
  32 + </li>
  33 + {{/ brandsShow}}
  34 + </ul>
  35 + </div>
  36 + </div>
  37 +
  38 + <div class="btns">
  39 + <button id="brand-multi-ok" class="multi-select-ok dis">确定</button>
  40 + <button class="multi-select-cancel">取消</button>
  41 + </div>
  42 +</div>
@@ -162,7 +162,6 @@ if ($brandMore.length > 0) { @@ -162,7 +162,6 @@ if ($brandMore.length > 0) {
162 162
163 // 【品牌】加载更多品牌数据 163 // 【品牌】加载更多品牌数据
164 function checkMoreBrands(callback) { 164 function checkMoreBrands(callback) {
165 -  
166 var squery = window.location.search; 165 var squery = window.location.search;
167 166
168 // /product/search/filter/brands?callback=? 167 // /product/search/filter/brands?callback=?
@@ -170,6 +169,17 @@ function checkMoreBrands(callback) { @@ -170,6 +169,17 @@ function checkMoreBrands(callback) {
170 var brandsHtml; 169 var brandsHtml;
171 var params = (location.search || '').substr(1); 170 var params = (location.search || '').substr(1);
172 171
  172 + // 直出brands list取消异步加载,目前只用于5.6全球购商品列表
  173 + if (!moreBrandLoaded && $filterBrands.find('.brand-panel').length) {
  174 + moreBrandLoaded = true;
  175 +
  176 + // init brand vars
  177 + $brandInput = $filterBrands.find('#brand-search-input');
  178 + $brandPanel = $filterBrands.find('.brand-panel');
  179 + $brandAttrs = $brandPanel.find('.attr');
  180 + $brandsIndex = $('.brands-index');
  181 + }
  182 +
173 if (squery && squery.length > 0) { 183 if (squery && squery.length > 0) {
174 url += squery + '&callback=?'; 184 url += squery + '&callback=?';
175 } else { 185 } else {